secp256k1EcdsaRecover
For the complete documentation index, see llms.txt
@midnight-ntwrk/compact-runtime v0.19.0
@midnight-ntwrk/compact-runtime / secp256k1EcdsaRecover
Function: secp256k1EcdsaRecover()
function secp256k1EcdsaRecover(
msgHash,
sig,
recoveryId): Secp256k1Point;
Recover the secp256k1 public key from an ECDSA signature and a message hash.
Recovery ID
-
bit 0 (
recoveryId & 1) is the parity ofR.y: 0 for even, 1 for odd. -
bit 1 (
recoveryId >= 2) says whether the reduction wrapped, i.e. whetherR.xisr(0, 1) orr + n(2, 3). -
0:
R = (r, y)withyeven — the common case. -
1:
R = (r, y)withyodd — the other common case. -
2:
R = (r + n, y)withyeven. -
3:
R = (r + n, y)withyodd.
Parameters
msgHash
Uint8Array
sig
r
bigint
s
bigint
recoveryId
number