-
Notifications
You must be signed in to change notification settings - Fork 423
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
Feat/switch groth16 key #1357
Feat/switch groth16 key #1357
Conversation
I'm a bit behind on reviews and will get to it soon |
6ffa023
to
4e1aa27
Compare
I rebased on top of master and fixed conflicting changes. I'll still have a look at the Groth16 test and add tests for MuxG2/MuxGt. And I'd like to write documentation example. But in general looks good. |
Super nice!!
|
1f67b21
to
59fb979
Compare
b64c6e1
to
716ab04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements key switching for Groth16 recursion by adding a new function SwitchVerificationKey that selects among multiple verification keys based on a runtime selector. Additionally, it provides new helper methods (MuxG2 and MuxGt) along with comprehensive tests across several pairing and verifier packages to support recursive verification for multiple circuits.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
std/algebra/native/sw_bls24315/pairing2_test.go | Added helper functions and tests for MuxG2/MuxGt in the context of Groth16 key switching. |
std/algebra/emulated/sw_bw6761/pairing.go | Implemented MuxG2 and MuxGt functions and integrated them into the pairing API. |
std/algebra/emulated/sw_bn254/pairing_test.go | Updated tests to exercise pairing mux functions for BN254 curves. |
std/algebra/native/sw_bls12377/pairing2_test.go | Updated tests and circuit definitions to validate Groth16 key switching for BLS12-377 proofs. |
std/recursion/groth16/verifier.go | Introduced the SwitchVerificationKey functionality and updated references to commitment verification. |
std/algebra/interfaces.go & std/recursion/plonk/verifier.go | Minor interface updates to support the new MuxG2 and MuxGt methods. |
Thanks! It is super useful. It also revealed a bug we had before. |
Description
This PR implements
SwitchVerificationKey
for groth16 recursion. By including two verification keys for similar circuits, it allows recursive verification of multiple proofs for both circuits, seamlessly switching between their corresponding verification keys as needed.Type of change
How has this been tested?
There are three similar tests that verify that two proofs from two different circuits are in the third circuit. Each test uses different curves for the inner and outer circuits:
TestMultipleBN254InBN254
TestMultipleBLS12InBW6
TestMultipleBW6InBN254
Checklist:
golangci-lint
does not output errors locally