OP_CAT (Proposed)
A proposed opcode for joining two stack items, the building block many covenants need.
Basically
OP_CAT is a proposed Bitcoin feature that joins two pieces of data. It could let you set detailed spending rules and support more advanced contracts.
Key Takeaways
- OP_CAT is a proposed opcode, BIP-347, that joins two byte strings on the Bitcoin Script stack. Its simple operation enables transaction introspection, which unlocks covenants, vaults and programmable spending conditions on Bitcoin.
- OP_CAT was part of Bitcoin's original codebase, but Satoshi Nakamoto disabled it in 2010 because of a denial-of-service risk. Taproot's 520-byte stack element limit now removes that risk, making reactivation safe within Tapscript.
- If activated, OP_CAT could bring validity rollups, trustless bridges, recursive state machines and even post-quantum signature verification to Bitcoin. All of this would come from a single, minimal opcode change.
What Is OP_CAT?
OP_CAT is a Bitcoin Script opcode that takes the top two values from the stack, joins them into a single byte string and pushes the result back. Given stack values 0xB10C and 0xCAFE, OP_CAT produces 0xB10CCAFE. Its opcode number is 0x7e, or 126 in decimal.
BIP-347, authored by Ethan Heilman and Armin Sabouri, proposes re-enabling OP_CAT within Tapscript, the scripting language introduced by the Taproot soft fork. The proposal redefines the currently unused opcode OP_SUCCESS126 as OP_CAT and requires a soft fork to activate on mainnet.
OP_CAT is one of the most discussed Bitcoin upgrades because concatenation provides a building block for transaction introspection. Transaction introspection lets a script inspect and enforce conditions on the transaction spending it. This capability opens the door to covenants, smart contracts and programmable Bitcoin that were previously impossible without more invasive protocol changes.
How It Works
OP_CAT is straightforward at the implementation level. It pops two elements from the stack, appends the second to the first, checks that the result does not exceed 520 bytes and pushes the joined value back onto the stack.
The operation fails if the stack has fewer than two elements. It also fails if the resulting byte string exceeds the 520-byte maximum stack element size enforced in Tapscript.
Historical Context
OP_CAT was present in Bitcoin from the very first release. In 2010, Satoshi Nakamoto disabled it along with 15 other opcodes in a commit labelled simply "misc changes." The concern was a denial-of-service vector: without a size limit, a script could use OP_DUP and OP_CAT in a loop to double a stack element with each iteration, creating a value exceeding one terabyte after only 40 repetitions.
Satoshi introduced a stack element size limit in the same period, initially 5,000 bytes and then reduced to 520 bytes, but still chose to disable the opcode entirely. The 520-byte limit has remained in place ever since and was carried forward into Tapscript by BIP-342. With this limit enforced, the original attack is completely neutralised because OP_CAT can never produce an element larger than 520 bytes, no matter how many times it executes.
The Schnorr Trick: Why Concatenation Enables Introspection
Schnorr signatures explain why a simple concatenation opcode unlocks so much functionality. A Schnorr signature is computed over a hash of three values joined together: the public key's x-coordinate, the nonce's x-coordinate and the transaction data, known as the sighash.
OP_CAT lets a script reconstruct this hash from its component parts inside Script itself. The spender provides the transaction data as a witness element, and the script uses OP_CAT to assemble the expected signature hash before verifying it with OP_CHECKSIG. If the signature passes, the script knows the provided transaction data is authentic because only the correct data would produce a valid signature.
Andrew Poelstra described this technique in his 2021 "CAT and Schnorr Tricks" paper. It effectively gives Bitcoin Script the ability to see the transaction that is spending it. From there, the script can enforce arbitrary conditions, such as restricting which addresses can receive the funds, requiring specific output amounts or mandating that the spending transaction recreate certain script conditions in its outputs.
Covenants and Vaults
Covenants are spending restrictions that persist across transactions. A covenant can enforce rules like "these funds can only be sent to address X" or "withdrawals require a 24-hour delay." OP_CAT enables covenant emulation through the Schnorr introspection trick, allowing scripts to constrain which outputs a spending transaction must create.
Vaults are a practical application of covenants that enforce a mandatory time delay before funds can move to an external address. During the delay, a timelock-protected recovery path allows the owner to claw back funds if their keys are compromised, providing a security layer beyond traditional self-custody models. The Bitcoin covenants explainer covers covenant mechanics in more depth.
Validity Rollups and Trustless Bridges
OP_CAT could enable trust-minimised bridges between Bitcoin and Layer 2 networks, one of its most ambitious applications. Today, most Bitcoin Layer 2 solutions, including sidechains and rollups, rely on federated multisig schemes to custody funds on the base layer. With OP_CAT, a covenant script could verify cryptographic proofs on-chain, allowing a rollup to settle directly to Bitcoin without trusting a federation.
StarkWare has published a proof-of-concept bridge covenant demonstrating how a ZK-rollup could use OP_CAT to verify STARK proofs within Bitcoin Script. This would allow Layer 2 systems to inherit Bitcoin's security model rather than relying on honest-majority assumptions. The Bitcoin Layer 2 comparison covers how different scaling approaches handle trust assumptions.
Recursive Covenants and On-Chain State
Recursive covenants use OP_CAT to create scripts that enforce their own continuation, meaning the spending transaction must include an output with the same covenant script or an updated version of it. This enables stateful smart contracts on Bitcoin, where a UTXO carries state that evolves across multiple transactions.
Applications include on-chain counters and token protocols where rules are enforced by the script itself rather than external indexers. They also include joinpool constructions like Ark that coordinate shared UTXOs among many participants.
Post-Quantum Signature Verification
OP_CAT enables Winternitz One-Time Signatures, or WOTS, within Bitcoin Script, providing a path to quantum-resistant transaction verification because WOTS signatures can be constructed and verified using only hash operations and concatenation. Developers have demonstrated working prototypes at approximately 2,000 virtual bytes per input, which is feasible though larger than standard Schnorr-based transactions. The Shor's algorithm glossary entry provides context on quantum threats to Bitcoin.
Token Protocols and Advanced Contracts
Developers have demonstrated fungible tokens, NFT trading and multi-party contracts using OP_CAT on test networks. Unlike existing token standards such as BRC-20 or Runes, which rely on off-chain indexers to interpret meaning, OP_CAT-based tokens can have their rules enforced directly in Bitcoin Script, reducing trust assumptions.
The Activation Debate
BIP-347's specification status is "Complete," meaning the technical design is finalised. Activation on mainnet requires a separate soft fork deployment with miner signalling, and no activation parameters have been set.
Testing and Development
OP_CAT has been enforced on the Bitcoin Inquisition signet since May 2024, providing a live testing environment for developers. A dedicated test network called Catnet also exists for OP_CAT-specific experiments, and multiple teams have built working prototypes on these networks, including bridge covenants, vault constructions and token contracts.
Community Sentiment
Developer sentiment has trended positive, with endorsements from StarkWare and backing from Taproot Wizards, who raised $30 million in 2025 to build OP_CAT ecosystem applications. Few technical objections to the opcode itself remain, and the Quantum Cats NFT campaign served as a cultural rallying point for the proposal.
Opposition centres on concerns that covenants could create permanently restricted UTXOs that complicate Bitcoin's fungibility, that the opcode expands protocol complexity and that the appropriate activation methodology is contested. Some community members argue that proposals lacking overwhelming consensus should not use Speedy Trial. Speedy Trial is the activation mechanism used for Taproot.
Competing Proposals
OP_CAT exists alongside other covenant proposals. Each has different trade-offs.
The community debates whether to activate one proposal, several or a combination. As of 2026, the broader conversation has been described as a "Bitcoin Covenant Renaissance," with multiple proposals advancing in parallel but none yet activated on mainnet.
Why It Matters
OP_CAT represents a minimal change with outsized implications. Adding a single, well-understood opcode with clear safety bounds through the 520-byte limit could enable an entire class of functionality that currently requires either trusted intermediaries or more invasive protocol changes. For the Bitcoin Script programmability ecosystem, it is one of the most efficient paths from where Bitcoin is today to where developers want it to be.
Layer 2 protocols like Spark and Lightning already extend Bitcoin's capabilities off-chain. OP_CAT would strengthen these systems by enabling trust-minimised bridges and more expressive on-chain enforcement of off-chain state, reducing reliance on federated or cooperative assumptions.
Fungibility Concerns
Covenants introduce the possibility of permanently restricted UTXOs: coins that can only be spent under specific conditions, potentially forever. Critics argue this creates a class of "tainted" Bitcoin that undermines the fungibility property where every satoshi is interchangeable with every other.
Complexity and Attack Surface
OP_CAT itself is simple, but the constructions it enables, including recursive covenants, rollup verification and stateful contracts, are complex. Bugs in covenant scripts could lock funds permanently or create unexpected economic incentives. The expressiveness that makes OP_CAT powerful also makes it harder to reason about the full range of possible behaviours.
Activation Risk
Any consensus change to Bitcoin carries deployment risk. A contentious activation could divide the network or set precedents for how future upgrades are deployed. The Bitcoin community generally favours overwhelming consensus before activating soft forks, and OP_CAT has not yet reached that threshold.
No Activation Timeline
BIP-347 has "Complete" status, but no mainnet activation parameters have been proposed. Developers building on OP_CAT today are working on test networks with no guarantee of when, or whether, the opcode will be available on Bitcoin mainnet. Applications designed around OP_CAT should account for this uncertainty.
This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.