the parent HD public node for which to derive a private node.
Any non-hardened child private node of the parent
node (only the privateKey
and the childIndex
are required).
Optional
crypto?: { An optional object containing an implementation of sha512.
Generated using TypeDoc
Derive the HD private node from a HD public node, given any non-hardened child private node.
This exploits the "non-hardened" BIP32 derivation algorithm. Because non-hardened derivation only requires knowledge of the "chain code" (rather than requiring knowledge of the parent private key) it's possible to calculate the value by which the parent private key is "tweaked" to arrive at the child private key. Since we have the child private key, we simply subtract this "tweaked" amount to get back to the parent private key.
The BIP32 "hardened" derivation algorithm is designed to address this weakness. Using hardened derivation, child private nodes can be shared without risk of leaking the parent private node, but this comes at the cost of public node derivation. Given only a parent public node, it is not possible to derive hardened child public keys, so applications must choose between support for HD public node derivation or support for sharing child private nodes.