import { C } from "https://deno.land/x/lucid@0.10.7/src/mod.ts";
const { Bip32PrivateKey } = C;
Methods
derive this private key with the given index.
Security considerations
- hard derivation index cannot be soft derived with the public key
Hard derivation vs Soft derivation
If you pass an index below 0x80000000 then it is a soft derivation. The advantage of soft derivation is that it is possible to derive the public key too. I.e. derivation the private key with a soft derivation index and then retrieving the associated public key is equivalent to deriving the public key associated to the parent private key.
Hard derivation index does not allow public key derivation.
This is why deriving the private key should not fail while deriving the public key may fail (if the derivation index is invalid).
see from_128_xprv
Static Methods
128-byte xprv a key format in Cardano that some software still uses or requires the traditional 96-byte xprv is simply encoded as prv | chaincode however, because some software may not know how to compute a public key from a private key, the 128-byte inlines the public key in the following format prv | pub | chaincode so be careful if you see the term "xprv" as it could refer to either one our library does not require the pub (instead we compute the pub key when needed)