OP_0 |
0 |
0x00 |
push value |
An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.) |
OP_FALSE |
0 |
0x00 |
push value |
OP_0 |
|
1-75 |
0x01-0x4b |
push value |
The next opcode bytes is data to be pushed onto the stack |
OP_PUSHDATA1 |
76 |
0x4c |
push value |
The next byte contains the number of bytes to be pushed onto the stack. |
OP_PUSHDATA2 |
77 |
0x4d |
push value |
The next two bytes contain the number of bytes to be pushed onto the stack in little endian order. |
OP_PUSHDATA4 |
78 |
0x4e |
push value |
The next four bytes contain the number of bytes to be pushed onto the stack in little endian order. |
OP_1NEGATE |
79 |
0x4f |
push value |
The number -1 is pushed onto the stack. |
OP_RESERVED |
80 |
0x50 |
push value |
Transaction is invalid unless occuring in an unexecuted OP_IF branch |
OP_1 |
81 |
0x51 |
push value |
The number 1 is pushed onto the stack. |
OP_TRUE |
81 |
0x51 |
push value |
(OP_1) The number 1 is pushed onto the stack. |
OP_2 |
82 |
0x52 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_3 |
83 |
0x53 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_4 |
84 |
0x54 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_5 |
85 |
0x55 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_6 |
86 |
0x56 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_7 |
87 |
0x57 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_8 |
88 |
0x58 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_9 |
89 |
0x59 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_10 |
90 |
0x5a |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_11 |
91 |
0x5b |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_12 |
92 |
0x5c |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_13 |
93 |
0x5d |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_14 |
94 |
0x5e |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_15 |
95 |
0x5f |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_16 |
96 |
0x60 |
push value |
The number in the word name (2-16) is pushed onto the stack. |
OP_NOP |
97 |
0x61 |
control |
Does nothing. |
OP_VER |
98 |
0x62 |
control |
Transaction is invalid unless occuring in an unexecuted OP_IF branch. |
OP_IF |
99 |
0x63 |
control |
If the top stack value is not False, the statements are executed. The top stack value is removed. |
OP_NOTIF |
100 |
0x64 |
control |
If the top stack value is False, the statements are executed. The top stack value is removed. |
OP_VERIF |
101 |
0x65 |
control |
Transaction is invalid even when occuring in an unexecuted OP_IF branch. |
OP_VERNOTIF |
102 |
0x66 |
control |
Transaction is invalid even when occuring in an unexecuted OP_IF branch. |
OP_ELSE |
103 |
0x67 |
control |
If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not. |
OP_ENDIF |
104 |
0x68 |
control |
Ends an if/else block. All blocks must end, or the transaction is invalid. An OP_ENDIF without OP_IF earlier is also invalid. |
OP_VERIFY |
105 |
0x69 |
control |
Marks transaction as invalid if top stack value is not true. The top stack value is removed. |
OP_RETURN |
106 |
0x6a |
control |
Marks transaction as invalid. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since 0.12, standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED[1]) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes. |
OP_TOALTSTACK |
107 |
0x6b |
stack ops |
Puts the input onto the top of the alt stack. Removes it from the main stack. |
OP_FROMALTSTACK |
108 |
0x6c |
stack ops |
Puts the input onto the top of the main stack. Removes it from the alt stack. |
OP_2DROP |
109 |
0x6d |
stack ops |
Removes the top two stack items. |
OP_2DUP |
110 |
0x6e |
stack ops |
Duplicates the top two stack items. |
OP_3DUP |
111 |
0x6f |
stack ops |
Duplicates the top three stack items. |
OP_2OVER |
112 |
0x70 |
stack ops |
Copies the pair of items two spaces back in the stack to the front. |
OP_2ROT |
113 |
0x71 |
stack ops |
The fifth and sixth items back are moved to the top of the stack. |
OP_2SWAP |
114 |
0x72 |
stack ops |
Swaps the top two pairs of items. |
OP_IFDUP |
115 |
0x73 |
stack ops |
If the top stack value is not 0, duplicate it. |
OP_DEPTH |
116 |
0x74 |
stack ops |
Puts the number of stack items onto the stack. |
OP_DROP |
117 |
0x75 |
stack ops |
Removes the top stack item. |
OP_DUP |
118 |
0x76 |
stack ops |
Duplicates the top stack item. |
OP_NIP |
119 |
0x77 |
stack ops |
Removes the second-to-top stack item. |
OP_OVER |
120 |
0x78 |
stack ops |
Copies the second-to-top stack item to the top. |
OP_PICK |
121 |
0x79 |
stack ops |
The item n back in the stack is copied to the top. |
OP_ROLL |
122 |
0x7a |
stack ops |
The item n back in the stack is moved to the top. |
OP_ROT |
123 |
0x7b |
stack ops |
The 3rd item down the stack is moved to the top. |
OP_SWAP |
124 |
0x7c |
stack ops |
The top two items on the stack are swapped. |
OP_TUCK |
125 |
0x7d |
stack ops |
The item at the top of the stack is copied and inserted before the second-to-top item. |
OP_CAT |
126 |
0x7e |
splice ops |
Concatenates two strings. disabled. |
OP_SUBSTR |
127 |
0x7f |
splice ops |
Returns a section of a string. disabled. |
OP_LEFT |
128 |
0x80 |
splice ops |
Keeps only characters left of the specified point in a string. disabled. |
OP_RIGHT |
129 |
0x81 |
splice ops |
Keeps only characters right of the specified point in a string. disabled. |
OP_SIZE |
130 |
0x82 |
splice ops |
Pushes the string length of the top element of the stack (without popping it). |
OP_INVERT |
131 |
0x83 |
bit logic |
Flips all of the bits in the input. disabled. |
OP_AND |
132 |
0x84 |
bit logic |
Boolean and between each bit in the inputs. disabled. |
OP_OR |
133 |
0x85 |
bit logic |
Boolean or between each bit in the inputs. disabled. |
OP_XOR |
134 |
0x86 |
bit logic |
Boolean exclusive or between each bit in the inputs. disabled. |
OP_EQUAL |
135 |
0x87 |
bit logic |
Returns 1 if the inputs are exactly equal, 0 otherwise. |
OP_EQUALVERIFY |
136 |
0x88 |
bit logic |
Same as OP_EQUAL, but runs OP_VERIFY afterward. |
OP_RESERVED1 |
137 |
0x89 |
bit logic |
Transaction is invalid unless occuring in an unexecuted OP_IF branch. |
OP_RESERVED2 |
138 |
0x8a |
bit logic |
Transaction is invalid unless occuring in an unexecuted OP_IF branch. |
OP_1ADD |
139 |
0x8b |
arithmetic |
1 is added to the input. |
OP_1SUB |
140 |
0x8c |
arithmetic |
1 is subtracted from the input. |
OP_2MUL |
141 |
0x8d |
arithmetic |
The input is multiplied by 2. disabled. |
OP_2DIV |
142 |
0x8e |
arithmetic |
The input is divided by 2. disabled. |
OP_NEGATE |
143 |
0x8f |
arithmetic |
The sign of the input is flipped. |
OP_ABS |
144 |
0x90 |
arithmetic |
The input is made positive. |
OP_NOT |
145 |
0x91 |
arithmetic |
If the input is 0 or 1, it is flipped. Otherwise the output will be 0. |
OP_0NOTEQUAL |
146 |
0x92 |
arithmetic |
Returns 0 if the input is 0. 1 otherwise. |
OP_ADD |
147 |
0x93 |
arithmetic |
a is added to b. |
OP_SUB |
148 |
0x94 |
arithmetic |
b is subtracted from a. |
OP_MUL |
149 |
0x95 |
arithmetic |
a is multiplied by b. disabled. |
OP_DIV |
150 |
0x96 |
arithmetic |
a is divided by b. disabled. |
OP_MOD |
151 |
0x97 |
arithmetic |
Returns the remainder after dividing a by b. disabled. |
OP_LSHIFT |
152 |
0x98 |
arithmetic |
Shifts a left b bits, preserving sign. disabled. |
OP_RSHIFT |
153 |
0x99 |
arithmetic |
Shifts a right b bits, preserving sign. disabled. |
OP_BOOLAND |
154 |
0x9a |
arithmetic |
If both a and b are not 0, the output is 1. Otherwise 0. |
OP_BOOLOR |
155 |
0x9b |
arithmetic |
If a or b is not 0, the output is 1. Otherwise 0. |
OP_NUMEQUAL |
156 |
0x9c |
arithmetic |
Returns 1 if the numbers are equal, 0 otherwise. |
OP_NUMEQUALVERIFY |
157 |
0x9d |
arithmetic |
Same as OP_NUMEQUAL, but runs OP_VERIFY afterward. |
OP_NUMNOTEQUAL |
158 |
0x9e |
arithmetic |
Returns 1 if the numbers are not equal, 0 otherwise. |
OP_LESSTHAN |
159 |
0x9f |
arithmetic |
Returns 1 if a is less than b, 0 otherwise. |
OP_GREATERTHAN |
160 |
0xa0 |
arithmetic |
Returns 1 if a is greater than b, 0 otherwise. |
OP_LESSTHANOREQUAL |
161 |
0xa1 |
arithmetic |
Returns 1 if a is less than or equal to b, 0 otherwise. |
OP_GREATERTHANOREQUAL |
162 |
0xa2 |
arithmetic |
Returns 1 if a is greater than or equal to b, 0 otherwise. |
OP_MIN |
163 |
0xa3 |
arithmetic |
Returns the smaller of a and b. |
OP_MAX |
164 |
0xa4 |
arithmetic |
Returns the larger of a and b. |
OP_WITHIN |
165 |
0xa5 |
arithmetic |
Returns 1 if x is within the specified range (left-inclusive), 0 otherwise. |
OP_RIPEMD160 |
166 |
0xa6 |
crypto |
The input is hashed using RIPEMD-160. |
OP_SHA1 |
167 |
0xa7 |
crypto |
The input is hashed using SHA-1. |
OP_SHA256 |
168 |
0xa8 |
crypto |
The input is hashed using SHA-256. |
OP_HASH160 |
169 |
0xa9 |
crypto |
The input is hashed twice: first with SHA-256 and then with RIPEMD-160. |
OP_HASH256 |
170 |
0xaa |
crypto |
The input is hashed two times with SHA-256. |
OP_CODESEPARATOR |
171 |
0xab |
crypto |
All of the signature checking words will only match signatures to the data after the most recently-executed OP_CODESEPARATOR. |
OP_CHECKSIG |
172 |
0xac |
crypto |
The entire transaction's outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise. |
OP_CHECKSIGVERIFY |
173 |
0xad |
crypto |
Same as OP_CHECKSIG, but OP_VERIFY is executed afterward. |
OP_CHECKMULTISIG |
174 |
0xae |
crypto |
Compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result. All signatures need to match a public key. Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the scriptSig using the same order as their corresponding public keys were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack. |
OP_CHECKMULTISIGVERIFY |
175 |
0xaf |
crypto |
Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward. |
OP_NOP1 |
176 |
0xb0 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_CHECKLOCKTIMEVERIFY |
177 |
0xb1 |
expansion |
Marks transaction as invalid if the top stack item is greater than the transaction's nLockTime field, otherwise script evaluation continues as though an OP_NOP was executed. Transaction is also invalid if 1. the stack is empty; or 2. the top stack item is negative; or 3. the top stack item is greater than or equal to 500000000 while the transaction's nLockTime field is less than 500000000, or vice versa; or 4. the input's nSequence field is equal to 0xffffffff. The precise semantics are described in BIP 0065. |
OP_NOP2 |
177 |
0xb1 |
expansion |
OP_CHECKLOCKTIMEVERIFY. |
OP_CHECKSEQUENCEVERIFY |
178 |
0xb2 |
expansion |
Marks transaction as invalid if the relative lock time of the input (enforced by BIP 0068 with nSequence) is not equal to or longer than the value of the top stack item. The precise semantics are described in BIP 0112. |
OP_NOP3 |
178 |
0xb2 |
expansion |
OP_CHECKSEQUENCEVERIFY alias |
OP_NOP4 |
179 |
0xb3 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP5 |
180 |
0xb4 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP6 |
181 |
0xb5 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP7 |
182 |
0xb6 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP8 |
183 |
0xb7 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP9 |
184 |
0xb8 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_NOP10 |
185 |
0xb9 |
expansion |
The word is ignored. Does not mark transaction as invalid. |
OP_CHECKSIGADD |
186 |
0xba |
|
Opcode added by BIP342 (Tapscript) |
OP_INVALIDOPCODE |
255 |
0xff |
invalid opcode |
|