Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsatisfied proof for very small circuits when num_inputs = 1 #13

Open
vherbert opened this issue Jul 24, 2020 · 2 comments
Open

Unsatisfied proof for very small circuits when num_inputs = 1 #13

vherbert opened this issue Jul 24, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@vherbert
Copy link

vherbert commented Jul 24, 2020

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 vherbert changed the title Unsatisfied proof if first input is public Unsatisfied proof only if 1 public input Jul 24, 2020
@vherbert vherbert changed the title Unsatisfied proof only if 1 public input Unsatisfied proof only if num_inputs = 1 Jul 24, 2020
@ValarDragon
Copy link
Member

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

@ValarDragon ValarDragon added the bug Something isn't working label Aug 14, 2020
@ValarDragon
Copy link
Member

ValarDragon commented Aug 15, 2020

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 ValarDragon changed the title Unsatisfied proof only if num_inputs = 1 Unsatisfied proof for very small circuits when num_inputs = 1 Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants