What does the proposed OP_CAT opcode do? What is the history of the OP_CAT opcode?
1 Answer
OP_CAT was opcode 0x7e
in the original Bitcoin release’s version of Script. It was disabled in 2010 along with a number of opcodes when a series of bugs in other opcodes was discovered. Prior to it being disabled, the resulting stack item was limited and that limit then lowered further.
OP_CAT pops the top two values off the stack, concatenates the popped values in stack order, and then pushes the result to the top of the stack. BIP 347 proposes that OP_CAT is added to Tapscript as 0x7e
, redefining OP_SUCCESS126
. This would enable use of OP_CAT in P2TR version 0xc0
leafscripts. BIP 347 includes the later lowest limit on the resulting stack size item (520 bytes).