OP_2SWAP

(114 | 0x72)

Input

4 items

|

Output

4 items

OP_2SWAP is a stack manipulation opcode that swaps the positions of the top two pairs of items on the stack. This operation is useful when rearranging stack items is necessary for proper execution of subsequent operations, particularly in complex scripts.

OP_Code Walkthrough

Swaps the positions of the top two pairs of items on the stack.

Pop Top 2 Pairs of Items

Pop Top 2 Pairs of Items

Push First Popped 2 Pairs

Push Second Popped 2 Pairs