Static
Readonly
SIGNATURE_Represents the fixed length of the cryptographic signature. The value is set to 65, which is the size in bytes required for a 520-bit signature.
Static
compressStatic
deriveDerives the public key from a given private key.
The private key in Uint8Array format. Must be a valid 32-byte secp256k1 private key.
Optional
isCompressed: boolean = trueIndicates whether the derived public key should be in compressed format.
The derived public key in Uint8Array format.
Static
generateStatic
inflateStatic
isStatic
isStatic
randomGenerates a random sequence of bytes. If an error occurs during generation using nc_secp256k1, {@link global.crypto is used as fall back togenerate the random sequence.
Optional
bytesLength: number = 32Optional. The number of random bytes to generate, 32 by default.
Static
recoverRecovers the public key associated with the message hash from the given signature.
The 32-byte message hash to be verified.
The 65-byte signature used for recovery, consisting of the compact signature and recovery byte.
The recovered public key in its raw bytes form.
Static
signSigns a given message hash using the provided private key.
A 32-byte message hash that needs to be signed.
A 32-byte private key used for signing the message hash.
The signature of the message hash consisting of the r, s, and recovery values.
The Secp256k1 class provides cryptographic utilities for the SECP256K1 elliptic curve, including compressing and inflating public keys, generating private keys, and validating message hashes and private keys.