Tapscript

Also: BIP-342

cryptography · advanced

The scripting language used inside Taproot script-path spends. A cleaned-up Script with Schnorr signature support and some opcodes restored.

Tapscript is what runs when a Taproot output is spent via the script-path (revealing one of its merkle-committed branches) rather than the key-path. It's mostly Bitcoin Script with a handful of meaningful changes.

Schnorr signatures replace ECDSA. OP_CHECKSIG and OP_CHECKSIGADD validate Schnorr signatures and enable efficient k-of-n multisig: each signer's signature contributes to a counter, and you check that the counter meets the threshold. Previously each signer needed an explicit OP_CHECKMULTISIG invocation.

OP_SUCCESSx opcodes (rules: succeed immediately) are reserved for future soft-fork upgrades. OP_CODESEPARATOR is repurposed. The size limit on a script item is decoupled from the rest of the script, allowing larger items. These adjustments cleared the runway for things like CTV (BIP-119), OP_VAULT (BIP-345), and SIGHASH_GROUP — proposals that would otherwise have been blocked by inflexible legacy script.

Related terms