Module sv::script::op_codes[][src]

Expand description

Script commands

Constants

Pushes 0 onto the stack

Returns 0 if the input is 0. 1 otherwise.

Pushes 1 onto the stack

Adds 1 to the input

Pushes -1 onto the stack

Subtracts 1 from the input

Pushes 2 onto the stack

Removes the top two items from the stack

Duplicates the top two stack items

Copies the pair of items two spaces back to the front

The fifth and sixth items back are moved to the top of the stack

Swaps the top two pairs of items

Pushes 3 onto the stack

Duplicates the top three stack items

Pushes 4 onto the stack

Pushes 5 onto the stack

Pushes 6 onto the stack

Pushes 7 onto the stack

Pushes 8 onto the stack

Pushes 9 onto the stack

Pushes 10 onto the stack

Pushes 11 onto the stack

Pushes 12 onto the stack

Pushes 13 onto the stack

Pushes 14 onto the stack

Pushes 15 onto the stack

Pushes 16 onto the stack

The input is made positive

Adds a to b

Boolean and between each bit in the inputs

Converts byte sequence x into a numeric value

If both a and b are not empty, the output is 1. Otherwise, 0.

If a or b is not empty, the output is 1. Otherwise, 0.

Concatenates two byte sequences

Marks transaction as invalid if the top stack item is greater than the transaction’s lock_time

Puts 1 on the stack if m of n signatures authorize the public key and transaction hash. Otherwise 0.

Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward

Marks transaction as invalid if the top stack item is less than the transaction’s sequence used for relative lock time

Puts 1 on the stack if the signature authorizes the public key and transaction hash. Otherwise 0.

Same as OP_CHECKSIG, but OP_VERIFY is executed afterward

Marks the part of the script after which the signature will begin matching

Puts the number of stack items onto the stack

Divides a by b

Drops the top stack value

Duplicates the top stack item

If the preceding OP_IF or OP_NOTIF statemetns were not executed, then statements are executed.

Ends an if-else block

Returns 1 if the inputs are exactly equal, 0 otherwise

Same as OP_EQUAL, but runs OP_VERIFY afterward

Pushes 0 onto the stack

Moves the top item on the alt stack to the main stack

Returns 1 if a is greater than b. Otherwise, 0.

Returns 1 if a is greater than or equal to b. Otherwise, 0.

The input is hashed twice: first with SHA-256 and then with RIPEMD-160

The input is hashed two times with SHA-256

If the top stack is true, statements are executed. Top stack value is removed.

Duplicates the top stack value if it is not zero

Returns 1 if a is less than b. Otherwise, 0.

Returns 1 if a is less than or equal to b. Otherwise, 0.

Returns the larger of a and b

Returns the smaller of a and b

Returns the remainder after dividing a by b

The sign of the input is flipped

Removes the second-to-top stack item

Does nothing

If the input is 0 or 1, it is flipped. Otherwise, the output will be 0.

If the top stack is false, statements are executed. Top stack value is removed.

Converts numeric value a into a byte sequence of length b

Returns 1 if the numbers are equal. Otherwise, 0.

Same as OP_NUMEQUAL, but runs OP_VERIFY afterward

Returns 1 if the numbers are not equal. Otherwise, 0.

Boolean or between each bit in the inputs

Copies the second-to-top stack item to the top

The item n back in the stack is copied to the top

Offset by n to push n bytes onto the stack, where n: [1-75]

The next byte sets the number of bytes to push onto the stack

The next two bytes sets the number of bytes to push onto the stack

The next four bytes sets the number of bytes to push onto the stack

Marks a statements as invalid

The input is hashed using RIPEMD-160

The item n back in the stack is moved to the top

The top three items on the stack are rotated to the left

The input is hashed using SHA-1

The input is hashed using SHA-256

Pushes the byte sequence length of the top stack item without popping it

Splits the byte sequence at position n

Subtracts b from a

The top two items on the stack are swapped

Moves the top item on the main stack to the alt stack

Pushes 1 onto the stack

The item at the top of the stack is copied and inserted before the second-to-top item

Marks a statement as invalid if the top stack value is false. Top stack value is removed.

Returns 1 if x is within the specified range, left inclusive. Otherwise, 0.

Boolean exclusive or between each bit in the inputs