Add BN254 and BLS12-381 Groth16 verifier (Circom, Gnark, and Arkworks)#396
Add BN254 and BLS12-381 Groth16 verifier (Circom, Gnark, and Arkworks)#396mysteryon88 wants to merge 17 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
There was a problem hiding this comment.
Pull request overview
Adds example inputs and generated Soroban verifier contract crates demonstrating how to use the Soroban Groth16 verifier generator with Circom- and Gnark-produced artifacts.
Changes:
- Added Circom and Gnark example proof/VK JSON fixtures under
groth16_verifier_gen/data/. - Added two generated Soroban verifier contract crates (
verifier,gnark_verifier) with basic tests. - Added
groth16_verifier_genworkspace scaffolding/docs (README, workspace Cargo files, gitignore), plus an unrelatedaccount/Cargo.lockupdate.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| groth16_verifier_gen/data/gnark/verification_key.json | Adds Gnark verification key fixture for generator usage/testing. |
| groth16_verifier_gen/data/gnark/proof.json | Adds Gnark proof fixture for generator usage/testing. |
| groth16_verifier_gen/data/circom/verification_key.json | Adds Circom verification key fixture for generator usage/testing. |
| groth16_verifier_gen/data/circom/public.json | Adds Circom public inputs fixture for generator usage/testing. |
| groth16_verifier_gen/data/circom/proof.json | Adds Circom proof fixture for generator usage/testing. |
| groth16_verifier_gen/contracts/verifier/src/test.rs | Adds tests for the generated verifier contract (Circom fixtures). |
| groth16_verifier_gen/contracts/verifier/src/lib.rs | Adds generated verifier contract implementation with embedded VK bytes. |
| groth16_verifier_gen/contracts/verifier/Cargo.toml | Adds contract crate manifest for the generated verifier. |
| groth16_verifier_gen/contracts/gnark_verifier/src/test.rs | Adds tests that load Gnark proof JSON and call the contract verifier. |
| groth16_verifier_gen/contracts/gnark_verifier/src/lib.rs | Adds generated verifier contract implementation for Gnark VK bytes. |
| groth16_verifier_gen/contracts/gnark_verifier/Cargo.toml | Adds contract crate manifest for the generated Gnark verifier. |
| groth16_verifier_gen/README.md | Documents how to run the verifier generator on the included fixtures. |
| groth16_verifier_gen/Cargo.toml | Adds workspace definition for the generated example contracts. |
| groth16_verifier_gen/Cargo.lock | Adds lockfile for the new workspace. |
| groth16_verifier_gen/.gitignore | Adds ignore rules for build artifacts and local Soroban config. |
| account/Cargo.lock | Updates lockfile dependencies (appears unrelated to this PR’s stated scope). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I don't think this should be its own example.. The groth16 example was generated with circom/snarkjs with parameters included, if you feel strongly it should also have Gnark support, perhaps open a PR in the same example with another set of data? The project you mentioned in the description is a code generator, which clearly isn't this example here. |
|
Thanks for the feedback, that’s fair. I think part of the reason I made it a separate example is that I felt a bit uncomfortable modifying or reusing an existing example, so I created a new one instead. I understand your point though, and I’ll update the PR soon to extend the existing Groth16 example rather than adding a new one. It was also important for me to share a small utility I wrote for generating the contract / VK bindings, to avoid manual translation. Similar generators exist in other ecosystems, but I haven’t seen one for Stellar/Soroban yet. I’ll rework the PR accordingly. |
@mysteryon88 no worries! didn't mean to dismiss the work, this is a nice contribution improving its usability. |
|
Hi, I’ve updated the repository - I’d be glad to get your feedback! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 56 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@jayz22, hi! Is there any chance that my PR will be accepted? |
@mysteryon88 sorry for the late response.
let me know if this makes sense. |
|
@jayz22 thanks, this makes sense. I’ll start restructuring the PR and should have the main changes pushed in the next couple of hours. After that, feel free to commit directly to my branch if you want to adjust or finish anything. |
|
@jayz22 hi, I’ve done it. Could you take a look and make any edits if needed? I think it turned out pretty well. |
What
Added usage examples for the Soroban Groth16 verifier contract generator implemented in this project, using proofs and verification keys produced by Circom, Gnark, and Arkworks.
Why
These examples demonstrate how the generator can be used with popular ZK frameworks to generate Soroban-compatible verifier contracts and make the intended workflow clearer for users.
Known limitations