OP_CAT co-author Ethan Heilman gives a rundown of the proposed reactivation of the Satoshi-era opcode.
- On a basic level, OP_CAT adds the top two elements of a stack for a transaction.
- OP_CAT is short for “concatenate,” because it concatenates (combines) two values on a stack
- OP_CAT was included in Bitcoin originally, but it was removed in August 2010 along with 14 other opcodes
- We don’t actually know why OP_CAT was disabled, Heilman says.
- To bring back OP_CAT: 1) it would only be activated in Tapscript; 2) activation would use OP_SUCCESS for a softfork; 3) same opcode as the original
- OP_CAT code has been assigned BIP 347 and the code is ready, but there’s currently no clear consensus for activation
- OP_CAT would enable: vaults, general computation, certain types of covenants
- Stack elements are currently siloed in Bitcoin Script, meaning that they can’t influence each other. OP_CAT changes this
- “CAT isn’t special”: many opcodes could deliver similar functionality, but CAT is the most simple, Heilman says
- There are generally two perspectives on opcodes: 1) they should be monolithic, or 2) new opcodes should be simple and modular
- We can do covenants today, but the methods are generally expensive (or VERY expensive in the case of ColliderScript)
- CAT_based covenants are large and hard to write
- Will we only get a chance at one covenant opcodes? Heilman thinks so, but CAT is not a dedicated covenant opcode
- While CAT can technically achieve covenants, “CAT is not a reason not to do a covenant opcode,” Heilman said, adding that he would like to see CTV activated as well