§ 06 · Script
Opcodes
Every byte value, and what it does on Pearl
On this page 7 sections
An opcodeOpcode: One instruction in Script, written as a single byte, such as OP_CAT (0x7e). On Pearl, an unknown opcode makes the script fail. is one byte of a script that tells the machine what to do: push some data, add two numbers, check a signature. A script is a row of them.
Every byte value from 0 to 255 means something, even if that something is “fail”. This page lists them all as Pearl’s engine treats them. The table is generated from this site’s opcode library, which mirrors Pearl’s opcode.go at v1.5.2.
Try it
Write a script with any of the opcodes below and step through it.
How do the 256 bytes break down?
- Push data or numbers
- 96
- 0x00–0x60, except 0x50 (OP_RESERVED)
- Work everywhere
- 57
- stack, flow, arithmetic, hashing, locks
- Tapscript only
- 5
- CHECKSIG, CHECKSIGVERIFY, CHECKSIGADD, CAT, CHECKXMSSSIG
- Disabled
- 16
- invalid even in a branch that never runs
- Fail when run
- 82
- reserved, NOP slots, unassigned bytes
- OP_SUCCESS
- 0
- Bitcoin tapscript has dozens
Since every spendable Pearl output is Taproot or P2MR, every script that runs is a tapscript leaf. So in practice “tapscript only” just means “works”.
Which opcodes are special on Pearl?
OP_CAT(7e) works. It joins the top two items. Following BIP-347, the result may be at most 520 bytes. Pearl also charges ⌈length ÷ 64⌉ from the signature budget for it. In Bitcoin it has been disabled since 2010, and in Bitcoin’s tapscript7eis an OP_SUCCESS.OP_CHECKXMSSSIG(de) is new. It checks a post-quantum XMSS signature split into five 468-byte items, and costs 1,000 from the budget. Its own page.OP_CHECKSIG(ac),OP_CHECKSIGVERIFY(ad),OP_CHECKSIGADD(ba) check 64- or 65-byte Schnorr signatures against 32-byte keys, in tapscript only. An empty signature pushes false; a wrong non-empty signature fails the script. A non-empty key of any other length fails too, where Bitcoin’s tapscript treats it as an unknown key type and lets the check pass.OP_CHECKMULTISIG(ae,af) always fails. UseOP_CHECKSIGADDfor multisigMultisig: A lock that needs several signatures, such as 2 of 2 or 2 of 3. On Pearl it is written in tapscript with OP_CHECKSIGADD; the old OP_CHECKMULTISIG always fails., as the real 2-of-2 on the Script page does.OP_NOP1,OP_NOP4–OP_NOP10(b0,b3–b9) fail with “reserved for soft-fork upgrades”. In Bitcoin they do nothing.- Unassigned bytes (
bb–dd,df–f9,fc) fail when executed. In Bitcoin’s tapscript each is an OP_SUCCESSOP_SUCCESS: In Bitcoin tapscript, unused opcodes that make a script succeed at once, kept for future upgrades. Pearl has none: an unknown opcode makes the script fail. that makes the whole script valid. OP_CHECKLOCKTIMEVERIFY(b1) andOP_CHECKSEQUENCEVERIFY(b2) work as in BIP-65 and BIP-112, from block 1.
What do the probes show?
These one-line scripts were run as P2MR leaves through Pearl’s own consensus engine:
| Leaf script | Pearl v1.5.2 | Bitcoin tapscript |
|---|---|---|
51 (OP_1) |
pass | valid |
7e 05 "pearl" 87 with witness “pe”, “arl” |
pass: OP_CAT really joins them | valid only because 0x7e is OP_SUCCESS126 |
51 bb |
fail: invalid opcode OP_UNKNOWN187 | valid (OP_SUCCESS) |
00 bb |
fail, same | valid (OP_SUCCESS wins even after false) |
de alone |
fail: stack too small for OP_CHECKXMSSSIG | valid (0xde is OP_SUCCESS222) |
b3 51 (OP_NOP4, OP_1) |
fail: reserved for soft-fork upgrades | valid |
51 under leaf version c2 |
fail: unsupported leaf version | valid |
33-byte key, then ac |
fail: unsupported public key length 33 | valid (unknown key type) |
00 00 00 ae |
fail: CHECKMULTISIG disabled | invalid |
How does Script write numbers?
Arithmetic opcodes read stack items as script numbers: little-endian, as short as possible, with the top bit of the last byte as the sign. Zero is the empty item.
| Number | Script number | Pushed as |
|---|---|---|
| 0 | (empty) | 00 (OP_0) |
| 1 | 01 |
51 (OP_1) |
| 16 | 10 |
60 (OP_16) |
| 17 | 11 |
01 11 |
| −1 | 81 |
4f (OP_1NEGATE) |
| 127 | 7f |
01 7f |
| 128 | 80 00 |
02 80 00 (an extra byte, so the sign bit stays clear) |
| −128 | 80 80 |
02 80 80 |
| 130,825 | 09 ff 01 |
03 09 ff 01 |
The last row is a real one: it’s how block 130,825’s coinbase states its height. Tapscript insists on the shortest push, so 51 is the only valid way to push 1.
What limits apply?
- The signature budget. Each input gets 50 plus the size of its witness in bytes. A signature check costs 50,
OP_CHECKXMSSSIG1,000, andOP_CAT⌈length ÷ 64⌉. Pearl has no other sigops limit: none per block, none per transaction. - Stack items are at most 520 bytes, and at most 1,000 items may be on the stack.
- Pushes must be minimal: a value that fits in
OP_1–OP_16must use them, and a 5-byte item uses05, notOP_PUSHDATA1 05. OP_IF/OP_NOTIFaccept only an empty item or exactly01as their condition.- No opcode-count limit and no 10,000-byte script limit inside tapscript, as in BIP-342.
The full table
Every named opcode. The push range and the unassigned bytes are summarized in the last rows; the complete 256-row table is below it.
| Byte | Name | On Pearl | What it does |
|---|---|---|---|
00 | OP_0 (OP_FALSE) | Push | Pushes an empty byte array (read as 0 / false). |
4c | OP_PUSHDATA1 | Push | The next byte says how many bytes to push (up to 255). |
4d | OP_PUSHDATA2 | Push | The next 2 bytes (little-endian) say how many bytes to push. |
4e | OP_PUSHDATA4 | Push | The next 4 bytes (little-endian) say how many bytes to push. |
4f | OP_1NEGATE | Push | Pushes the number -1. |
50 | OP_RESERVED | Fails if run | Reserved: the script fails if it is executed. Pearl: In Bitcoin tapscript 0x50 is OP_SUCCESS80; Pearl has no OP_SUCCESS opcodes. |
51 | OP_1 (OP_TRUE) | Push | Pushes the number 1. Also the witness-version byte of a Taproot output (5120…). |
52 | OP_2 | Push | Pushes the number 2. Also the witness-version byte of a P2MR output (5220…). |
61 | OP_NOP | Works | Does nothing. |
62 | OP_VER | Fails if run | Reserved: the script fails if it is executed. Pearl: OP_SUCCESS98 in Bitcoin tapscript; a failure in Pearl. |
63 | OP_IF | Works | Runs the following code only if the top stack item is true (must be exactly empty or 0x01 in tapscript). |
64 | OP_NOTIF | Works | Runs the following code only if the top stack item is false. |
65 | OP_VERIF | Disabled | Always illegal, even in a branch that is not executed. |
66 | OP_VERNOTIF | Disabled | Always illegal, even in a branch that is not executed. |
67 | OP_ELSE | Works | Switches to the other branch of an OP_IF / OP_NOTIF. |
68 | OP_ENDIF | Works | Ends an OP_IF / OP_NOTIF block. |
69 | OP_VERIFY | Works | Fails the script unless the top item is true; removes it. |
6a | OP_RETURN | Works | Ends the script as failed. An output script starting with OP_RETURN is a provably unspendable data carrier. Pearl: Any script starting with 0x6a is a valid output in Pearl, with no size cap besides the tx limit (policy: 1 per tx). |
6b | OP_TOALTSTACK | Works | Moves the top item to the alt stack. |
6c | OP_FROMALTSTACK | Works | Moves the top alt-stack item back to the main stack. |
6d | OP_2DROP | Works | Removes the top two items. |
6e | OP_2DUP | Works | Duplicates the top two items. |
6f | OP_3DUP | Works | Duplicates the top three items. |
70 | OP_2OVER | Works | Copies the pair of items two spaces back to the top. |
71 | OP_2ROT | Works | Moves the fifth and sixth items to the top. |
72 | OP_2SWAP | Works | Swaps the top two pairs of items. |
73 | OP_IFDUP | Works | Duplicates the top item if it is not zero. |
74 | OP_DEPTH | Works | Pushes the number of stack items. |
75 | OP_DROP | Works | Removes the top item. |
76 | OP_DUP | Works | Duplicates the top item. |
77 | OP_NIP | Works | Removes the second-to-top item. |
78 | OP_OVER | Works | Copies the second-to-top item to the top. |
79 | OP_PICK | Works | Copies the item n back to the top. |
7a | OP_ROLL | Works | Moves the item n back to the top. |
7b | OP_ROT | Works | Rotates the top three items to the left. |
7c | OP_SWAP | Works | Swaps the top two items. |
7d | OP_TUCK | Works | Copies the top item below the second item. |
7e | OP_CAT | Tapscript only | Concatenates the top two items (result at most 520 bytes). Pearl: Enabled in Pearl tapscript (BIP-347 semantics) and charges ceil(len/64) from the sigops budget. Disabled in Bitcoin (OP_SUCCESS126 in its tapscript). |
7f | OP_SUBSTR | Disabled | Disabled: its mere presence makes the script invalid. |
80 | OP_LEFT | Disabled | Disabled: its mere presence makes the script invalid. |
81 | OP_RIGHT | Disabled | Disabled: its mere presence makes the script invalid. |
82 | OP_SIZE | Works | Pushes the byte length of the top item. |
83 | OP_INVERT | Disabled | Disabled: its mere presence makes the script invalid. |
84 | OP_AND | Disabled | Disabled: its mere presence makes the script invalid. |
85 | OP_OR | Disabled | Disabled: its mere presence makes the script invalid. |
86 | OP_XOR | Disabled | Disabled: its mere presence makes the script invalid. |
87 | OP_EQUAL | Works | Pushes true if the top two items are byte-for-byte equal. |
88 | OP_EQUALVERIFY | Works | OP_EQUAL then OP_VERIFY. |
89 | OP_RESERVED1 | Fails if run | Reserved: the script fails if it is executed. |
8a | OP_RESERVED2 | Fails if run | Reserved: the script fails if it is executed. |
8b | OP_1ADD | Works | Adds 1 to the top number. |
8c | OP_1SUB | Works | Subtracts 1 from the top number. |
8d | OP_2MUL | Disabled | Disabled: its mere presence makes the script invalid. |
8e | OP_2DIV | Disabled | Disabled: its mere presence makes the script invalid. |
8f | OP_NEGATE | Works | Flips the sign of the top number. |
90 | OP_ABS | Works | Replaces the top number with its absolute value. |
91 | OP_NOT | Works | Turns 0 into 1 and anything else into 0. |
92 | OP_0NOTEQUAL | Works | Turns 0 into 0 and anything else into 1. |
93 | OP_ADD | Works | Adds the top two numbers. |
94 | OP_SUB | Works | Subtracts the top number from the second. |
95 | OP_MUL | Disabled | Disabled: its mere presence makes the script invalid. |
96 | OP_DIV | Disabled | Disabled: its mere presence makes the script invalid. |
97 | OP_MOD | Disabled | Disabled: its mere presence makes the script invalid. |
98 | OP_LSHIFT | Disabled | Disabled: its mere presence makes the script invalid. |
99 | OP_RSHIFT | Disabled | Disabled: its mere presence makes the script invalid. |
9a | OP_BOOLAND | Works | Pushes 1 if both top numbers are non-zero. |
9b | OP_BOOLOR | Works | Pushes 1 if either top number is non-zero. |
9c | OP_NUMEQUAL | Works | Pushes 1 if the top two numbers are equal. |
9d | OP_NUMEQUALVERIFY | Works | OP_NUMEQUAL then OP_VERIFY. |
9e | OP_NUMNOTEQUAL | Works | Pushes 1 if the top two numbers differ. |
9f | OP_LESSTHAN | Works | Pushes 1 if the second number is less than the top. |
a0 | OP_GREATERTHAN | Works | Pushes 1 if the second number is greater than the top. |
a1 | OP_LESSTHANOREQUAL | Works | Pushes 1 if the second number is ≤ the top. |
a2 | OP_GREATERTHANOREQUAL | Works | Pushes 1 if the second number is ≥ the top. |
a3 | OP_MIN | Works | Keeps the smaller of the top two numbers. |
a4 | OP_MAX | Works | Keeps the larger of the top two numbers. |
a5 | OP_WITHIN | Works | Pushes 1 if x is within [min, max). |
a6 | OP_RIPEMD160 | Works | Replaces the top item with its RIPEMD-160 hash. |
a7 | OP_SHA1 | Works | Replaces the top item with its SHA-1 hash. |
a8 | OP_SHA256 | Works | Replaces the top item with its SHA-256 hash. |
a9 | OP_HASH160 | Works | Replaces the top item with RIPEMD160(SHA256(x)). Pearl: Still available, but no Pearl address uses HASH160. |
aa | OP_HASH256 | Works | Replaces the top item with SHA256(SHA256(x)). |
ab | OP_CODESEPARATOR | Works | Records its position, which signatures then commit to (BIP-342 codesep_pos). |
ac | OP_CHECKSIG | Tapscript only | Checks a Schnorr signature against a 32-byte x-only key; empty signature pushes false. Pearl: Tapscript only: Pearl removed legacy ECDSA checks. Unknown key sizes fail instead of succeeding. |
ad | OP_CHECKSIGVERIFY | Tapscript only | OP_CHECKSIG then OP_VERIFY. Pearl: Tapscript only. |
ae | OP_CHECKMULTISIG | Fails if run | Always fails in Pearl (use OP_CHECKSIGADD instead). Pearl: Legacy multisig is gone; same as Bitcoin tapscript. |
af | OP_CHECKMULTISIGVERIFY | Fails if run | Always fails in Pearl. |
b0 | OP_NOP1 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A harmless no-op in Bitcoin; a failure in Pearl. |
b1 | OP_CHECKLOCKTIMEVERIFY (OP_NOP2, OP_CLTV) | Works | Fails unless the transaction locktime has reached the given height/time (BIP-65). |
b2 | OP_CHECKSEQUENCEVERIFY (OP_NOP3, OP_CSV) | Works | Fails unless the input has aged by the given relative lock (BIP-112, needs tx version ≥ 2). |
b3 | OP_NOP4 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b4 | OP_NOP5 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b5 | OP_NOP6 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b6 | OP_NOP7 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b7 | OP_NOP8 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b8 | OP_NOP9 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
b9 | OP_NOP10 | Fails if run | Reserved for upgrades: fails when executed. Pearl: A no-op in Bitcoin; a failure in Pearl. |
ba | OP_CHECKSIGADD | Tapscript only | Checks a signature and adds 1 to a counter if it is valid: the building block of k-of-n multisig (BIP-342). |
de | OP_CHECKXMSSSIG | Tapscript only | Checks a post-quantum XMSS signature: stack [sig1…sig5 (468 B each), 64-byte pubkey] → [true]; an invalid signature fails the script. Pearl: Pearl-only. Costs 1000 from the sigops budget. In Bitcoin 0xde is OP_SUCCESS222. |
fa | OP_SMALLINTEGER | Fails if run | Internal template name, not a real opcode: fails when executed. |
fb | OP_PUBKEYS | Fails if run | Internal template name, not a real opcode: fails when executed. |
fd | OP_PUBKEYHASH | Fails if run | Internal template name, not a real opcode: fails when executed. |
fe | OP_PUBKEY | Fails if run | Internal template name, not a real opcode: fails when executed. |
ff | OP_INVALIDOPCODE | Fails if run | Invalid opcode: fails when executed. |
01–4b | OP_PUSHBYTES_1 … _75 | Push | Push the next 1 to 75 bytes. 20 (32 bytes) pushes x-only keys; 40 (64 bytes) pushes XMSS public keys. |
53–60 | OP_3 … OP_16 | Push | Push the numbers 3 to 16. As output versions they would mean witness v3–16, which Pearl rejects. |
bb–dd, df–f9, fc | OP_UNKNOWN… | Fails if run | Unassigned. Pearl: fails; in Bitcoin’s tapscript each is an OP_SUCCESS. |
All 256 byte values
| Byte | Name | On Pearl | What it does |
|---|---|---|---|
00 | OP_0 | Push | Pushes an empty byte array (read as 0 / false). |
01 | OP_DATA_1 | Push | Pushes the next 1 byte onto the stack. |
02 | OP_DATA_2 | Push | Pushes the next 2 bytes onto the stack. |
03 | OP_DATA_3 | Push | Pushes the next 3 bytes onto the stack. |
04 | OP_DATA_4 | Push | Pushes the next 4 bytes onto the stack. |
05 | OP_DATA_5 | Push | Pushes the next 5 bytes onto the stack. |
06 | OP_DATA_6 | Push | Pushes the next 6 bytes onto the stack. |
07 | OP_DATA_7 | Push | Pushes the next 7 bytes onto the stack. |
08 | OP_DATA_8 | Push | Pushes the next 8 bytes onto the stack. |
09 | OP_DATA_9 | Push | Pushes the next 9 bytes onto the stack. |
0a | OP_DATA_10 | Push | Pushes the next 10 bytes onto the stack. |
0b | OP_DATA_11 | Push | Pushes the next 11 bytes onto the stack. |
0c | OP_DATA_12 | Push | Pushes the next 12 bytes onto the stack. |
0d | OP_DATA_13 | Push | Pushes the next 13 bytes onto the stack. |
0e | OP_DATA_14 | Push | Pushes the next 14 bytes onto the stack. |
0f | OP_DATA_15 | Push | Pushes the next 15 bytes onto the stack. |
10 | OP_DATA_16 | Push | Pushes the next 16 bytes onto the stack. |
11 | OP_DATA_17 | Push | Pushes the next 17 bytes onto the stack. |
12 | OP_DATA_18 | Push | Pushes the next 18 bytes onto the stack. |
13 | OP_DATA_19 | Push | Pushes the next 19 bytes onto the stack. |
14 | OP_DATA_20 | Push | Pushes the next 20 bytes onto the stack. |
15 | OP_DATA_21 | Push | Pushes the next 21 bytes onto the stack. |
16 | OP_DATA_22 | Push | Pushes the next 22 bytes onto the stack. |
17 | OP_DATA_23 | Push | Pushes the next 23 bytes onto the stack. |
18 | OP_DATA_24 | Push | Pushes the next 24 bytes onto the stack. |
19 | OP_DATA_25 | Push | Pushes the next 25 bytes onto the stack. |
1a | OP_DATA_26 | Push | Pushes the next 26 bytes onto the stack. |
1b | OP_DATA_27 | Push | Pushes the next 27 bytes onto the stack. |
1c | OP_DATA_28 | Push | Pushes the next 28 bytes onto the stack. |
1d | OP_DATA_29 | Push | Pushes the next 29 bytes onto the stack. |
1e | OP_DATA_30 | Push | Pushes the next 30 bytes onto the stack. |
1f | OP_DATA_31 | Push | Pushes the next 31 bytes onto the stack. |
20 | OP_DATA_32 | Push | Pushes the next 32 bytes onto the stack. |
21 | OP_DATA_33 | Push | Pushes the next 33 bytes onto the stack. |
22 | OP_DATA_34 | Push | Pushes the next 34 bytes onto the stack. |
23 | OP_DATA_35 | Push | Pushes the next 35 bytes onto the stack. |
24 | OP_DATA_36 | Push | Pushes the next 36 bytes onto the stack. |
25 | OP_DATA_37 | Push | Pushes the next 37 bytes onto the stack. |
26 | OP_DATA_38 | Push | Pushes the next 38 bytes onto the stack. |
27 | OP_DATA_39 | Push | Pushes the next 39 bytes onto the stack. |
28 | OP_DATA_40 | Push | Pushes the next 40 bytes onto the stack. |
29 | OP_DATA_41 | Push | Pushes the next 41 bytes onto the stack. |
2a | OP_DATA_42 | Push | Pushes the next 42 bytes onto the stack. |
2b | OP_DATA_43 | Push | Pushes the next 43 bytes onto the stack. |
2c | OP_DATA_44 | Push | Pushes the next 44 bytes onto the stack. |
2d | OP_DATA_45 | Push | Pushes the next 45 bytes onto the stack. |
2e | OP_DATA_46 | Push | Pushes the next 46 bytes onto the stack. |
2f | OP_DATA_47 | Push | Pushes the next 47 bytes onto the stack. |
30 | OP_DATA_48 | Push | Pushes the next 48 bytes onto the stack. |
31 | OP_DATA_49 | Push | Pushes the next 49 bytes onto the stack. |
32 | OP_DATA_50 | Push | Pushes the next 50 bytes onto the stack. |
33 | OP_DATA_51 | Push | Pushes the next 51 bytes onto the stack. |
34 | OP_DATA_52 | Push | Pushes the next 52 bytes onto the stack. |
35 | OP_DATA_53 | Push | Pushes the next 53 bytes onto the stack. |
36 | OP_DATA_54 | Push | Pushes the next 54 bytes onto the stack. |
37 | OP_DATA_55 | Push | Pushes the next 55 bytes onto the stack. |
38 | OP_DATA_56 | Push | Pushes the next 56 bytes onto the stack. |
39 | OP_DATA_57 | Push | Pushes the next 57 bytes onto the stack. |
3a | OP_DATA_58 | Push | Pushes the next 58 bytes onto the stack. |
3b | OP_DATA_59 | Push | Pushes the next 59 bytes onto the stack. |
3c | OP_DATA_60 | Push | Pushes the next 60 bytes onto the stack. |
3d | OP_DATA_61 | Push | Pushes the next 61 bytes onto the stack. |
3e | OP_DATA_62 | Push | Pushes the next 62 bytes onto the stack. |
3f | OP_DATA_63 | Push | Pushes the next 63 bytes onto the stack. |
40 | OP_DATA_64 | Push | Pushes the next 64 bytes onto the stack. |
41 | OP_DATA_65 | Push | Pushes the next 65 bytes onto the stack. |
42 | OP_DATA_66 | Push | Pushes the next 66 bytes onto the stack. |
43 | OP_DATA_67 | Push | Pushes the next 67 bytes onto the stack. |
44 | OP_DATA_68 | Push | Pushes the next 68 bytes onto the stack. |
45 | OP_DATA_69 | Push | Pushes the next 69 bytes onto the stack. |
46 | OP_DATA_70 | Push | Pushes the next 70 bytes onto the stack. |
47 | OP_DATA_71 | Push | Pushes the next 71 bytes onto the stack. |
48 | OP_DATA_72 | Push | Pushes the next 72 bytes onto the stack. |
49 | OP_DATA_73 | Push | Pushes the next 73 bytes onto the stack. |
4a | OP_DATA_74 | Push | Pushes the next 74 bytes onto the stack. |
4b | OP_DATA_75 | Push | Pushes the next 75 bytes onto the stack. |
4c | OP_PUSHDATA1 | Push | The next byte says how many bytes to push (up to 255). |
4d | OP_PUSHDATA2 | Push | The next 2 bytes (little-endian) say how many bytes to push. |
4e | OP_PUSHDATA4 | Push | The next 4 bytes (little-endian) say how many bytes to push. |
4f | OP_1NEGATE | Push | Pushes the number -1. |
50 | OP_RESERVED | Fails if run | Reserved: the script fails if it is executed. |
51 | OP_1 | Push | Pushes the number 1. Also the witness-version byte of a Taproot output (5120…). |
52 | OP_2 | Push | Pushes the number 2. Also the witness-version byte of a P2MR output (5220…). |
53 | OP_3 | Push | Pushes the number 3. |
54 | OP_4 | Push | Pushes the number 4. |
55 | OP_5 | Push | Pushes the number 5. |
56 | OP_6 | Push | Pushes the number 6. |
57 | OP_7 | Push | Pushes the number 7. |
58 | OP_8 | Push | Pushes the number 8. |
59 | OP_9 | Push | Pushes the number 9. |
5a | OP_10 | Push | Pushes the number 10. |
5b | OP_11 | Push | Pushes the number 11. |
5c | OP_12 | Push | Pushes the number 12. |
5d | OP_13 | Push | Pushes the number 13. |
5e | OP_14 | Push | Pushes the number 14. |
5f | OP_15 | Push | Pushes the number 15. |
60 | OP_16 | Push | Pushes the number 16. |
61 | OP_NOP | Works | Does nothing. |
62 | OP_VER | Fails if run | Reserved: the script fails if it is executed. |
63 | OP_IF | Works | Runs the following code only if the top stack item is true (must be exactly empty or 0x01 in tapscript). |
64 | OP_NOTIF | Works | Runs the following code only if the top stack item is false. |
65 | OP_VERIF | Disabled | Always illegal, even in a branch that is not executed. |
66 | OP_VERNOTIF | Disabled | Always illegal, even in a branch that is not executed. |
67 | OP_ELSE | Works | Switches to the other branch of an OP_IF / OP_NOTIF. |
68 | OP_ENDIF | Works | Ends an OP_IF / OP_NOTIF block. |
69 | OP_VERIFY | Works | Fails the script unless the top item is true; removes it. |
6a | OP_RETURN | Works | Ends the script as failed. An output script starting with OP_RETURN is a provably unspendable data carrier. |
6b | OP_TOALTSTACK | Works | Moves the top item to the alt stack. |
6c | OP_FROMALTSTACK | Works | Moves the top alt-stack item back to the main stack. |
6d | OP_2DROP | Works | Removes the top two items. |
6e | OP_2DUP | Works | Duplicates the top two items. |
6f | OP_3DUP | Works | Duplicates the top three items. |
70 | OP_2OVER | Works | Copies the pair of items two spaces back to the top. |
71 | OP_2ROT | Works | Moves the fifth and sixth items to the top. |
72 | OP_2SWAP | Works | Swaps the top two pairs of items. |
73 | OP_IFDUP | Works | Duplicates the top item if it is not zero. |
74 | OP_DEPTH | Works | Pushes the number of stack items. |
75 | OP_DROP | Works | Removes the top item. |
76 | OP_DUP | Works | Duplicates the top item. |
77 | OP_NIP | Works | Removes the second-to-top item. |
78 | OP_OVER | Works | Copies the second-to-top item to the top. |
79 | OP_PICK | Works | Copies the item n back to the top. |
7a | OP_ROLL | Works | Moves the item n back to the top. |
7b | OP_ROT | Works | Rotates the top three items to the left. |
7c | OP_SWAP | Works | Swaps the top two items. |
7d | OP_TUCK | Works | Copies the top item below the second item. |
7e | OP_CAT | Tapscript only | Concatenates the top two items (result at most 520 bytes). |
7f | OP_SUBSTR | Disabled | Disabled: its mere presence makes the script invalid. |
80 | OP_LEFT | Disabled | Disabled: its mere presence makes the script invalid. |
81 | OP_RIGHT | Disabled | Disabled: its mere presence makes the script invalid. |
82 | OP_SIZE | Works | Pushes the byte length of the top item. |
83 | OP_INVERT | Disabled | Disabled: its mere presence makes the script invalid. |
84 | OP_AND | Disabled | Disabled: its mere presence makes the script invalid. |
85 | OP_OR | Disabled | Disabled: its mere presence makes the script invalid. |
86 | OP_XOR | Disabled | Disabled: its mere presence makes the script invalid. |
87 | OP_EQUAL | Works | Pushes true if the top two items are byte-for-byte equal. |
88 | OP_EQUALVERIFY | Works | OP_EQUAL then OP_VERIFY. |
89 | OP_RESERVED1 | Fails if run | Reserved: the script fails if it is executed. |
8a | OP_RESERVED2 | Fails if run | Reserved: the script fails if it is executed. |
8b | OP_1ADD | Works | Adds 1 to the top number. |
8c | OP_1SUB | Works | Subtracts 1 from the top number. |
8d | OP_2MUL | Disabled | Disabled: its mere presence makes the script invalid. |
8e | OP_2DIV | Disabled | Disabled: its mere presence makes the script invalid. |
8f | OP_NEGATE | Works | Flips the sign of the top number. |
90 | OP_ABS | Works | Replaces the top number with its absolute value. |
91 | OP_NOT | Works | Turns 0 into 1 and anything else into 0. |
92 | OP_0NOTEQUAL | Works | Turns 0 into 0 and anything else into 1. |
93 | OP_ADD | Works | Adds the top two numbers. |
94 | OP_SUB | Works | Subtracts the top number from the second. |
95 | OP_MUL | Disabled | Disabled: its mere presence makes the script invalid. |
96 | OP_DIV | Disabled | Disabled: its mere presence makes the script invalid. |
97 | OP_MOD | Disabled | Disabled: its mere presence makes the script invalid. |
98 | OP_LSHIFT | Disabled | Disabled: its mere presence makes the script invalid. |
99 | OP_RSHIFT | Disabled | Disabled: its mere presence makes the script invalid. |
9a | OP_BOOLAND | Works | Pushes 1 if both top numbers are non-zero. |
9b | OP_BOOLOR | Works | Pushes 1 if either top number is non-zero. |
9c | OP_NUMEQUAL | Works | Pushes 1 if the top two numbers are equal. |
9d | OP_NUMEQUALVERIFY | Works | OP_NUMEQUAL then OP_VERIFY. |
9e | OP_NUMNOTEQUAL | Works | Pushes 1 if the top two numbers differ. |
9f | OP_LESSTHAN | Works | Pushes 1 if the second number is less than the top. |
a0 | OP_GREATERTHAN | Works | Pushes 1 if the second number is greater than the top. |
a1 | OP_LESSTHANOREQUAL | Works | Pushes 1 if the second number is ≤ the top. |
a2 | OP_GREATERTHANOREQUAL | Works | Pushes 1 if the second number is ≥ the top. |
a3 | OP_MIN | Works | Keeps the smaller of the top two numbers. |
a4 | OP_MAX | Works | Keeps the larger of the top two numbers. |
a5 | OP_WITHIN | Works | Pushes 1 if x is within [min, max). |
a6 | OP_RIPEMD160 | Works | Replaces the top item with its RIPEMD-160 hash. |
a7 | OP_SHA1 | Works | Replaces the top item with its SHA-1 hash. |
a8 | OP_SHA256 | Works | Replaces the top item with its SHA-256 hash. |
a9 | OP_HASH160 | Works | Replaces the top item with RIPEMD160(SHA256(x)). |
aa | OP_HASH256 | Works | Replaces the top item with SHA256(SHA256(x)). |
ab | OP_CODESEPARATOR | Works | Records its position, which signatures then commit to (BIP-342 codesep_pos). |
ac | OP_CHECKSIG | Tapscript only | Checks a Schnorr signature against a 32-byte x-only key; empty signature pushes false. |
ad | OP_CHECKSIGVERIFY | Tapscript only | OP_CHECKSIG then OP_VERIFY. |
ae | OP_CHECKMULTISIG | Fails if run | Always fails in Pearl (use OP_CHECKSIGADD instead). |
af | OP_CHECKMULTISIGVERIFY | Fails if run | Always fails in Pearl. |
b0 | OP_NOP1 | Fails if run | Reserved for upgrades: fails when executed. |
b1 | OP_CHECKLOCKTIMEVERIFY | Works | Fails unless the transaction locktime has reached the given height/time (BIP-65). |
b2 | OP_CHECKSEQUENCEVERIFY | Works | Fails unless the input has aged by the given relative lock (BIP-112, needs tx version ≥ 2). |
b3 | OP_NOP4 | Fails if run | Reserved for upgrades: fails when executed. |
b4 | OP_NOP5 | Fails if run | Reserved for upgrades: fails when executed. |
b5 | OP_NOP6 | Fails if run | Reserved for upgrades: fails when executed. |
b6 | OP_NOP7 | Fails if run | Reserved for upgrades: fails when executed. |
b7 | OP_NOP8 | Fails if run | Reserved for upgrades: fails when executed. |
b8 | OP_NOP9 | Fails if run | Reserved for upgrades: fails when executed. |
b9 | OP_NOP10 | Fails if run | Reserved for upgrades: fails when executed. |
ba | OP_CHECKSIGADD | Tapscript only | Checks a signature and adds 1 to a counter if it is valid: the building block of k-of-n multisig (BIP-342). |
bb | OP_UNKNOWN187 | Fails if run | Undefined opcode: the script fails if it is executed. |
bc | OP_UNKNOWN188 | Fails if run | Undefined opcode: the script fails if it is executed. |
bd | OP_UNKNOWN189 | Fails if run | Undefined opcode: the script fails if it is executed. |
be | OP_UNKNOWN190 | Fails if run | Undefined opcode: the script fails if it is executed. |
bf | OP_UNKNOWN191 | Fails if run | Undefined opcode: the script fails if it is executed. |
c0 | OP_UNKNOWN192 | Fails if run | Undefined opcode: the script fails if it is executed. |
c1 | OP_UNKNOWN193 | Fails if run | Undefined opcode: the script fails if it is executed. |
c2 | OP_UNKNOWN194 | Fails if run | Undefined opcode: the script fails if it is executed. |
c3 | OP_UNKNOWN195 | Fails if run | Undefined opcode: the script fails if it is executed. |
c4 | OP_UNKNOWN196 | Fails if run | Undefined opcode: the script fails if it is executed. |
c5 | OP_UNKNOWN197 | Fails if run | Undefined opcode: the script fails if it is executed. |
c6 | OP_UNKNOWN198 | Fails if run | Undefined opcode: the script fails if it is executed. |
c7 | OP_UNKNOWN199 | Fails if run | Undefined opcode: the script fails if it is executed. |
c8 | OP_UNKNOWN200 | Fails if run | Undefined opcode: the script fails if it is executed. |
c9 | OP_UNKNOWN201 | Fails if run | Undefined opcode: the script fails if it is executed. |
ca | OP_UNKNOWN202 | Fails if run | Undefined opcode: the script fails if it is executed. |
cb | OP_UNKNOWN203 | Fails if run | Undefined opcode: the script fails if it is executed. |
cc | OP_UNKNOWN204 | Fails if run | Undefined opcode: the script fails if it is executed. |
cd | OP_UNKNOWN205 | Fails if run | Undefined opcode: the script fails if it is executed. |
ce | OP_UNKNOWN206 | Fails if run | Undefined opcode: the script fails if it is executed. |
cf | OP_UNKNOWN207 | Fails if run | Undefined opcode: the script fails if it is executed. |
d0 | OP_UNKNOWN208 | Fails if run | Undefined opcode: the script fails if it is executed. |
d1 | OP_UNKNOWN209 | Fails if run | Undefined opcode: the script fails if it is executed. |
d2 | OP_UNKNOWN210 | Fails if run | Undefined opcode: the script fails if it is executed. |
d3 | OP_UNKNOWN211 | Fails if run | Undefined opcode: the script fails if it is executed. |
d4 | OP_UNKNOWN212 | Fails if run | Undefined opcode: the script fails if it is executed. |
d5 | OP_UNKNOWN213 | Fails if run | Undefined opcode: the script fails if it is executed. |
d6 | OP_UNKNOWN214 | Fails if run | Undefined opcode: the script fails if it is executed. |
d7 | OP_UNKNOWN215 | Fails if run | Undefined opcode: the script fails if it is executed. |
d8 | OP_UNKNOWN216 | Fails if run | Undefined opcode: the script fails if it is executed. |
d9 | OP_UNKNOWN217 | Fails if run | Undefined opcode: the script fails if it is executed. |
da | OP_UNKNOWN218 | Fails if run | Undefined opcode: the script fails if it is executed. |
db | OP_UNKNOWN219 | Fails if run | Undefined opcode: the script fails if it is executed. |
dc | OP_UNKNOWN220 | Fails if run | Undefined opcode: the script fails if it is executed. |
dd | OP_UNKNOWN221 | Fails if run | Undefined opcode: the script fails if it is executed. |
de | OP_CHECKXMSSSIG | Tapscript only | Checks a post-quantum XMSS signature: stack [sig1…sig5 (468 B each), 64-byte pubkey] → [true]; an invalid signature fails the script. |
df | OP_UNKNOWN223 | Fails if run | Undefined opcode: the script fails if it is executed. |
e0 | OP_UNKNOWN224 | Fails if run | Undefined opcode: the script fails if it is executed. |
e1 | OP_UNKNOWN225 | Fails if run | Undefined opcode: the script fails if it is executed. |
e2 | OP_UNKNOWN226 | Fails if run | Undefined opcode: the script fails if it is executed. |
e3 | OP_UNKNOWN227 | Fails if run | Undefined opcode: the script fails if it is executed. |
e4 | OP_UNKNOWN228 | Fails if run | Undefined opcode: the script fails if it is executed. |
e5 | OP_UNKNOWN229 | Fails if run | Undefined opcode: the script fails if it is executed. |
e6 | OP_UNKNOWN230 | Fails if run | Undefined opcode: the script fails if it is executed. |
e7 | OP_UNKNOWN231 | Fails if run | Undefined opcode: the script fails if it is executed. |
e8 | OP_UNKNOWN232 | Fails if run | Undefined opcode: the script fails if it is executed. |
e9 | OP_UNKNOWN233 | Fails if run | Undefined opcode: the script fails if it is executed. |
ea | OP_UNKNOWN234 | Fails if run | Undefined opcode: the script fails if it is executed. |
eb | OP_UNKNOWN235 | Fails if run | Undefined opcode: the script fails if it is executed. |
ec | OP_UNKNOWN236 | Fails if run | Undefined opcode: the script fails if it is executed. |
ed | OP_UNKNOWN237 | Fails if run | Undefined opcode: the script fails if it is executed. |
ee | OP_UNKNOWN238 | Fails if run | Undefined opcode: the script fails if it is executed. |
ef | OP_UNKNOWN239 | Fails if run | Undefined opcode: the script fails if it is executed. |
f0 | OP_UNKNOWN240 | Fails if run | Undefined opcode: the script fails if it is executed. |
f1 | OP_UNKNOWN241 | Fails if run | Undefined opcode: the script fails if it is executed. |
f2 | OP_UNKNOWN242 | Fails if run | Undefined opcode: the script fails if it is executed. |
f3 | OP_UNKNOWN243 | Fails if run | Undefined opcode: the script fails if it is executed. |
f4 | OP_UNKNOWN244 | Fails if run | Undefined opcode: the script fails if it is executed. |
f5 | OP_UNKNOWN245 | Fails if run | Undefined opcode: the script fails if it is executed. |
f6 | OP_UNKNOWN246 | Fails if run | Undefined opcode: the script fails if it is executed. |
f7 | OP_UNKNOWN247 | Fails if run | Undefined opcode: the script fails if it is executed. |
f8 | OP_UNKNOWN248 | Fails if run | Undefined opcode: the script fails if it is executed. |
f9 | OP_UNKNOWN249 | Fails if run | Undefined opcode: the script fails if it is executed. |
fa | OP_SMALLINTEGER | Fails if run | Internal template name, not a real opcode: fails when executed. |
fb | OP_PUBKEYS | Fails if run | Internal template name, not a real opcode: fails when executed. |
fc | OP_UNKNOWN252 | Fails if run | Undefined opcode: the script fails if it is executed. |
fd | OP_PUBKEYHASH | Fails if run | Internal template name, not a real opcode: fails when executed. |
fe | OP_PUBKEY | Fails if run | Internal template name, not a real opcode: fails when executed. |
ff | OP_INVALIDOPCODE | Fails if run | Invalid opcode: fails when executed. |