@bitcoinerlab/descriptors - v2.3.4
    Preparing search index...

    Function signECPair

    • Signs all inputs of a PSBT with an ECPair.

      This function improves upon bitcoinjs-lib's native psbt.signAllInputs() by automatically handling Taproot inputs. For each input, it detects if it's a Taproot input and internally tweaks the key if needed.

      This creates consistency with the BIP32 signing methods (signBIP32/signInputBIP32), which also automatically handle key tweaking for Taproot inputs. In contrast, bitcoinjs-lib's native implementation requires users to manually pre-tweak ECPair signers for Taproot inputs.

      With this implementation, you can use a single ECPair to sign both Taproot and non-Taproot inputs in the same PSBT, similar to how signBIP32 allows using a common node for both types.

      Parameters

      • params: { psbt: Psbt; ecpair: ECPairInterface }

        The parameters object

        • psbt: Psbt

          The PSBT to sign

        • ecpair: ECPairInterface

          The ECPair to sign with

      Returns void