Script opcodes
Synopsis
Declared in <script/script.h>
enum opcodetype;
Members
Name |
Description |
|
Pushes an empty byte array (numeric zero / false) onto the stack. |
|
Alias for OP_0. |
|
Pushes the next byte's count of bytes onto the stack. |
|
Pushes the next two bytes' count of bytes onto the stack. |
|
Pushes the next four bytes' count of bytes onto the stack. |
|
Pushes the number ‐1 onto the stack. |
|
Reserved opcode; makes the transaction invalid if executed. |
|
Pushes the number 1 onto the stack. |
|
Alias for OP_1. |
|
Pushes the number 2 onto the stack. |
|
Pushes the number 3 onto the stack. |
|
Pushes the number 4 onto the stack. |
|
Pushes the number 5 onto the stack. |
|
Pushes the number 6 onto the stack. |
|
Pushes the number 7 onto the stack. |
|
Pushes the number 8 onto the stack. |
|
Pushes the number 9 onto the stack. |
|
Pushes the number 10 onto the stack. |
|
Pushes the number 11 onto the stack. |
|
Pushes the number 12 onto the stack. |
|
Pushes the number 13 onto the stack. |
|
Pushes the number 14 onto the stack. |
|
Pushes the number 15 onto the stack. |
|
Pushes the number 16 onto the stack. |
|
Does nothing. |
|
Reserved opcode; makes the transaction invalid if executed. |
|
Executes the following block if the top stack value is true. |
|
Executes the following block if the top stack value is false. |
|
Reserved opcode; makes the transaction invalid even when unexecuted. |
|
Reserved opcode; makes the transaction invalid even when unexecuted. |
|
Executes the following block if the preceding OP_IF/OP_NOTIF block was not. |
|
Ends an OP_IF/OP_NOTIF/OP_ELSE block. |
|
Marks the transaction invalid if the top stack value is not true. |
|
Marks the transaction invalid and the output provably unspendable. |
|
Moves the top item from the main stack to the alt stack. |
|
Moves the top item from the alt stack to the main stack. |
|
Removes the top two stack items. |
|
Duplicates the top two stack items. |
|
Duplicates the top three stack items. |
|
Copies the pair of items two spaces back to the top. |
|
Moves the fifth and sixth items to the top of the stack. |
|
Swaps the top two pairs of items. |
|
Duplicates the top item if it is not zero. |
|
Pushes the number of stack items onto the stack. |
|
Removes the top stack item. |
|
Duplicates the top stack item. |
|
Removes the second‐to‐top stack item. |
|
Copies the second‐to‐top item to the top of the stack. |
|
Copies the item n back in the stack to the top. |
|
Moves the item n back in the stack to the top. |
|
Rotates the top three items to the left. |
|
Swaps the top two stack items. |
|
Copies the top item and inserts it below the second item. |
|
Disabled opcode; would concatenate two byte strings. |
|
Disabled opcode; would return a substring of a byte string. |
|
Disabled opcode; would return the left part of a byte string. |
|
Disabled opcode; would return the right part of a byte string. |
|
Pushes the byte length of the top stack item. |
|
Disabled opcode; would flip all bits of the top item. |
|
Disabled opcode; would compute the bitwise AND of two items. |
|
Disabled opcode; would compute the bitwise OR of two items. |
|
Disabled opcode; would compute the bitwise XOR of two items. |
|
Pushes true if the top two items are equal, otherwise false. |
|
Runs OP_EQUAL then OP_VERIFY. |
|
Reserved opcode; makes the transaction invalid if executed. |
|
Reserved opcode; makes the transaction invalid if executed. |
|
Adds 1 to the top item. |
|
Subtracts 1 from the top item. |
|
Disabled opcode; would multiply the top item by 2. |
|
Disabled opcode; would divide the top item by 2. |
|
Negates the sign of the top item. |
|
Replaces the top item with its absolute value. |
|
Pushes 1 if the top item is 0, otherwise 0. |
|
Pushes 0 if the top item is 0, otherwise 1. |
|
Adds the top two items. |
|
Subtracts the top item from the second item. |
|
Disabled opcode; would multiply the top two items. |
|
Disabled opcode; would divide the second item by the top item. |
|
Disabled opcode; would compute the remainder of a division. |
|
Disabled opcode; would shift the second item left. |
|
Disabled opcode; would shift the second item right. |
|
Pushes true if both of the top two items are nonzero. |
|
Pushes true if either of the top two items is nonzero. |
|
Pushes true if the top two numbers are equal. |
|
Runs OP_NUMEQUAL then OP_VERIFY. |
|
Pushes true if the top two numbers are not equal. |
|
Pushes true if the second number is less than the top number. |
|
Pushes true if the second number is greater than the top number. |
|
Pushes true if the second number is less than or equal to the top. |
|
Pushes true if the second number is greater than or equal to the top. |
|
Pushes the smaller of the top two numbers. |
|
Pushes the larger of the top two numbers. |
|
Pushes true if the third number is within the range [second, top).] |
|
Hashes the top item with RIPEMD‐160. |
|
Hashes the top item with SHA‐1. |
|
Hashes the top item with SHA‐256. |
|
Hashes the top item with SHA‐256 then RIPEMD‐160. |
|
Hashes the top item with SHA‐256 twice. |
|
Marks the point from which the script is signed. |
|
Verifies a signature against a public key and pushes the result. |
|
Runs OP_CHECKSIG then OP_VERIFY. |
|
Verifies m signatures against n public keys. |
|
Runs OP_CHECKMULTISIG then OP_VERIFY. |
|
Reserved no‐op opcode for future upgrades. |
|
Marks the transaction invalid if the top item is greater than nLockTime (BIP 65). |
|
Former no‐op, now OP_CHECKLOCKTIMEVERIFY. |
|
Marks the transaction invalid if the top item is greater than the input sequence (BIP 112). |
|
Former no‐op, now OP_CHECKSEQUENCEVERIFY. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Reserved no‐op opcode for future upgrades. |
|
Adds a signature check result to an accumulator (Tapscript, BIP 342). |
|
Represents an invalid or unknown opcode. |
Non-Member Functions
Name |
Description |
Returns the mnemonic name of an opcode. |
|
Test for OP_SUCCESSx opcodes as defined by BIP342. |
|
Test whether an opcode is a data‐push operation. |
Created with MrDocs