[Core Proposal] This pr tries to standarize the newly added SECP256K1 recover method #188
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.
NEP: TBD
Title: SECP256K1 ECDSA Public Key Recovery Support
Author: Fernando Díaz Toledano [email protected],Jimmy Liao [email protected]
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]