libiop
libiop copied to clipboard
Unsatisfied proof for very small circuits when num_inputs = 1
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.
Hrmm, this is odd, I'll investigate this, thanks for reporting it. It should work with 1 input
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)