The parameters object.
Origin path from master, e.g. "/84'/0'/0'".
Optionalchange?: numberBranch index (0 receive, 1 change).
Optionalindex?: number | "*"Address index or * for ranged descriptors.
OptionalkeyPath?: stringFull suffix path (/change/index) alternative to
change + index.
OptionalisPublic?: booleanCompute an xpub or xprv
Descriptor key expression (e.g. [f23f9fd2/84'/0'/0']xpub.../0/5).
import * as ecc from '@bitcoinerlab/secp256k1';
import { BIP32Factory } from 'bip32';
import { keyExpressionBIP32 } from '@bitcoinerlab/descriptors';
const BIP32 = BIP32Factory(ecc);
const masterNode = BIP32.fromSeed(seedBytes);
const keyExp = keyExpressionBIP32({
masterNode,
originPath: "/84'/0'/0'",
change: 0,
index: 5
});
Constructs a BIP32 key expression string from its constituent components.
This function essentially performs the reverse operation of KeyExpressionParser. For detailed explanations and examples of the terms used here, refer to KeyExpressionParser.