Expand description
Script commands
Constants§
- OP_0
- Pushes 0 onto the stack
- OP_
0NOTEQUAL - Returns 0 if the input is 0. 1 otherwise.
- OP_1
- Pushes 1 onto the stack
- OP_2
- Pushes 2 onto the stack
- OP_3
- Pushes 3 onto the stack
- OP_4
- Pushes 4 onto the stack
- OP_5
- Pushes 5 onto the stack
- OP_6
- Pushes 6 onto the stack
- OP_7
- Pushes 7 onto the stack
- OP_8
- Pushes 8 onto the stack
- OP_9
- Pushes 9 onto the stack
- OP_1ADD
- Adds 1 to the input
- OP_
1NEGATE - Pushes -1 onto the stack
- OP_1SUB
- Subtracts 1 from the input
- OP_
2DROP - Removes the top two items from the stack
- OP_2DUP
- Duplicates the top two stack items
- OP_
2OVER - Copies the pair of items two spaces back to the front
- OP_2ROT
- The fifth and sixth items back are moved to the top of the stack
- OP_
2SWAP - Swaps the top two pairs of items
- OP_3DUP
- Duplicates the top three stack items
- OP_10
- Pushes 10 onto the stack
- OP_11
- Pushes 11 onto the stack
- OP_12
- Pushes 12 onto the stack
- OP_13
- Pushes 13 onto the stack
- OP_14
- Pushes 14 onto the stack
- OP_15
- Pushes 15 onto the stack
- OP_16
- Pushes 16 onto the stack
- OP_ABS
- The input is made positive
- OP_ADD
- Adds a to b
- OP_AND
- Boolean and between each bit in the inputs
- OP_
BIN2NUM - Converts byte sequence x into a numeric value
- OP_
BOOLAND - If both a and b are not empty, the output is 1. Otherwise, 0.
- OP_
BOOLOR - If a or b is not empty, the output is 1. Otherwise, 0.
- OP_CAT
- Concatenates two byte sequences
- OP_
CHECKLOCKTIMEVERIFY - Marks transaction as invalid if the top stack item is greater than the transaction’s lock_time
- OP_
CHECKMULTISIG - Puts 1 on the stack if m of n signatures authorize the public key and transaction hash. Otherwise 0.
- OP_
CHECKMULTISIGVERIFY - Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward
- OP_
CHECKSEQUENCEVERIFY - Marks transaction as invalid if the top stack item is less than the transaction’s sequence used for relative lock time
- OP_
CHECKSIG - Puts 1 on the stack if the signature authorizes the public key and transaction hash. Otherwise 0.
- OP_
CHECKSIGVERIFY - Same as OP_CHECKSIG, but OP_VERIFY is executed afterward
- OP_
CODESEPARATOR - Marks the part of the script after which the signature will begin matching
- OP_
DEPTH - Puts the number of stack items onto the stack
- OP_DIV
- Divides a by b
- OP_DROP
- Drops the top stack value
- OP_DUP
- Duplicates the top stack item
- OP_ELSE
- If the preceding OP_IF or OP_NOTIF statemetns were not executed, then statements are executed.
- OP_
ENDIF - Ends an if-else block
- OP_
EQUAL - Returns 1 if the inputs are exactly equal, 0 otherwise
- OP_
EQUALVERIFY - Same as OP_EQUAL, but runs OP_VERIFY afterward
- OP_
FALSE - Pushes 0 onto the stack
- OP_
FROMALTSTACK - Moves the top item on the alt stack to the main stack
- OP_
GREATERTHAN - Returns 1 if a is greater than b. Otherwise, 0.
- OP_
GREATERTHANOREQUAL - Returns 1 if a is greater than or equal to b. Otherwise, 0.
- OP_
HASH160 - The input is hashed twice: first with SHA-256 and then with RIPEMD-160
- OP_
HASH256 - The input is hashed two times with SHA-256
- OP_IF
- If the top stack is true, statements are executed. Top stack value is removed.
- OP_
IFDUP - Duplicates the top stack value if it is not zero
- OP_
LESSTHAN - Returns 1 if a is less than b. Otherwise, 0.
- OP_
LESSTHANOREQUAL - Returns 1 if a is less than or equal to b. Otherwise, 0.
- OP_MAX
- Returns the larger of a and b
- OP_MIN
- Returns the smaller of a and b
- OP_MOD
- Returns the remainder after dividing a by b
- OP_
NEGATE - The sign of the input is flipped
- OP_NIP
- Removes the second-to-top stack item
- OP_NOP
- Does nothing
- OP_NOT
- If the input is 0 or 1, it is flipped. Otherwise, the output will be 0.
- OP_
NOTIF - If the top stack is false, statements are executed. Top stack value is removed.
- OP_
NUM2BIN - Converts numeric value a into a byte sequence of length b
- OP_
NUMEQUAL - Returns 1 if the numbers are equal. Otherwise, 0.
- OP_
NUMEQUALVERIFY - Same as OP_NUMEQUAL, but runs OP_VERIFY afterward
- OP_
NUMNOTEQUAL - Returns 1 if the numbers are not equal. Otherwise, 0.
- OP_OR
- Boolean or between each bit in the inputs
- OP_OVER
- Copies the second-to-top stack item to the top
- OP_PICK
- The item n back in the stack is copied to the top
- OP_PUSH
- Offset by n to push n bytes onto the stack, where n: [1-75]
- OP_
PUSHDAT A1 - The next byte sets the number of bytes to push onto the stack
- OP_
PUSHDAT A2 - The next two bytes sets the number of bytes to push onto the stack
- OP_
PUSHDAT A4 - The next four bytes sets the number of bytes to push onto the stack
- OP_
RETURN - Marks a statements as invalid
- OP_
RIPEM D160 - The input is hashed using RIPEMD-160
- OP_ROLL
- The item n back in the stack is moved to the top
- OP_ROT
- The top three items on the stack are rotated to the left
- OP_SHA1
- The input is hashed using SHA-1
- OP_
SHA256 - The input is hashed using SHA-256
- OP_SIZE
- Pushes the byte sequence length of the top stack item without popping it
- OP_
SPLIT - Splits the byte sequence at position n
- OP_SUB
- Subtracts b from a
- OP_SWAP
- The top two items on the stack are swapped
- OP_
TOALTSTACK - Moves the top item on the main stack to the alt stack
- OP_TRUE
- Pushes 1 onto the stack
- OP_TUCK
- The item at the top of the stack is copied and inserted before the second-to-top item
- OP_
VERIFY - Marks a statement as invalid if the top stack value is false. Top stack value is removed.
- OP_
WITHIN - Returns 1 if x is within the specified range, left inclusive. Otherwise, 0.
- OP_XOR
- Boolean exclusive or between each bit in the inputs