scipr-lab / libsnark

C++ library for zkSNARKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assert(!qap_wit.coefficients_for_H[qap_wit.degree()-2].is_zero()) needed?

meilof opened this issue · comments

I am using libsnark with the Groth16 proofs, and it seems to work fine, except that in some small examples, the assertion

assert(!qap_wit.coefficients_for_H[qap_wit.degree()-2].is_zero());

in r1cs_gg_ppzksnark_prover fires. This happens in particular with a constraint system like this:

x*x=y
x*y=z
0*0=z-a

I saw that some other users experienced the same error: pepper-project/pequin#55

I was wondering if this assertion is actually needed. I quickly scanned through Groth16 and it does not seem to mention that the degree of H has to be exactly qap_wit.degree()-2 or that the input constraint systems need to satisfy some kind of property? Do you have an explanation of why this assertion is there or exactly for what kinds of constraint systems it occurs?

Thanks!