Encapsulates a secp256k1 private key Provides get methods for different formats (raw, secret, point). Provides helpers methods for comparison, serialization and publicKey generation. PrivateKey
Instantiates an instance of PrivateKey.
bytes (Uint8Array) or secret (bigint)
If seed is not provided, not a valid 32-byte private key or not a valid bigint secret
Return the private key bytes.
IPrivateKey.bytes
Returns the raw private key as a hex string.
The private key as a hex string
IPrivateKey.hex
Return the private key point.
The private key point.
IPrivateKey.point
If the public key is undefined or not compressed
Return the private key secret.
IPrivateKey.secret
Computes the public key from the private key bytes.
The computed public key
IPrivateKey.computePublicKey
Checks if this private key is equal to another.
The other private key
True if the private keys are equal, false otherwise
IPrivateKey.equals
Checks if the private key is valid.
True if the private key is valid, false otherwise
Returns the private key as a JSON object.
IPrivateKey.json
Encapsulates a secp256k1 private key Provides get methods for different formats (raw, secret, point). Provides helpers methods for comparison, serialization and publicKey generation. PrivateKey