Bitcoin BIP341 Taproot: Key-Path, Script-Path, and Consensus Changes
BIP341 defines Taproot's witness version 1 spending rules. Its design allows an output to commit to an internal public key and, optionally, a tree of alternative spending scripts. A spender may use the key path or reveal a particular script path without exposing every alternative branch.
What is a Taproot output?
A native Taproot output uses a version 1 witness program containing a 32-byte x-only output public key. Bech32m is the address checksum format used to encode these witness-version-1 addresses; the address itself is a human-facing representation, not the consensus rule.
The output key is computed from an internal key and a tweak that commits to the script tree when one is present. This cryptographically binds the public key to the permitted alternative scripts.
Key-path spending
A key-path spend supplies a valid Schnorr signature under the output key, with an optional sighash-type byte as defined by BIP341. A 64-byte signature uses SIGHASH_DEFAULT; a 65-byte signature includes an explicit permitted sighash type. The message commits to transaction data according to the selected sighash mode.
Script-path spending
A script-path spend reveals the chosen leaf script and a control block, together with the witness items needed to execute the script. The control block carries information required to reconstruct the commitment from the revealed leaf and Merkle path. The node verifies that the revealed branch matches the output key commitment, then executes the applicable script rules.
Only the chosen branch is revealed. Other branches remain hidden unless disclosed elsewhere. This is a conditional privacy improvement, not a guarantee of complete privacy.
Sighash and annex details
BIP341 defines a new signature message format with commitments to input amounts and spent output scriptPubKeys where appropriate. ANYONECANPAY changes which input-related data are committed. The annex is an optional witness element identified by a leading 0x50 byte and is committed to by the signature message if present.
Compatibility and validation
Old nodes that do not enforce Taproot do not perform all the new witness-version-1 checks. Upgraded nodes enforce BIP341 and BIP342 at the activation height. Applications must not confuse being able to parse an address with being able to validate or safely sign for that output type.
Engineering takeaway
Taproot's key path, script tree, witness format, and signature commitments form one coordinated consensus upgrade. A wallet should construct descriptors, addresses, signing messages, and witness data consistently rather than treating Taproot as only a new address prefix.
Primary references
BIP341 — Taproot: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki
BIP350 — Bech32m: https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki
BIP340 — Schnorr Signatures: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
