Derive a child HD private node from an HD private node.
To derive a child HD public node, use deriveHdPublicNode on the
result of this method. If the child uses a non-hardened index, it's also
possible to use deriveHdPublicNodeChild.
Note that this function defaults to throwing errors. To handle errors in a
type-safe way, set throwErrors to false.
This function has a less than 1 in 2^127 probability of producing
an invalid result (where the resulting private key is not a valid Secp256k1
private key, see validateSecp256k1PrivateKey). While this scenario is
unlikely to ever occur without a weakness in HMAC-SHA512, the
returnInvalidNodes parameter can be set to true to return the resulting
HdPrivateNodeInvalid rather than an error (defaults to false).
The valid HD private node from which to derive the child node.
index: number
The index at which to derive the child node - indexes greater
than or equal to the hardened index offset (0x80000000/2147483648) are
derived using the "hardened" derivation algorithm.
An optional object containing implementations of sha256, ripemd160,
secp256k1 compressed public key derivation, and secp256k1 private key
"tweak addition" (application of the EC group operation).
If false, invalid derivations (probability less than 1 in 2^127) will
produce an error rather than an HdPrivateNodeInvalid (defaults
to false). To return the invalid node rather than throwing an error,
throwErrors must also be set to false.
Derive a child HD private node from an HD private node.
To derive a child HD public node, use deriveHdPublicNode on the result of this method. If the child uses a non-hardened index, it's also possible to use deriveHdPublicNodeChild.
Note that this function defaults to throwing errors. To handle errors in a type-safe way, set
throwErrors
tofalse
.This function has a less than 1 in 2^127 probability of producing an invalid result (where the resulting private key is not a valid Secp256k1 private key, see validateSecp256k1PrivateKey). While this scenario is unlikely to ever occur without a weakness in HMAC-SHA512, the
returnInvalidNodes
parameter can be set totrue
to return the resulting HdPrivateNodeInvalid rather than an error (defaults tofalse
).