Skip to content

Proof of concept groth16 verifier #350

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

Merged
merged 17 commits into from
May 21, 2025
Merged

Conversation

jayz22
Copy link
Contributor

@jayz22 jayz22 commented Dec 19, 2024

What

Implements a Groth16 verifier contract, and in the test verifies a simple proof generated off-chain.

See README for how the proof and verification data was generated.

Here is the demo

Why

This implementation demonstrates the BLS12-381 curve operations in Soroban, enabling zero-knowledge proof verification on-chain. The simple multiplication circuit (a * b = c) serves as a proof-of-concept for more complex ZK applications.

Known limitations

[TODO or N/A]

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment relating to potential API traps and if there's an opportunity to improve either the example of the SDK. I'm not the best person to review the groth specifics. Do we have anyone else who is up on that? Otherwise I can approve.

github-merge-queue bot pushed a commit to stellar/rs-soroban-sdk that referenced this pull request May 9, 2025
### What

Split out point negation part
([0945897](0945897))
from #1449, and address
review comments on this part.

### Why

Improves usability of the BLS12-381 features in a Groth16 verifier
application ([example
contract](stellar/soroban-examples#350))

- `Neg` is an common operation, needed for using the proof parameter as
pairing input, and is cheap and simple enough to be implemented as an
sdk function.

### Known limitations

[TODO or N/A]
github-merge-queue bot pushed a commit to stellar/rs-soroban-sdk that referenced this pull request May 16, 2025
### What

Add support for BLS12-381 curve points (`Fp`, `Fp2`, `G1Affine`,
`G2Affine`, `Fr`) for internal data storage (via `contracttype`) and
contract invocation arguments (contract spec).

### Why

Improves usability of the BLS12-381 features in a Groth16 verifier
application ([example
contract](stellar/soroban-examples#350))
- `Arbitrary` and several missing conversions are needed to use
`G1Affine`, `G2Affine` as contract data.

### Known limitations

[TODO or N/A]

---------

Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
update link

fmt

clean up and update

improve writing
@jayz22 jayz22 force-pushed the groth16verifier branch from 3498821 to b6bf5e8 Compare May 18, 2025 16:42
@jayz22 jayz22 marked this pull request as ready for review May 18, 2025 16:42
@leighmcculloch leighmcculloch enabled auto-merge (squash) May 21, 2025 06:56
@leighmcculloch leighmcculloch merged commit 11083c9 into stellar:main May 21, 2025
113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants