You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ECDSA used with secp256k1 has an algorithm for recovering the public key of a signer from the message and the signature. This is important for systems like Ethereum, where public keys are not necessarily available directly.
We want an API call from the contract into the host as follows:
Name: secp256k1_recover_pubkey
Inputs:
message_hash: [u8; 32] the same as in verify
signature in the same format as verify
v: u8 recovery parameter must be one of 0, 1, 2, 3. This is part of signatures in Ethereum (r, s, v) but not Cosmos (r, s)
Output: The public key in the format expected by verify.
Other APIs that implement the same functionality for inspiration:
Solidity ecrecover: hash means message_hash; signature is spread across parameters r, s, v. This returns the signer address, but we want the signer's pubkey.
Uh oh!
There was an error while loading. Please reload this page.
ECDSA used with secp256k1 has an algorithm for recovering the public key of a signer from the message and the signature. This is important for systems like Ethereum, where public keys are not necessarily available directly.
We want an API call from the contract into the host as follows:
Name: secp256k1_recover_pubkey
Inputs:
message_hash: [u8; 32]
the same as in verifysignature
in the same format as verifyv: u8
recovery parameter must be one of 0, 1, 2, 3. This is part of signatures in Ethereum(r, s, v)
but not Cosmos(r, s)
Output: The public key in the format expected by verify.
Other APIs that implement the same functionality for inspiration:
hash
meansmessage_hash
; signature is spread across parametersr
,s
,v
. This returns the signer address, but we want the signer's pubkey.Test vectors:
For Ethereum signatures the verification flow is the following:
pubkey = secp256k1_recover_pubkey(message_hash, signature, v)
secp256k1_verify(message_hash, signature, pubkey)
which later can be wrapped contract side to a combined verification call if desired.
The text was updated successfully, but these errors were encountered: