-
Notifications
You must be signed in to change notification settings - Fork 1k
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
EcRecover #3633
EcRecover #3633
Conversation
* Add entries to Designation event * Change to HF_Echidna * Add UT * Add count
* add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead.
* Add entries to Designation event * Change to HF_Echidna * Add UT * Add count
* add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead.
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
* Add entries to Designation event * Change to HF_Echidna * Add UT * Add count
* add base64url * active in * update placehold hf height * fix hf issue and move methods to proper place. * fix test * use identifymodel instead.
# Conflicts: # src/Neo/Neo.csproj # src/Neo/SmartContract/Native/RoleManagement.cs
// Test from https://eips.ethereum.org/EIPS/eip-2098 | ||
var privateKey = "1234567890123456789012345678901234567890123456789012345678901234".HexToBytes(); | ||
|
||
var expectedPubKey1 = (Neo.Cryptography.ECC.ECCurve.Secp256k1.G * privateKey).ToArray(); |
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.
Expected values
pubKeyX - 0xe90c7d3640a1568839c31b70a893ab6714ef8415b9de90cedfc1c8f353a6983e
pubKeyY - 0x625529392df7fa514bdd65a2003f6619567d79bee89830e63e932dbd42362d34
eth address for reference - 0x2e988A386a799F506693793c6A5AF6B54dfAaBfB
|
||
Console.WriteLine($"Expected PubKey: {expectedPubKey1.ToHexString()}"); | ||
var message1 = Encoding.UTF8.GetBytes("Hello World"); | ||
var messageHash1 = message1.Keccak256(); |
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.
This is supposed to be an Ethereum signed message which is not explicitly stated in ERC-2098
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
Expected value: 0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2
* Fix UT * Update src/Neo/ProtocolSettings.cs Co-authored-by: nan01ab <[email protected]> * Update src/Neo/ProtocolSettings.cs Co-authored-by: nan01ab <[email protected]> * Update src/Neo/ProtocolSettings.cs Co-authored-by: Christopher Schuchardt <[email protected]> --------- Co-authored-by: Jimmy <[email protected]> Co-authored-by: nan01ab <[email protected]> Co-authored-by: Christopher Schuchardt <[email protected]>
Fixed EIP-2098 tests, but failed in tests creating wallet in neo-cli. Cannot recognize the reason. |
final version: ==Specification== ===Native Contract Interface=== Three methods will be added to CryptoLib in ====Method 1: Recovery from Message and Signature==== { "name": "secp256k1Recover", "safe": true, "parameters": [ { "name": "message", "type": "ByteArray" }, { "name": "hasher", "type": "Integer" }, { "name": "signature", "type": "ByteArray" } ], "returntype": "ByteArray" } ====Method 2: Recovery from Message Components==== { "name": "secp256k1Recover", "safe": true, "parameters": [ { "name": "message", "type": "ByteArray" }, { "name": "hasher", "type": "Integer" }, { "name": "r", "type": "ByteArray" }, { "name": "s", "type": "ByteArray" }, { "name": "v", "type": "Integer" } ], "returntype": "ByteArray" } ====Method 3: Recovery from Pre-computed Hash==== { "name": "secp256k1Recover", "safe": true, "parameters": [ { "name": "hash", "type": "ByteArray" }, { "name": "signature", "type": "ByteArray" } ], "returntype": "ByteArray" } ===Method Specification=== The methods
|
Co-authored-by: Hecate2 <[email protected]>
I think the name |
I remember the public enum Hasher : byte |
Well I told you all so, once again!!! 😃 When it comes to standards and naming conventions no one listens to me. You dont care -- I dont care. Maybe bad english is the problem. |
Bro, i would care for sure, but as you said, maybe english is the problem, but once you point it out and fix it in a pr, i promise you i will support you. |
We can change the name
|
@OT-kraftchain coredev team prefers to keep only one method in the native contract, can you please pick one that works for you the best. |
Hey @Jim8y, I think |
signature format (32,32,1) ? |
Yeah, sounds about right |
Moved to #3696 |
Description
Close #3628
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: