Instantiates an instance of SecretKey.
bytes (Uint8Array) or secret (bigint)
Get the secret key entropy as a byte array.
The secret key bytes as a Uint8Array
Returns the raw secret key as a hex string.
The secret key as a hex string
Encode the secret key bytes as a secretKeyMultibase string.
The secret key in base58btc multibase format
Get the secret key entropy as a bigint.
The secret key as a bigint
Computes the public key from the secret key bytes.
The computed public key
Encodes the secret key bytes to BIP340 multibase format.
The secret key in BIP340 multibase format.
Checks if this secret key is equal to another.
The other secret key
True if the private keys are equal, false otherwise
Checks if the secret key is valid.
True if the secret key is valid, false otherwise
Checks if the public key is a valid secp256k1 point.
The public key to validate
True if the public key is valid, false otherwise
Converts the secret key to a JSON object.
The secret key as a JSON object
Static
decodeStatic
fromJSONCreates a SecretKey object from a JSON object.
The JSON object containing the secret key bytes
A new SecretKey object
Static
fromCreates a new SecretKey object from a bigint secret.
The secret bigint
A new SecretKey object
Static
generateStatic
getStatic
randomStatic
toStatic
toConverts a SecretKey or KeyBytes to a Pair.
The SchnorrKeyPair object containing the public and private keys
Static
to
Encapsulates a secp256k1 secret key Provides get methods for different formats (raw, secret, point). Provides helpers methods for comparison, serialization and publicKey generation. SecretKey