the HD public node from which to derive the child public node
the index at which to derive the child node
an optional object containing implementations of sha256, sha512, ripemd160, and secp256k1 compressed public key "tweak addition" (application of the EC group operation)
Returns the ripemd160 hash of the provided input.
To incrementally construct a ripemd160 hash (e.g. for streaming), use
init
, update
, and final
.
a Uint8Array to be hashed using ripemd160
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)
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
Generated using TypeDoc
Derive a non-hardened child HD public node from an HD public node.
Because hardened derivation also requires knowledge of the parent private node, it's not possible to use an HD public node to derive a hardened child HD public node.
Though private keys cannot be derived from HD public keys, sharing HD public keys still carries risk. Along with allowing an attacker to associate wallet addresses together (breaking privacy), should an attacker gain knowledge of a single child private key, it's possible to derive all parent HD private keys. See crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode for details.