BitcoinerLab Descriptors API - v3.1.7
    Preparing search index...

    Type Alias Expansion

    DescriptorsFactory creates and returns the expand() function that parses a descriptor expression and destructures it into its elemental parts. Expansion is the type that expand() returns.

    type Expansion = {
        payment?: Payment;
        expandedExpression?: string;
        miniscript?: string;
        expansionMap?: ExpansionMap;
        isSegwit?: boolean;
        isTaproot?: boolean;
        expandedMiniscript?: string;
        tapTreeExpression?: string;
        tapTree?: TapTreeNode;
        tapTreeInfo?: TapTreeInfoNode;
        redeemScript?: Uint8Array;
        witnessScript?: Uint8Array;
        isRanged: boolean;
        canonicalExpression: string;
    }
    Index

    Properties

    payment?: Payment

    The corresponding bitcoinjs-lib Payment for the provided expression, if applicable.

    expandedExpression?: string

    The expanded descriptor expression. See ExpansionMap for a detailed explanation.

    miniscript?: string

    The extracted miniscript from the expression, if any.

    expansionMap?: ExpansionMap

    A map of key expressions in the descriptor to their corresponding expanded keys. See ExpansionMap for a detailed explanation.

    isSegwit?: boolean

    A boolean indicating whether the descriptor uses SegWit.

    isTaproot?: boolean

    A boolean indicating whether the descriptor uses Taproot.

    expandedMiniscript?: string

    The expanded miniscript, if any. It corresponds to the expandedExpression without the top-level script expression.

    tapTreeExpression?: string

    The taproot tree expression, if any. Only defined for tr(KEY, TREE). Example: {pk(02aa...),{pk(03bb...),pk(02cc...)}}.

    tapTree?: TapTreeNode

    Parsed taproot leaf tree for tr(KEY, TREE), if any.

    Shape:

    • Branch nodes: { left, right }
    • Leaf nodes: { expression: string }

    Example:

    {
    left: { expression: 'pk(02aa...)' },
    right: {
    left: { expression: 'and_v(v:pk(03bb...),older(12960))' },
    right: { expression: 'pk(02cc...)' }
    }
    }
    tapTreeInfo?: TapTreeInfoNode

    Compiled taproot leaf metadata tree for tr(KEY, TREE), if any.

    Same branch/leaf tree shape as tapTree, but each leaf is enriched with:

    • expandedExpression: descriptor-level expanded leaf expression
    • optional expandedMiniscript: miniscript-expanded leaf
    • expansionMap: resolved keys for that leaf (@0, @1, ...)
    • tapScript: compiled tapscript bytes
    • version: leaf version (typically tapscript 0xc0)

    Note: @i placeholders are scoped per leaf, since each leaf is expanded and satisfied independently.

    Example:

    {
    left: {
    expression: 'pk(02aa...)',
    expandedExpression: 'pk(@0)',
    expandedMiniscript: 'pk(@0)',
    expansionMap: {
    '@0': { pubkey: Uint8Array(32), ... }
    },
    tapScript: Uint8Array(...),
    version: 0xc0
    },
    right: {
    left: {
    expression: 'and_v(v:pk(03bb...),older(12960))',
    expandedExpression: 'and_v(v:pk(@0),older(12960))',
    expansionMap: { '@0': { pubkey: Uint8Array(32), ... } },
    tapScript: Uint8Array(...),
    version: 0xc0
    },
    right: {
    expression: 'pk(02cc...)',
    expandedExpression: 'pk(@0)',
    expansionMap: { '@0': { pubkey: Uint8Array(32), ... } },
    tapScript: Uint8Array(...),
    version: 0xc0
    }
    }
    }
    redeemScript?: Uint8Array

    The redeem script for the descriptor, if applicable.

    witnessScript?: Uint8Array

    The witness script for the descriptor, if applicable.

    isRanged: boolean

    Whether the descriptor is a ranged-descriptor.

    canonicalExpression: string

    This is the preferred or authoritative representation of an output descriptor expression. It removes the checksum and, if it is a ranged-descriptor, it particularizes it to its index.