-
Notifications
You must be signed in to change notification settings - Fork 487
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
Support EIP-2539 and EIP-3026 #1049
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Update shell.nix * Read point from input * Finish `BLS12377G1Add` * Fix `BLS12377G1Add` output encode * Finish `BLS12377G1Mul` * Finish `BLS12377G1MultiExp` * Finish `BLS12377G2Add` * Finish `BLS12377G2Mul` * Draft `eip-2539` implement * Finish `BLS12377Pairing` * Draft `eip-2539` * Multiplication by the unnormalized scalar * Rename serialize to write * Test Cases * Test Cases * Rewrite read_fq * Rename * Doc and cleanup * Tidy * Tidy * Tidy * Only check point in subgroup for pairing * Fmt * Tests * Typo * Typo * Fix conv * Change err info * Fmt * EIP-2539 tests * EIP-2539 tests * Lint and test
* Update shell.nix * G1Add and G1Mul * G1MultiExp * G2Add * G2Mul and G2MultiExp * Bw6Pairing * EIP-3026 tests * EIP-3026 failure tests * Fix lint * Lint * Lint and test * Comment * Deps order
boundless-forest
approved these changes
May 8, 2023
@sorpaas Please take a reivew. See the grant for more information. |
sorpaas
approved these changes
May 8, 2023
At present this would run in wasm on polkadot, yes? It'd be good if someone here glanced at paritytech/substrate#13031 and https://github.com/paritytech/ark-substrate or even reviewed them to checked that they'd support this properly. |
Yeah this currently runs in wasm at this moment. |
ashutoshvarma
pushed a commit
to AstarNetwork/frontier
that referenced
this pull request
May 29, 2023
* Release branch polkadot-v0.9.38 (polkadot-evm#1015) * EIP-2539 (#15) * Update shell.nix * Read point from input * Finish `BLS12377G1Add` * Fix `BLS12377G1Add` output encode * Finish `BLS12377G1Mul` * Finish `BLS12377G1MultiExp` * Finish `BLS12377G2Add` * Finish `BLS12377G2Mul` * Draft `eip-2539` implement * Finish `BLS12377Pairing` * Draft `eip-2539` * Multiplication by the unnormalized scalar * Rename serialize to write * Test Cases * Test Cases * Rewrite read_fq * Rename * Doc and cleanup * Tidy * Tidy * Tidy * Only check point in subgroup for pairing * Fmt * Tests * Typo * Typo * Fix conv * Change err info * Fmt * EIP-2539 tests * EIP-2539 tests * Lint and test * EIP-3026 (#16) * Update shell.nix * G1Add and G1Mul * G1MultiExp * G2Add * G2Mul and G2MultiExp * Bw6Pairing * EIP-3026 tests * EIP-3026 failure tests * Fix lint * Lint * Lint and test * Comment * Deps order * Fmt * Lint --------- Co-authored-by: Wei Tang <wei@pacna.org>
ashutoshvarma
pushed a commit
to AstarNetwork/frontier
that referenced
this pull request
Jun 8, 2023
* Release branch polkadot-v0.9.38 (polkadot-evm#1015) * EIP-2539 (#15) * Update shell.nix * Read point from input * Finish `BLS12377G1Add` * Fix `BLS12377G1Add` output encode * Finish `BLS12377G1Mul` * Finish `BLS12377G1MultiExp` * Finish `BLS12377G2Add` * Finish `BLS12377G2Mul` * Draft `eip-2539` implement * Finish `BLS12377Pairing` * Draft `eip-2539` * Multiplication by the unnormalized scalar * Rename serialize to write * Test Cases * Test Cases * Rewrite read_fq * Rename * Doc and cleanup * Tidy * Tidy * Tidy * Only check point in subgroup for pairing * Fmt * Tests * Typo * Typo * Fix conv * Change err info * Fmt * EIP-2539 tests * EIP-2539 tests * Lint and test * EIP-3026 (#16) * Update shell.nix * G1Add and G1Mul * G1MultiExp * G2Add * G2Mul and G2MultiExp * Bw6Pairing * EIP-3026 tests * EIP-3026 failure tests * Fix lint * Lint * Lint and test * Comment * Deps order * Fmt * Lint --------- Co-authored-by: Wei Tang <wei@pacna.org>
Closed
37 tasks
Closed
46 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements EIP-2039 which defines BLS12-377 elliptic curve operations, and EIP-3026 which defines BW6-761 elliptic curve operations as precompiles.
Background
The ALC (accountable light client) design is based on the paper published by the Web3 Foundation. It presents an efficient method for utilizing SNARK to verify the aggregated public key of signers, while still holding those signers accountable. This approach greatly improves the speed and cost-effectiveness of proof generation.
To facilitate ALC from PoC to production ready. We implement EIP-2539 and EIP-3026 for substrate chains to verify apk-proof which is necessary for ALC.
This PR is also the important part of this grant.
Other changes
shell.nix
.Tests
Test vectors are generated with https://github.com/hujw77/eip-test-gen.
TODO in next PR