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

SE SNARK verifier gadget #127

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

imeckler
Copy link

@imeckler imeckler commented Aug 9, 2018

This PR implements a gadget for verifying Groth--Maller 17 SNARKs (r1cs_se_ppzksnark). To do so, it does the following:

  • Changes the r1cs_se_ppzksnark verification key to contain e(G_alpha, H_beta)
  • Adds a simple gadget for checking the equality of a vector of field elements
  • Makes a few modifications to field extension gadgets
  • Adds a G2 curve addition gadget
  • Changes the weierstrass miller loop gadget to handle negative loop lengths correctly
  • Adds a few simple pairing gadgets
  • Adds a verifier gadget for the GM17 SNARK

I've made each commit fairly self contained (and with decent descriptions in the commit messages). I know these are a lot of changes, so if you all would prefer they be split up between a few PRs, happy to do so.

There is also a change here that requires modifying libff slightly. How do you all coordinate updates between the repos?

@imeckler
Copy link
Author

imeckler commented Aug 9, 2018

Oh also - thank you to @akattis for figuring out the negative loop length issue and @bekahoxoo for reviewing.

@howardwu
Copy link
Member

howardwu commented Aug 9, 2018

Note that these changes include modifications to the current implementation of se_ppzksnark. These changes will affect the reported performance benchmarks as provided in the ppzksnark README: https://github.com/scipr-lab/libsnark/tree/master/libsnark/zk_proof_systems/ppzksnark

@imeckler
Copy link
Author

imeckler commented Aug 9, 2018

@howardwu I don't think any of the changes I made will affect performance in any meaningful way. The primary difference is that the key generator now has to do one pairing to precompute G_alpha_H_beta (this is a few milliseconds).

@imeckler
Copy link
Author

imeckler commented Aug 9, 2018

Ah - it does affect the verification key size I suppose. Although if you prefer we can make the serializer not write down G_alpha_H_beta and recompute it when we deserialize

@howardwu
Copy link
Member

howardwu commented Aug 9, 2018

I believe the current approach is fine (@popoffka and @madars, feel free to chime in), we'll just need to have the table in the ppzksnark README updated to reflect the change.

@howardwu
Copy link
Member

howardwu commented Aug 9, 2018

There is also a change here that requires modifying libff slightly. How do you all coordinate updates between the repos?

In this case, coordinated updates are made by first introducing the necessary (non-breaking) change in libff, followed by bumping the dependency versions in libfqfft and libsnark, and lastly by merging in the new functionality in libsnark.

@HarryR
Copy link

HarryR commented Dec 6, 2018

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants