-
Notifications
You must be signed in to change notification settings - Fork 504
feat: add Pectra BLS12-381 elliptic curve precompiles #1447
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
Conversation
…pectra/precompiles
Addressed all the points except the |
Yup - I think we could try to keep it simple for now. The only thing I'm worried about when having duplicate implementations (in sw_emulated and sw_bls12381) is that it may cause confusion when auditing or debugging bugs. I'll have another look, maybe I can come up with some idea while @ThomasPiellard is addressing the missing test comment. |
…pectra/precompiles
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.
Good from my side now. But before merging we need to wait for Consensys/gnark-crypto#674 to be merged to gnark-crypto master and then we need to update the dependency in this PR. Otherwise we may have non-linear dependencies and depend on go package cache in case the gnark-crypto PR is deleted.
I'll try moving AssertIsOnCurve and AssertIsOnG1 to interfaces and de-duplicate in separate PR.
Co-authored-by: Thomas Piellard <[email protected]> Co-authored-by: Ivo Kubjas <[email protected]> Co-authored-by: Arya Tabaie <[email protected]>
Description
This PR adds gnark circuits corresponding to precompiles for BLS12-381 curve operations https://eips.ethereum.org/EIPS/eip-2537.
TODO:
ScalarMul()with GLVType of change
How has this been tested?
Tests are implemented in
std/evmprecompiles/bls_test.go.How has this been benchmarked?
PLONK (on BLS12-377) number of constraints (scs):
Scalar Multiplication
Scalar Multiplication
Checklist:
golangci-lintdoes not output errors locally