spec-bip-0341-mediawiki
Specifies Bitcoin Taproot (SegWit v1) spending rules: Schnorr key-path spends plus tagged-hash Merkle script-path spends, with sighash and deployment details.
Schemes: Taproot, BIP340, BIP342, BIP341, BIP143, BIP9, MuSig, Schnorr, SHA256, BIP350
Findings (quotes checked against the source text)
-
Taproot outputs are spendable by a key path (single Schnorr signature) or a script path (Merkle proof of a committed leaf), so unused scripts stay hidden on-chain.
Taproot on top of that lets us merge the traditionally separate pay-to-pubkey and pay-to-scripthash policies, making all outputs spendable by either a key or (optionally) a script, and indistinguishable from each other.
-
Output key Q is computed as P + hash(P||m)G, where m is the Merkle root over tagged TapLeaf/TapBranch hashes, using domain-separated tagged hashes.
Informally, the resulting design is as follows: a new witness version is added (version 1), whose programs consist of 32-byte encodings of points ''Q''.
-
Signature hashing is changed to commit to all spent scriptPubKeys and all input amounts, which protects offline signers from being lied to about fee and output.
The signature message commits to the ''scriptPubKey'' of the spent output and if the
SIGHASH_ANYONECANPAYflag is not set, the message commits to the ''scriptPubKey''s of ''all'' outputs spent by the transaction. -
Key-path signatures are 64-byte BIP340 Schnorr signatures; a 65-byte form with explicit sighash byte is also allowed.
A Taproot signature is a 64-byte Schnorr signature, as defined in BIP340, with the sighash byte appended in the usual Bitcoin fashion.
-
Script-path spends reveal the script and Merkle path, and the spec warns that script-path use leaks that key-path was not applicable.
A script path spend leaks that there is a script path and that the key path was not applicable - for example because the involved parties failed to reach agreement.
-
Future leaf versions are soft-fork extensible via leaf version bytes and an annex field reserved for future use.
Additionally, future soft forks can make use of the currently unused
annexin the witness
Numbers (as extracted, not quote-checked)
- Merkle control block path length limit: 128 levels (m between 0 and 128, control block length 33 + 32m)
- Maximum SigMsg length: 206 bytes
- Mainnet activation threshold: 1815 blocks (90%)
- Mainnet min_activation_height: 709632
For builders
Take the structural pattern: a single key-path default with tagged-hash Merkle script leaves, committing to all spent scriptPubKeys and amounts in the sighash, and reserve a leaf-version byte and annex for future soft-fork upgrades.
Limits
Classical secp256k1 Schnorr with discrete-log assumptions; explicitly does not add post-quantum security, and P2SH-wrapped and hash-of-key outputs are not quantum-resistant by design.
Topics: bitcoin-migration chain-design sig-other hash-functions wallets-keys standards-policy