OP_SWAP

(124 | 0x7c)

Input

2 items

|

Output

2 items

OP_SWAP is a straightforward stack manipulation opcode that swaps the positions of the top two items on the stack. This operation is integral in scripts where the order of items needs to be altered for proper execution of subsequent operations, such as in complex scripts that perform multiple operations on a series of stack items.

OP_Code Walkthrough

Swaps the top two stack items.

Pop Top Item 1

Pop Top Item 2

Push Item 2

Push Item 1