Author: 0xShinChann, Crypto KOL; Translation: 0xjs@黄金财经
OP_CAT was once an opcode removed from the BTC script language by Satoshi Nakamoto, but now it has once again become the center of community discussion (Note: OP_CAT was the most discussed by Bitcoin developers during the Bitcoin Asia conference).
As a potential upgrade, it has received the initial formal designation Bitcoin Improvement Proposal (BIP) 347.
OP_CAT is an initiative to improve the functionality of Bitcoin smart contracts (similar to Ethereum). This article explains in detail what OP_CAT is, how it works, what use cases it has, and what controversies the community has.
1. Some background: How OP_CAT came about
OP_CAT is an early opcode in Bitcoin. It was originally created by Bitcoin founder Satoshi Nakamoto as a programming shortcut. But it was removed in 2010 due to concerns about high memory usage + potential security vulnerabilities.
In October 2023, Bitcoin researchers Ethan Heilman and Armin Sabouri proposed a Bitcoin Improvement Proposal (BIP) to reintroduce the OP_CAT opcode into the Bitcoin Script language.
This opcode will allow developers to build and evaluate Merkle trees and other hash data structures in Tapscript, the native scripting language used to enable new transaction types in the Taproot upgrade.
2. How does OP_CAT theoretically work?
(i) Popping Values: First remove the top two items from the stack.
(ii) Concatenate: The two items are then combined. If x1 and x2 are items and x2 is the last item added, OP_CAT will concatenate them to form x1x2.
(iii) Push back: The newly combined item is then put back on the top of the stack.
However, OP_CAT will not work if there are less than two items on the stack, or if the size of the combined items exceeds 520 bytes (which is the limit for script elements in Bitcoin). If enabled via a soft fork, it will replace existing unused operations in the script, making it active without major changes to the network.
3. Why is OP_CAT needed? What is it used for?
Simplify data processing: OP_CAT allows merging two stack values in Tapscript. This simplifies the creation of complex data structures + enhances script functionality.
Extend Bitcoin functionality: OP_CAT introduces common functions that do not exist in Bitcoin but are crucial in Ethereum. This can simplify the development of L2, DEX + dApp, making the Bitcoin network versatile.
Multi-signature scripts: OP_CAT can help reduce the size of multi-signature scripts, making them more efficient and less cumbersome.
Facilitate complex contracts: OP_CAT supports advanced contracts such as vaults, which can protect funds even if private keys are leaked.
4. Controversy over the role of OP_CAT in Bitcoin: Is OP_CAT perfect?
This proposal is a bit controversial because it affects the path of how Bitcoin will or will not develop as a blockchain in the future.
One camp believes that Bitcoin should remain as it is, retaining its core function of trading BTC, while others believe that Bitcoin has not yet ossified and see room for all emerging scalability solutions (such as bridges and L2) to flourish.
At the heart of the issue is a critical decision: whether Bitcoin should expand into a more programmable public chain, or remain a P2P payment settlement layer.
For more information about BIP 347, please refer to this address: https://github.com/bitcoin/bips/blob/master/bip-0347.mediawiki