libiop icon indicating copy to clipboard operation
libiop copied to clipboard

Unsatisfied proof for very small circuits when num_inputs = 1

Open vherbert opened this issue 4 years ago • 2 comments

Hi,

I test a simple R1CS with Fractal's libiop and matrices of order 8

I face an unexplained behaviour.

The R1CS is satisfied if I gave 0, 3, 7 primary inputs.

In contrast, if I gave 1, the proof does not verify fully.

That is, I obtain this message:

  • IOP transcript valid: true
  • Full protocol decision predicate satisfied: false

In other words, this configuration works, for instance:

const size_t num_inputs =0; const size_t num_variables = 7; const size_t num_constraints = num_variables + 1;

This one does not:

const size_t num_inputs =1; const size_t num_variables = 7; const size_t num_constraints = num_variables + 1;

Can you explain this behaviour? Thanks in advance.

vherbert avatar Jul 24 '20 14:07 vherbert

Hrmm, this is odd, I'll investigate this, thanks for reporting it. It should work with 1 input

ValarDragon avatar Jul 31 '20 18:07 ValarDragon

I think this is an issue with the number of constraints/variables being so low. The library doesn't have much parameterization support for the case where max(num_constraints, num_variables) < 128. (Essentially due to some internal details of the SNARK, you have to paremeterize things differently under this regime. There isn't a notable efficiency difference between proving/verifying circuits of size <= 128)

Using 1 input works for larger sizes. (e.g. >= 128 constraints)

Is this an important case to consider? If so, I can see what it would take to add parameterization for this (or alternatively just pad the constraint system accordingly)

ValarDragon avatar Aug 15 '20 06:08 ValarDragon