-
Notifications
You must be signed in to change notification settings - Fork 119
[Core Proposal] This pr tries to standarize the newly added SECP256K1 recover method #188
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
base: master
Are you sure you want to change the base?
Conversation
nep-recover.mediawiki
Outdated
Created: 2024-12-18 | ||
Requires: N/A | ||
Supersedes: N/A | ||
Hardfork: HF_Echidna |
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.
NEP-1 should be updated before doing this. And please, don't add HF_
.
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
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.
The problem that I see with this PR is that we don't have any basis NEP for it. I.e. this NEP extends CryptoLib's interface, but we don't have a NEP neither for the CryptoLib itself nor for any of the hardforks. That's why standardizing this extension doesn't look proper to me.
From my PoW, if we still want to standardize this functionality, we firstly need to introduce a standard either for native contracts or for hardforks.
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.
Need change name
Co-authored-by: Owen <38493437+superboyiii@users.noreply.github.com>
NEP: TBD
Title: SECP256K1 ECDSA Public Key Recovery Support
Author: Fernando Díaz Toledano shargon@gmail.com,Jimmy Liao vvvincentvan@gmail.com
Type: Draft
Status: Draft
Created: 2024-12-18
Requires: N/A
Supersedes: N/A
Hardfork: HF_Echidna
==Abstract==
This NEP adds SECP256K1 public key recovery to Neo N3's CryptoLib native contract. This feature enables recovery of signing addresses from signatures, improving interoperability with Bitcoin and Ethereum.
==Motivation==
Most blockchain platforms use addresses derived from SECP256K1 public keys. When verifying signatures from these chains, only the signature, message, and signer's address are available. Neo N3 currently lacks native support for SECP256K1 public key recovery, which limits:
==Specification==
===Native Contract Interface===
A method will be added to CryptoLib in
HF_Echidna
:====SECP256K1 Public Key Recovery====
The method takes the following parameters:
The method returns:
===Input Requirements===
The method
MUST
follow these rules:Input Requirements for secp256k1Recover:
Return Value:
v
)===Technical Details===
The recovery process
MUST
follow the SECP256K1 curve specifications:r
,s
, andv
componentsy² = x³ + 7
over fieldF_p
where
p = 2²⁵⁶ - 2³² - 2⁹ - 2⁸ - 2⁷ - 2⁶ - 2⁴ - 1
v
to determine the correct public key point==Test Vectors==
The implementation
MUST
pass the following test vectors:==Backwards Compatibility==
This NEP introduces new functionality without modifying existing behavior. All existing signature verification methods will continue to work as before. The new methods will only be available after the HF_Echidna hardfork activation.
==References==
==Implementation==
The implementation will be provided in the following pull request:
[Implementation Link TBD]