Bitcoin Taproot PSBT Signing: BIP371 Key-Path and Script-Path Fields
Taproot introduced new signing and script structures, so traditional PSBT fields were insufficient for expressing all Taproot spending data. BIP371 adds fields that allow wallets, coordinators and hardware signers to exchange Taproot-specific information in a PSBT.
Key-path and script-path spending
A P2TR output commits to an output key. A key-path spend uses a BIP340 Schnorr signature corresponding to that output key, after accounting for any Taproot tweak. A script-path spend reveals a selected script leaf, its control block, and the witness data required by that leaf.
These paths have different privacy and witness-size characteristics. A key-path spend generally reveals less policy information. A script-path spend reveals the chosen leaf and proof, not necessarily the entire tree.
What BIP371 carries
BIP371 defines input fields for Taproot key-path signatures, script-path signatures, leaf scripts, BIP32 derivation information, the internal key and the Merkle root. Output fields can include Taproot internal keys, script trees and derivation information. Exact field presence depends on what the participant knows and which spending path is being used.
For script-path signing, the signer must know the script, leaf version, relevant keys and sighash context. The control block and leaf data must correspond to the output commitment. Merely attaching a Schnorr signature does not make an arbitrary script spend valid.
Example workflow
A coordinator assembles a PSBT spending a P2TR UTXO and supplies verified UTXO data. A hardware signer confirms the transaction outputs, fee, network and selected policy. It signs the appropriate Taproot key path or script leaf. A finalizer constructs the witness, and the extracted Bitcoin transaction is broadcast.
Never interpret an internal key or derivation path as sufficient proof of spend authority. Actual signatures, scripts and consensus validation determine whether the transaction is valid.
Common implementation mistakes
- Treating a P2TR address as though it were a SegWit v0 P2WPKH output.
- Using an ECDSA signature where BIP340 Schnorr is required.
- Forgetting that Taproot sighash construction differs from legacy and BIP143 rules.
- Exposing unnecessary key-derivation metadata to external coordinators.
- Assuming all PSBT parsers understand Taproot-specific fields.
Primary references
BIP371 — Taproot Fields for PSBT: https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki
BIP341 — Taproot: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki
BIP342 — Tapscript: https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki
