a Uint8Array to be hashed using ripemd160
Tweak a privateKey by adding tweakValue
to it.
Returns an error message if the private key is invalid or if the addition fails.
a valid secp256k1 private key
256 bit value to tweak by (BE)
Tweak a publicKey
by adding tweakValue
times the generator to it.
Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.
The returned public key will be in compressed format.
a public key.
256 bit value to tweak by (BE)
Derive a compressed public key from a valid secp256k1 private key.
Returns an error message if the provided private key is too large (see
validatePrivateKey
).
a valid secp256k1, 32-byte private key
Create an ECDSA signature in DER format. The created signature is always in lower-S form and follows RFC 6979.
Returns an error message if the provided private key is too large (see
validatePrivateKey
).
a valid secp256k1, 32-byte private key
the 32-byte message hash to be signed
Create a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).
Signatures are 64-bytes, non-malleable, and support both batch validation
and multiparty signing. Nonces are generated using RFC6979, where the
Section 3.6, 16-byte ASCII "additional data" is set to Schnorr+SHA256
.
This avoids leaking a private key by inadvertently creating both an ECDSA
signature and a Schnorr signature using the same nonce.
Returns an error message if the provided private key is too large (see
validatePrivateKey
).
a valid secp256k1, 32-byte private key
the 32-byte message hash to be signed
Returns the sha256 hash of the provided input.
To incrementally construct a sha256 hash (e.g. for streaming), use init
,
update
, and final
.
a Uint8Array to be hashed using sha256
Returns the sha512 hash of the provided input.
To incrementally construct a sha512 hash (e.g. for streaming), use init
,
update
, and final
.
a Uint8Array to be hashed using sha512
Optional
addressThe current address index to be used for this compilation. The
addressIndex
gets added to each HdKey
s addressOffset
to calculate
the dynamic index (i
) used in each privateDerivationPath
or
publicDerivationPath
.
This is required for any compiler operation that requires derivation. Typically, the value is incremented by one for each address in a wallet.
Optional
hdA map of entity IDs to master HD private keys. These master HD private
keys are used to derive each HdKey
variable assigned to that entity (as
specified in entityOwnership) according to
its privateDerivationPath
.
HD private keys may be encoded for either mainnet or testnet (the network information is ignored).
If both an HD private key (in hdPrivateKeys
) and HD public key (in
hdPublicKeys
) are provided for the same entity in the same compilation
(not recommended), only the HD private key is used.
Optional
hdA map of entity IDs to HD public keys. These HD public keys are used to
derive public keys for each HdKey
variable assigned to that entity (as
specified in entityOwnership) according to
its publicDerivationPath
.
HD public keys may be encoded for either mainnet or testnet (the network information is ignored).
If both an HD private key (in hdPrivateKeys
) and HD public key (in
hdPublicKeys
) are provided for the same entity in the same compilation
(not recommended), the HD private key is used.
Generated using TypeDoc
Returns the ripemd160 hash of the provided input.
To incrementally construct a ripemd160 hash (e.g. for streaming), use
init
,update
, andfinal
.