OP_SUB

(148 | 0x94)

Input

2 items

|

Output

1 items

OP_SUB performs a subtraction operation between the top two items on the stack. It pops these two items, subtracts the top item from the second-to-top item, and pushes the result back onto the stack. This opcode is essential in scripts that involve arithmetic calculations, particularly where differences between values are required.

OP_Code Walkthrough

Subtracts the second item from the top item of the stack

Pop Top Item a

Pop Top Item b

Subtract a from b

Push Result