BIP-342 specifies Tapscript, the updated Bitcoin scripting language that replaces legacy script in the script-path spending branch of Taproot (BIP-341) outputs. Tapscript updates the signature opcodes to use BIP-340 Schnorr signatures, introduces the OP_CHECKSIGADD opcode to enable efficient threshold multisignature constructions, relaxes script resource limits, and establishes an extensible opcode upgrade mechanism via OP_SUCCESS opcodes for future soft forks.
Content
- BIP-342 was authored by Pieter Wuille, Jonas Nick, and Anthony Towns as part of the coordinated Taproot soft fork package comprising BIP-340 (Schnorr), BIP-341 (Taproot), and BIP-342 (Tapscript). The three BIPs were published in January 2020 and activated on the Bitcoin mainnet in November 2021 at block height 709,632 via the Speedy Trial activation mechanism. Tapscript addressed longstanding criticisms of Bitcoin script’s quadratic signing complexity and the inability to safely add new opcodes without consensus-breaking changes.
- Technically, Tapscript modifies script validation in several key ways. The new signature hash (sighash) for OP_CHECKSIG covers a richer set of transaction fields, eliminating the O(n²) hashing cost of legacy CHECKSIG for transactions with many inputs. OP_CHECKSIGADD takes a count and increments it upon a valid signature, enabling k-of-n multisig via a sequence of OP_CHECKSIGADD calls followed by a threshold comparison—cheaper on-chain than the legacy OP_CHECKMULTISIG because each signature is verified individually against a known key. OP_SUCCESS opcodes (OP_SUCCESS80, OP_SUCCESS98, etc.) cause the script to succeed unconditionally if encountered unless their meaning is later defined by a soft fork, providing a future-compatible upgrade path.
- The practical ecosystem impact of BIP-342 is primarily through enabling Taproot outputs generally: Tapscript is the mechanism by which any spending condition beyond a simple key-path payment is expressed within Taproot’s MAST (Merkelised Abstract Syntax Tree) structure. Lightning Network commitment transactions, time-locked vaults, and complex DLC (Discreet Log Contract) constructions are being migrated to use Tapscript for privacy and efficiency gains. Bitcoin development tooling including Bitcoin Core, rust-bitcoin, and bitcoinjs-lib fully support Tapscript construction and validation.
- As of 2024–2025, Tapscript adoption is growing alongside Taproot usage, which reached over 60% of transaction outputs by value on some metrics. Developers are experimenting with new Tapscript-enabled primitives such as VAULT (covenant) proposals and CHECKSIGFROMSTACK drafts that would allow script-level verification of arbitrary data. BIP-342’s OP_SUCCESS upgrade mechanism is central to the implementation pathway for proposed soft forks including OP_CAT and OP_CHECKTEMPLATEVERIFY, which are under active community debate.