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

feat: bls12-381 support #207

Merged
merged 11 commits into from
Jul 9, 2024
Merged

feat: bls12-381 support #207

merged 11 commits into from
Jul 9, 2024

Conversation

chancehudson
Copy link
Collaborator

@chancehudson chancehudson commented Jul 9, 2024

Closes #203

This PR implements zkey loading, proving, and verifying over a generic curve. We automatically detect the curve from the zkey and use the correct implementation, or error if using an unrecognized curve. Supported curves:

  • alt_bn128
  • bls12_381

We should check binary sizes when adding additional curves. It might be worth conditionally compiling the curves.

TODO:

  • add test bls zkey
  • load groth header with manual Fq/Fr parsing, no field type

Copy link

cloudflare-workers-and-pages bot commented Jul 9, 2024

Deploying mopro with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad7f51e
Status: ✅  Deploy successful!
Preview URL: https://85195d63.mopro.pages.dev
Branch Preview URL: https://circom-detect-curve.mopro.pages.dev

View logs

@chancehudson chancehudson changed the title feat: bls12-381 zkey support feat: bls12-381 support Jul 9, 2024
@chancehudson chancehudson marked this pull request as draft July 9, 2024 04:30
@chancehudson chancehudson marked this pull request as ready for review July 9, 2024 08:23
@chancehudson chancehudson requested a review from vivianjeng July 9, 2024 08:23
@chancehudson
Copy link
Collaborator Author

chancehudson commented Jul 9, 2024

This PR is ready for review. I wrote a poseidon implementation for bls and wanted to use that for the tests here but it's making incorrect proofs. I documented the issue in #208 and added a different circuit for testing bls.

Copy link
Collaborator

@vivianjeng vivianjeng left a comment

Choose a reason for hiding this comment

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

Good PR!
I tried on iOS simulator and it works for me
I think we can add some e2e tests
and update bindings tests
(I can help with these)

@vivianjeng vivianjeng merged commit 5380d75 into main Jul 9, 2024
31 checks passed
@vivianjeng vivianjeng deleted the circom-detect-curve branch July 9, 2024 11:20
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.

Add support for bls381
2 participants