OP_ROT is a stack manipulation opcode that rotates the order of the top three items on the stack. It removes the top three items, then pushes the third item back onto the stack, followed by the first item, and finally the second item. This operation effectively moves the second-to-top item to the top of the stack, while shifting the other two items down. OP_ROT is commonly used in Bitcoin scripts for rearranging data on the stack or shuffling the order of items before performing further operations.
OP_Code Walkthrough
Rotates the top three items on the stack.
Pop items from the stack
Rotate the top 3 items in the stack
Push Items back to stack