-
Notifications
You must be signed in to change notification settings - Fork 148
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
NEP-446: Efficient BLS-signature verification #446
Conversation
I'm surprised that the A similar NEP already merged: #364 that adds ED25519 verification as a host function. From experience with #364, this document should clearly state how all edge cases should be treated and not rely on a particular 3rd party implementation. |
Thanks for proposing this NEP as we were interested in using the BLS12-381 curve. 👏 This NEP also has the additional motivation of providing a cryptographic primitive that allows getting ~120 bits of security [1] over a pairing-friendly curve compared to the existing supported BN254 (alt_bn128), which only provides 100 bits of security (dropped after new algorithms from Kim-Barbulescu [2]). This primitive will promote building more secure protocols and facilitate interoperability with already-existing cryptographic systems using signature aggregation schemes based on the BLS12-381 curve. [1] https://www.nccgroup.trust/globalassets/our-research/us/public-reports/2019/ncc_group_zcash2018_public_report_2019-01-30_v1.3.pdf |
Thank you @olga24912 for submitting this NEP. As a moderator, I reviewed this NEP and it meets the proposed template guidelines. I am moving this NEP to the REVIEW stage and would like to ask the @near/wg-protocol working group members to assign 2 Technical Reviewers to complete a technical review (see expectations). If you want to assign yourself, please mention that you are acting as the Technical Reviewers. Please find some guidelines below for completing the technical review. Technical Review Guidelines
Please tag the @near/nep-moderators once you are done, so we can move this NEP to the voting stage. Thanks again. |
I'd like to nominate @mfornet and @abacabadabacaba as the SME reviewers for this NEP |
Hi @mfornet and @abacabadabacaba thank you so much for agreeing to review this NEP. Per the NEP workflow, the expectation is for you to complete the review within one week (~February 22, 2023). Please find some guidelines below for completing the technical review. Technical Review Guidelines
Please tag the @near/nep-moderators once you are done, so we can move this NEP to the voting stage. Thanks again. |
Hi @abacabadabacaba and @mfornet – just wanted to follow up on the SME review. Can you please complete it per the guidelines in #446 (comment)? Thank you. |
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.
Hi @ori-near @olga24912,
There are two major issues with this NEP:
- The functionality introduced by this NEP seems very limited. It makes our code base depend on a rather complex BLS12-381 curve implementation, and yet it only allows verifying one type of signatures.
It is preferable for functionality to be exposed in a general way, so that we won't need to make more protocol changes if someone needs, for example, to check some different type of BLS12-381 based signature. EIP-2537 provides a number of functions for BLS12-381 curve, and its design looks good in terms of being general enough to support a variety of use cases. Also, being able to implement EIP-2537 functions using NEAR host functions would be immediately beneficial for Aurora, which is another reason why it is a good idea to allow this. - The specification provided in this NEP is clearly insufficient. This NEP lists multiple existing implementations, however, having a specification is important. Different implementations may behave differently, and even the same implementation can behave differently depending on version and other factors. For a blockchain, consistent behavior is essential, so a NEP should include a specification, and an implementation should include tests that verify that the specification is actually followed.
By the way, while EIP-2537 omits some of the details of the functions that it implements, it seems to include enough to describe the functions unambigously.
Also, different error conditions and their outcomes should be precisely defined. In general, contract execution should only be terminated in cases which can be easily avoided, such as invalid input length.
Hi @olga24912 – as the moderator, I just wanted to confirm you received the feedback above: #446 (review) Please let us know if you plan to address the feedback. Thank you. |
Hi @ori-near I confirm that I received the feedback. And we are planning to address that. Currently, we are trying to figure out the best way to verify BLS-signature in case we have precompiled BLS primitives. Thank you! |
Hi @olga24912, as the moderator – I wanted to follow up on this NEP and see if you are still working on it? We typically close NEPs that are inactive for more than two months, so please let us know if you need more time. |
Sorry for the long response! I think it's a good idea to go the way Evgeny suggested, but with small changes: In the case of implementing low-level functions from EIP-2537, I propose closing this NEP and creating a new one due to significant changes. |
@olga24912 sounds good. Let's close this NEP then |
A pre-compiled NEAR runtime functions for operations on BLS12-381 curve. It is a necessary set to efficiently perform operations such as BLS signature and zkSNARKs verifications. Related PR: #446 --- ## NEP Status *(Updated by NEP Moderators)* **Status**: Approved **Meeting Recording:** https://bit.ly/41V49Ke SME reviews: * [x] @abacabadabacaba: #488 (review) * [x] @michelabdalla: #488 (review) Protocol Work Group voting indications (❔ | 👍 | 👎 ): * 👍 @birchmd: #488 (comment) * 👍 @mfornet: #488 (comment) * 👍 @mm-near: #488 (comment) * 👍 @bowenwang1996: #488 (comment) --------- Co-authored-by: Marcelo Fornet <[email protected]> Co-authored-by: Slava Karkunov <[email protected]> Co-authored-by: Ekleog-NEAR <[email protected]>
Summary
A pre-compiled NEAR runtime function for verifying BLS12-381 signatures.
That enables running Ethereum 2 light clients on-chain.