Building on Bitcoin

What Is OP_CAT?

OP_CAT is a proposed Tapscript opcode that joins two stack values. Learn how its simple byte-concatenation rule differs from the higher-level systems built with it, why current mainnet Tapscript still treats `0x7e` as OP_SUCCESS126, and why BIP 347's Complete status is not deployment.

  • Innovation
  • Deep
  • Technical Analysis
  • 16 to 19 minutes
  • Reviewed null

Preview only. Publication records and confirmed URLs do not exist; all navigation remains inactive.

OP_CAT is a proposed Bitcoin Script operation that concatenates two stack elements. If the stack contains x1 followed by x2, OP_CAT produces x1 || x2: the bytes of the first value followed by the bytes of the second.

The operation is simple. Its status is not. OP_CAT existed in early Bitcoin software, was disabled in 2010, and is not an active concatenation operation under Bitcoin's current mainnet consensus rules. BIP 347 proposes enabling it only in Tapscript through a soft fork.

As of July 24, 2026, BIP 347 is marked Complete, not Deployed. Under the current BIP process, Complete means the authors consider the proposal finished and recommend adoption; it does not mean activation criteria have been met or the network enforces the proposal.

Concatenation is a general building block

Bitcoin Script operates on byte arrays placed on a stack. Many useful constructions require building a larger byte sequence from smaller pieces before hashing or checking it. OP_CAT supplies that primitive.

For example, a script could concatenate two child hashes before hashing the result to verify one level of a Merkle tree. A script could combine fields that form a committed message. More elaborate constructions can use concatenation with signatures and hashes to reason about transaction data or enforce relationships among values.

OP_CAT does not understand Merkle trees, vaults, covenants, signatures, or bridges. It only joins bytes. The higher-level behavior comes from the complete script, transaction structure, signing rules, and application protocol.

This is why a small opcode can have a large design surface. General primitives can be composed in ways that are useful, inefficient, subtle, or unsafe.

Early Bitcoin had OP_CAT

The original Bitcoin Script implementation included OP_CAT. In August 2010, a commit disabled OP_CAT together with several other opcodes.

The BIP describes a historical concern that repeated duplication and concatenation could grow a stack item rapidly. Early software already had a stack-element limit, but disabling the opcode removed that construction from active script evaluation.

History should not be used as proof that the current proposal is automatically safe or unsafe. Today's Tapscript has different upgrade mechanics and explicit resource limits. BIP 347 specifies a 520-byte maximum resulting element, so a concatenation that would exceed that size fails.

The proposal is therefore a new activation decision with current semantics, not simply a switch that restores every aspect of a 2009 implementation.

Current legacy and SegWit v0 behavior

In current Bitcoin Core v31.1, OP_CAT remains in the list of disabled opcodes for legacy Script and SegWit version-zero execution. Encountering it causes script failure with SCRIPT_ERR_DISABLED_OPCODE.

BIP 347 explicitly preserves that behavior. Its proposed change applies only to Tapscript, the script language used for Taproot script-path spends.

That boundary prevents a successful soft fork from silently changing old script versions. A transaction using OP_CAT in a legacy or P2WSH script would remain invalid under the proposal.

Bitcoin Core source is evidence of one current implementation's enforcement of active rules. The consensus definition also comes from the behavior compatible nodes jointly enforce. A pull request or experimental branch that implements OP_CAT does not change mainnet consensus by itself.

Current Tapscript treats byte 0x7e as OP_SUCCESS126

Tapscript reserves a set of opcode values called OP_SUCCESSx. Under BIP 342, validation succeeds immediately if decoding encounters any OP_SUCCESSx byte, even in an unexecuted branch, before ordinary execution or later resource checks.

The historical OP_CAT byte value is decimal 126, or hexadecimal 0x7e. In current Tapscript that value is OP_SUCCESS126, not an active concatenation instruction.

BIP 347 proposes redefining OP_SUCCESS126 as OP_CAT. That is a soft-fork pattern because some spends that are valid under the old OP_SUCCESS behavior would become invalid unless they satisfy the new OP_CAT rules. Upgraded nodes would enforce the additional restrictions.

Before activation, developers must not construct a mainnet Tapscript expecting 0x7e to concatenate data. Its current success behavior is materially different and could make an output spendable under conditions the author did not intend.

The proposed operation has narrow semantics

Under BIP 347, OP_CAT would:

  1. require at least two stack elements;
  2. remove the top two elements;
  3. concatenate them in stack order;
  4. reject a result larger than 520 bytes; and
  5. push the result back onto the stack.

The proposal does not increase the 520-byte stack-element limit. It does not activate OP_CAT in non-Tapscript scripts. It does not define a new signature hash, inspect a transaction directly, or create persistent contract state.

The reference implementation and test vectors are part of the BIP's Complete status. Those artifacts support implementability and edge-case review. They do not supply network activation.

Complete is not Deployed

BIP 3 defines the current BIP workflow. It says that individual BIPs do not define Bitcoin or represent community consensus. A Specification BIP may move to Complete after planned work, a reference implementation, and comprehensive test vectors are available.

A Complete BIP can remain Complete indefinitely. To move to Deployed, evidence of active use is required. For a consensus soft fork, relevant evidence can include activation criteria having been met on the network.

BIP 347's changelog records that it was marked Complete on March 1, 2026. Its header still says Complete as of July 24, 2026. Therefore the accurate description is โ€œa complete soft-fork proposal,โ€ not โ€œan activated Bitcoin opcode.โ€

Discussion, code review, signet experiments, alternative clients, or miner signaling can all be relevant to evaluation. None should be collapsed into deployment unless the actual activation mechanism and active-chain state support that claim.

Why developers are interested in OP_CAT

Concatenation can help scripts verify hashed data structures. A Merkle proof, for example, repeatedly combines a current hash with a sibling hash before hashing the pair. Native concatenation can make such verification more direct.

BIP 347 also lists tree signatures, non-equivocation contracts, Lamport-signature constructions, Bitstream, vaults, covenant techniques, and BitVM improvements as possible uses.

These are capability arguments, not deployed applications. Each construction has additional assumptions, transaction formats, limits, and security analysis. A proposal enabling one primitive does not guarantee that every cited use is practical, private, efficient, or safe.

Some examples rely on cryptographic techniques that may be difficult to review. Others can create scripts or witnesses that are large enough to be costly despite remaining within consensus limits. Application-level feasibility should be measured with concrete transactions and adversarial tests.

OP_CAT and covenants

A covenant restricts how a Bitcoin output may be spent, often by constraining properties of later transactions. OP_CAT is frequently discussed as a path to covenant-like constructions because concatenation can help scripts assemble messages checked by signature or hash operations.

OP_CAT is not itself a covenant opcode. It does not directly expose all fields of the spending transaction. Covenant behavior arises only when OP_CAT is combined with existing signature semantics and a carefully designed script.

This matters for both capability and risk claims. Saying โ€œOP_CAT enables covenantsโ€ can hide which covenant pattern, what transaction commitments it relies on, whether key-path spending is disabled, how fees are handled, and whether the construction is usable within resource limits.

Competing covenant proposals may offer more specialized semantics. The tradeoff is not simply more versus less expressiveness. Reviewers compare analyzability, implementation complexity, composability, resource cost, accidental behavior, and interaction with existing Script rules.

Resource limits still shape applications

The proposed 520-byte result limit prevents unbounded stack-item growth inside one operation. Tapscript also has stack-element count, witness-weight, and signature-operation constraints.

A script can be consensus-valid yet expensive to create or spend. More witness data increases transaction weight and fees. More complicated scripts create more opportunities for implementation mistakes, wallet incompatibility, and poor recovery behavior.

Consensus resource limits are not a performance guarantee. Nodes still parse and execute scripts, wallets still construct witnesses, and users still need transactions to relay and confirm under current policy and fee conditions.

The BIP's safety argument should therefore be considered alongside benchmark results, code review, fuzzing, test vectors, and analysis of realistic applications.

Experimental implementations do not change mainnet

A Bitcoin Core pull request, fork, signet, or testing environment can implement BIP 347 so developers can build test scripts and measure behavior. Such software is useful evidence.

It remains implementation behavior on that environment. Mainnet users running ordinary current software do not gain OP_CAT semantics because a test branch exists.

Applications should pin the network and rules they expect. A script created for a custom signet can be misleading or unsafe if copied to mainnet. Wallets and explorers also need context-aware disassembly so they do not label current OP_SUCCESS126 behavior as activated OP_CAT.

The same byte can have different meaning across script versions and networks. Tooling must display that context rather than showing only the mnemonic preferred by one experimental implementation.

Activation would require coordinated rule enforcement

BIP 347 specifies semantics but contains no activation height, signaling threshold, start time, or deployment parameters. Bitcoin Core v31.1 sources reviewed for this guide preserve active OP_SUCCESSx Tapscript behavior and legacy or SegWit v0 disabled-opcode behavior; they do not document a mainnet BIP 347 deployment. Any mainnet deployment would need a concrete soft-fork activation process, implementation releases, ecosystem review, and a point at which upgraded nodes begin enforcing the new rule.

A soft fork is backward-compatible in the limited sense that old nodes can continue accepting blocks that upgraded nodes accept. Old nodes would not enforce the new OP_CAT restrictions and could not independently validate that a Tapscript spend complied with them.

That creates the ordinary soft-fork dependence on sufficient enforcement by the economic network. The risks and decision process are broader than whether the opcode implementation passes unit tests.

No guide should predict activation dates, claim consensus, or describe a proposal as inevitable. Bitcoin has no central body that can approve a BIP into consensus.

The practical evaluation

When evaluating OP_CAT, begin with the active network rule: current mainnet Tapscript uses OP_SUCCESS126, while legacy and SegWit v0 OP_CAT remain disabled.

Then read the exact BIP version and status. BIP 347 version 1.0.0 is Complete as of the review date, which establishes proposal maturity under the BIP process but not deployment.

Next examine the reference implementation, tests, benchmarks, and specific use case. Verify witness sizes, fees, key paths, recovery paths, and behavior if a transaction is delayed or replaced.

Finally separate the primitive from the product claim. OP_CAT concatenates bytes. A vault, bridge, post-quantum fallback, BitVM optimization, or covenant system must be evaluated as its own protocol.

That disciplined description leaves room for serious interest without presenting a proposed consensus change as a feature users can rely on today.

Key Terms

OP_CAT
A Script operation that concatenates two stack byte arrays under the semantics proposed by BIP 347.
Concatenation
Joining byte sequence `x1` and byte sequence `x2` to produce `x1 || x2`.
Tapscript
The script language and validation rules for Taproot script-path spends defined by BIP 342.
OP_SUCCESSx
Reserved Tapscript opcodes that currently cause successful validation and provide a path for future soft-fork restrictions.
OP_SUCCESS126
The current Tapscript meaning of byte `0x7e`, which BIP 347 proposes redefining as OP_CAT.
Disabled opcode
An opcode that causes failure in the script versions where it remains disabled.
Stack element
A byte array held on Bitcoin Script's execution stack.
520-byte limit
The maximum stack-element size retained by the BIP 347 proposal.
Soft fork
A consensus-rule change that makes some previously valid blocks or spends invalid under upgraded rules.
Complete BIP
A proposal whose authors have completed planned work and recommend adoption under BIP 3; it is not necessarily deployed.
Deployed BIP
A BIP status requiring evidence of active use or, for a soft fork, applicable network activation evidence.
Covenant
A spending condition that constrains properties of later transactions.
Reference implementation
Code demonstrating the proposed specification; it is not activation by itself.
Consensus activation
The point at which the network's enforced rules include the proposed restriction.

Sources

BIP 347: OP_CAT in Tapscript

  • author or publisher: Ethan Heilman and Armin Sabouri
  • url: https://github.com/bitcoin/bips/blob/master/bip-0347.mediawiki
  • supports: The proposed OP_CAT semantics, OP_SUCCESS126 redefinition, 520-byte result limit, Tapscript-only scope, use cases, reference implementation, test vectors, Complete status, and 2026-03-01 changelog.

BIP 3: Updated BIP Process

  • author or publisher: Murch
  • url: https://github.com/bitcoin/bips/blob/master/bip-0003.md
  • supports: The meaning of BIP ownership, Complete and Deployed statuses, evidence expectations, and the statement that BIPs do not define Bitcoin or represent community consensus.

BIP 342: Validation of Taproot Scripts

  • author or publisher: Pieter Wuille, Jonas Nick, and Anthony Towns
  • url: https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki
  • supports: Current Tapscript execution, OP_SUCCESSx behavior, signature operations, and resource limits.

BIP 341: Taproot

  • author or publisher: Pieter Wuille, Jonas Nick, and Anthony Towns
  • url: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki
  • supports: Taproot outputs and script-path commitments that provide the context for Tapscript.

BIP 340: Schnorr Signatures for secp256k1

  • author or publisher: Pieter Wuille, Jonas Nick, and Tim Ruffing
  • url: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
  • supports: Schnorr signature rules used by Tapscript and cited OP_CAT constructions.

Bitcoin Core v31.1 Script Interpreter

  • author or publisher: Bitcoin Core contributors
  • url: https://github.com/bitcoin/bitcoin/blob/v31.1/src/script/interpreter.cpp
  • supports: Current implementation behavior that rejects OP_CAT as disabled in legacy and SegWit v0 script evaluation.

Bitcoin Core PR 29247: OP_CAT

  • author or publisher: Bitcoin Core contributors
  • url: https://github.com/bitcoin/bitcoin/pull/29247
  • supports: The referenced experimental implementation and test discussion; a pull request is not mainnet activation.

Satoshi Nakamoto Commit 4bd188c

  • author or publisher: Satoshi Nakamoto
  • url: https://github.com/bitcoin/bitcoin/commit/4bd188c4383d6e614e18f79dc337fbabe8464c82
  • supports: The August 2010 source change that disabled OP_CAT and other opcodes.

Bitcoin Script Opcode Definitions

  • author or publisher: Bitcoin Core contributors
  • url: https://github.com/bitcoin/bitcoin/blob/v31.1/src/script/script.h
  • supports: Current opcode values and names used by Bitcoin Core.

Bitcoin Core Script Tests

  • author or publisher: Bitcoin Core contributors
  • url: https://github.com/bitcoin/bitcoin/tree/v31.1/src/test/data
  • supports: Current script test-vector context for active Bitcoin Core behavior.

CAT and Schnorr Tricks I

  • author or publisher: Andrew Poelstra
  • url: https://www.wpsoftware.net/andrew/blog/cat-and-schnorr-tricks-i.html
  • supports: A cited construction showing how concatenation and Schnorr signatures can emulate check-signature-from-stack-like behavior.

CAT and Schnorr Tricks II

  • author or publisher: Andrew Poelstra
  • url: https://www.wpsoftware.net/andrew/blog/cat-and-schnorr-tricks-ii.html
  • supports: A cited exploration of covenant and vault constructions using CAT and Schnorr techniques.

BitVM2: Bridging Bitcoin to Second Layers

  • author or publisher: Robin Linus and coauthors
  • url: https://bitvm.org/bitvm_bridge.pdf
  • supports: The BitVM2 design referenced by BIP 347 when discussing possible efficiency and setup improvements.

Bitstream

  • author or publisher: Robin Linus
  • url: https://robinlinus.com/bitstream.pdf
  • supports: The fair-exchange protocol cited as a possible OP_CAT application; it is a separate protocol requiring independent evaluation.

Bitcoin Covenants

  • author or publisher: Malte Mรถser, Ittay Eyal, and Emin Gรผn Sirer
  • url: https://fc16.ifca.ai/bitcoin/papers/MES16.pdf
  • supports: Covenant and vault background cited by the BIP; it does not establish OP_CAT deployment.

BIP 141: Segregated Witness

  • author or publisher: Eric Lombrozo, Johnson Lau, and Pieter Wuille
  • url: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki
  • supports: The SegWit version-zero script and witness context kept separate from Tapscript.

BIP 123: BIP Classification

  • author or publisher: Eric Lombrozo
  • url: https://github.com/bitcoin/bips/blob/master/bip-0123.mediawiki
  • supports: The layer classifications used to identify BIP 347 as a consensus soft-fork proposal.