Tapscript & BIP342 Updates
Tapscript & BIP342 Updates
While BIP341 defines the structure of the address, BIP342 (Tapscript) defines the rules for the scripts hidden inside the Script Path. It is a cleaned-up, modernized version of the original Bitcoin Script.
1. Schnorr Support
The most obvious change is that all signature-checking opcodes (like OP_CHECKSIG) now expect a Schnorr Signature and a 32-byte public key, rather than ECDSA.
2. Removing Old Limits
Original Bitcoin Script had several "Legacy Limits" that made complex contracts difficult:
-
Signature Limit: A transaction could only have a maximum of 201 signatures.
-
Script Size: Individual script elements were limited to 520 bytes. Tapscript removes or significantly increases these limits, allowing for much more powerful smart contracts (like those used in BitVM).
3. OP_CHECKSIGADD (New Opcodes)
Tapscript replaced the old, inefficient OP_CHECKMULTISIG with a new opcode called OP_CHECKSIGADD.
-
Old Way: You had to provide a list of all keys and a number of required signatures.
-
New Way: You go through the keys one by one and "add" to a counter if the signature is valid.
-
Benefit: This is much more flexible and compatible with Batch Verification.
4. Resource Accounting (SigOps)
Tapscript introduces a better way to account for "expensive" operations (SigOps).
- Instead of having a flat limit per block, SigOps are now counted based on the Weight of the transaction. This ensures that miners are fairly compensated for the CPU time they spend verifying your script.
5. Future-Proofing (OP_SUCCESS)
Satoshi originally disabled many opcodes (the "Disabled Opcodes") to prevent security vulnerabilities.
Tapscript replaces these with OP_SUCCESS opcodes.
-
The Rule: Any script containing an
OP_SUCCESSopcode is automatically valid. -
The Reason: This allows Bitcoin to add new features in the future (via another soft-fork) by simply redefining what an
OP_SUCCESSopcode does. It makes future upgrades much easier to implement.
| Change | Legacy Script | Tapscript |
|---|---|---|
| Sig Algorithm | ECDSA | Schnorr |
| Multisig Op | OP_CHECKMULTISIG |
OP_CHECKSIGADD |
| Upgrade Path | Difficult | Easy (OP_SUCCESS) |
In the final section, we will build a Python Taproot Auditor.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: