[Core Proposal] This pr tries to standarize the newly added SECP256K1 recover method#188
Open
Jim8y wants to merge 6 commits intoneo-project:masterfrom
Open
[Core Proposal] This pr tries to standarize the newly added SECP256K1 recover method#188Jim8y wants to merge 6 commits intoneo-project:masterfrom
Jim8y wants to merge 6 commits intoneo-project:masterfrom
Conversation
roman-khimov reviewed Feb 8, 2025
nep-recover.mediawiki Outdated
| Created: 2024-12-18 | ||
| Requires: N/A | ||
| Supersedes: N/A | ||
| Hardfork: HF_Echidna |
Contributor
There was a problem hiding this comment.
NEP-1 should be updated before doing this. And please, don't add HF_.
shargon reviewed Feb 9, 2025
shargon reviewed Feb 9, 2025
shargon reviewed Feb 9, 2025
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
shargon previously approved these changes Feb 10, 2025
nan01ab approved these changes Feb 11, 2025
superboyiii approved these changes Jul 23, 2025
AnnaShaleva reviewed Jul 23, 2025
Member
AnnaShaleva left a comment
There was a problem hiding this comment.
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.
superboyiii reviewed Jul 23, 2025
Co-authored-by: Owen <38493437+superboyiii@users.noreply.github.com>
shargon reviewed Jul 29, 2025
This file contains hidden or 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
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.
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====
{ "name": "secp256k1Recover", "safe": true, "parameters": [ { "name": "hash", "type": "ByteArray" }, { "name": "signature", "type": "ByteArray" } ], "returntype": "ByteArray" }The method takes the following parameters:
The method returns:
===Input Requirements===
The method
MUSTfollow these rules:Input Requirements for secp256k1Recover:
Return Value:
v)===Technical Details===
The recovery process
MUSTfollow the SECP256K1 curve specifications:r,s, andvcomponentsy² = x³ + 7over fieldF_pwhere
p = 2²⁵⁶ - 2³² - 2⁹ - 2⁸ - 2⁷ - 2⁶ - 2⁴ - 1vto determine the correct public key point==Test Vectors==
The implementation
MUSTpass 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]