OP_SUCCESS Opcodes - The Upgrade Mechanism
3. OP_SUCCESS Opcodes — The Upgrade Mechanism
OP_SUCCESS is not a single opcode — it is a category of opcodes in Tapscript that cause immediate, unconditional script success when encountered. This behavior is the foundation of Tapscript's forward-compatible upgrade mechanism.
What OP_SUCCESS Does
When the Tapscript interpreter encounters an OP_SUCCESS opcode, it immediately terminates script execution and returns TRUE, regardless of the stack state, regardless of any remaining opcodes, regardless of any conditions. The script succeeds.
// Example script with OP_SUCCESS80 (hypothetical):
OP_SHA256 <hash> OP_EQUAL OP_SUCCESS80 OP_DROP OP_1
// Execution:
1. OP_SHA256 executes normally
2. OP_EQUAL executes normally
3. OP_SUCCESS80 encountered → IMMEDIATE SUCCESS
// OP_DROP and OP_1 never execute
// Stack state irrelevant — script succeeds no matter what
The Full List of OP_SUCCESS Opcodes
BIP 342 defines the following opcode values as OP_SUCCESS in Tapscript:
OP_SUCCESS80 = 0x50
OP_SUCCESS98 = 0x62
OP_SUCCESS126 = 0x7e
OP_SUCCESS127 = 0x7f
OP_SUCCESS128 = 0x80
OP_SUCCESS129 = 0x81
OP_SUCCESS131 = 0x83
OP_SUCCESS132 = 0x84
OP_SUCCESS133 = 0x85
OP_SUCCESS134 = 0x86
OP_SUCCESS137 = 0x89
OP_SUCCESS138 = 0x8a
OP_SUCCESS150 = 0x96
OP_SUCCESS151 = 0x97
OP_SUCCESS152 = 0x98
OP_SUCCESS153 = 0x99
OP_SUCCESS154 = 0x9a
OP_SUCCESS155 = 0x9b
OP_SUCCESS156 = 0x9c
OP_SUCCESS157 = 0x9d
OP_SUCCESS158 = 0x9e
OP_SUCCESS159 = 0x9f
OP_SUCCESS170 = 0xaa
OP_SUCCESS171 = 0xab
OP_SUCCESS172 = 0xac (Note: This would override OP_CHECKSIG if redefined)
// ... and several more
Most of these correspond to opcodes that were previously undefined, disabled (like OP_CAT at 0x7e), or reserved.
How OP_SUCCESS Enables Soft Fork Upgrades
The upgrade mechanism works through a two-step process:
Step 1: Current behavior (before soft fork)
An unupgraded node sees OP_SUCCESS80 in a Tapscript and immediately considers the script valid. This means any transaction using OP_SUCCESS80 in a Tapscript leaf is accepted by all current nodes — old and new — because they all agree it is valid.
Step 2: After soft fork redefines the opcode
A soft fork can redefine OP_SUCCESS80 to have real semantics — say, OP_CAT (string concatenation). New nodes that understand the soft fork now execute OP_CAT instead of unconditionally succeeding. Old nodes still see OP_SUCCESS80 and still succeed unconditionally.
For this to be a valid soft fork, the new opcode semantics must be more restrictive than "always succeed." Any transaction that satisfies the new opcode's real requirements would also have satisfied the old "always succeed" behavior. So new nodes accept a subset of what old nodes would accept — which is the definition of a soft fork.
Before soft fork:
OP_SUCCESS80 → always succeeds
After soft fork redefines as OP_CAT:
OP_CAT → concatenates top two stack items, fails if stack underflows
→ succeeds only when stack has 2+ items of valid size
Transactions that pass OP_CAT also passed OP_SUCCESS80 (since anything passed OP_SUCCESS80)
Transactions that fail OP_CAT would have passed OP_SUCCESS80
→ This is a valid soft fork: new rules are strictly more restrictive
OP_SUCCESS vs OP_NOP for Upgrades
The legacy mechanism for script upgrades was repurposing OP_NOP opcodes. OP_SUCCESS is strictly more powerful:
OP_NOP upgrade limitations:
- Can only FAIL or continue (cannot push new data to stack)
- Cannot change stack state
- Limited to checking conditions and aborting
OP_SUCCESS upgrade possibilities:
- Can push data to stack (since entire execution is replaced)
- Can implement any operation
- Can change stack state arbitrarily
- Can enable OP_CAT, OP_CTV, OP_VAULT, etc.
This is why OP_SUCCESS is considered a major architectural improvement. It means that future opcodes like OP_CAT, OP_CHECKTEMPLATEVERIFY, or OP_VAULT can be deployed with much greater flexibility than was possible with NOP-based upgrades.
Technical Insight
This topic covers essential mechanics for Chapter 11. Understanding these details is key to mastering advanced Bitcoin script constructions like Taproot and specialized covenants.
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: