Opposite to OP_LESSTHAN, OP_GREATERTHAN checks if the second-to-top item on the stack is greater than the top item. It pushes 1 (true) if this is the case, and 0 (false) otherwise. This opcode is essential in scripts that involve greater-than comparisons.
OP_Code Walkthrough
Returns 0x01 if item-1 is greater than item-2, 0x00 otherwise
Pop Top Item a
Pop Top Item b
Check if b is greater than a
Push Result