Caravan Documentation
    Preparing search index...

    Function ensureXpubAtPath

    • Derives an extended public key to the target BIP32 path if necessary. Ensures the xpub is in the correct format for the network and derives child keys along the relative path from source to target.

      Parameters

      • source: { bip32Path: string; xpub: string }

        The source object containing the xpub and its BIP32 path.

      • targetBip32Path: string

        The target BIP32 path to derive to.

      • network: Network

        The network (e.g., TESTNET or REGTEST).

      Returns string

      The derived xpub at the target path, or the source xpub if no derivation is needed.