-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
BLS12-381 curve operations #2537
Conversation
Make even with master
Update eip-x.md
Thanks for the ongoing hard work! A few questions:
What does this mean? Was the spec not "strictly followed" last time? Because of the greater flexibility of this EIP (eg. it requires on-chain representations of G2 points and not just G1), it seems like there's more stuff that has to be strictly followed, and so more risk that there will be consensus implications. This sentence in plain English reads like "we'll be fine if people try harder", which only works in practice if you assume that (i) normally people don't try hard and (ii) they can be motivated to change this with just a few words. So I feel like trying to cut down the number of special cases within the precompiles would still be valuable to increase security further. I do think the focus on a few curves instead of trying to support every possible curve is a great improvement. |
Hey Vitalik. Here are answers and rationale in the same sequence:
Remark about BN254 was about the time when subgroup checks were not implemented in one of the clients and could potentially lead to consensus issues. For this reason I try to put more emphasis on it, whether it will end up being optional or mandatory. About the separate curves: BLS12-381 is a "standard" and required by many parties, but BLS12-377 offers more options for developers and difference between them is just change of parameters. For the third currently posted proposal (wrapping curve for BLS12-377) all the special cases resolved here will still be applicable, so we just need to resolve them once and then use such a "guidebook" for all other. |
Mapping spec is now included and gas cost was measured. Should be good for inclusion. |
Tests for expected negative outcomes are being added to the same folder. |
just an FYI, i've sketched out what a Solidity smart contract consuming some of the precompiles in this EIP would look like: it hasn't been tested end-to-end yet but even just skimming the types and looking at one use case (the eth2 deposit verifier) could be helpful in the above conversations on API, etc. |
Following general sentiment form reviews I'm splitting mapping precompile to two separate ones. |
Test vectors for mapping functions will be updated when IETF spec v7 is finalized (expected soon). |
Reference implementation now conforms to |
Go implementation now also follows |
Is this okay to be merged? @shamatar? |
Yes |
* draft * Update eip-x.md * add ABI * also mention encoding of boolean vars in pairing * add point decompression * fix decompression, add gas price * expand on square root extraction and checks * Cleanup title * Fix typo and remove optional header fields * set EIP number * hm, html verifier is not satisfied... * update on ABI, costs and subgroup checks * add more information about field-to-curve * add links to implementations * spellcheck * mapping costs are underetmined yet * add mapping operations cost * whoops, spellcheck! * updates: test vectors, prefixes * more explicit pairing output * gas consumption in case of error * fix multiplication -> multiexp * split mapping into two separate ones * spellcheck * update link to Go implementation * add addresses Co-authored-by: Kobi Gurkan <kobigurk@gmail.com>
* draft * Update eip-x.md * add ABI * also mention encoding of boolean vars in pairing * add point decompression * fix decompression, add gas price * expand on square root extraction and checks * Cleanup title * Fix typo and remove optional header fields * set EIP number * hm, html verifier is not satisfied... * update on ABI, costs and subgroup checks * add more information about field-to-curve * add links to implementations * spellcheck * mapping costs are underetmined yet * add mapping operations cost * whoops, spellcheck! * updates: test vectors, prefixes * more explicit pairing output * gas consumption in case of error * fix multiplication -> multiexp * split mapping into two separate ones * spellcheck * update link to Go implementation * add addresses Co-authored-by: Kobi Gurkan <kobigurk@gmail.com>
* draft * Update eip-x.md * add ABI * also mention encoding of boolean vars in pairing * add point decompression * fix decompression, add gas price * expand on square root extraction and checks * Cleanup title * Fix typo and remove optional header fields * set EIP number * hm, html verifier is not satisfied... * update on ABI, costs and subgroup checks * add more information about field-to-curve * add links to implementations * spellcheck * mapping costs are underetmined yet * add mapping operations cost * whoops, spellcheck! * updates: test vectors, prefixes * more explicit pairing output * gas consumption in case of error * fix multiplication -> multiexp * split mapping into two separate ones * spellcheck * update link to Go implementation * add addresses Co-authored-by: Kobi Gurkan <kobigurk@gmail.com>
This PR adds a draft of the EIP that adds a set of precompiles for efficient implementation of operations on BLS12-381 curve