OP_CAT enables covenants when combined with OP_CHECKSIG:
15. Future Tapscript Opcodes (OP_CAT, OP_CTV Proposals)
Several new opcodes are actively proposed for Bitcoin that would be deployed by redefining OP_SUCCESS values in Tapscript. The two most discussed are OP_CAT and OP_CHECKTEMPLATEVERIFY (OP_CTV).
OP_CAT — String Concatenation
OP_CAT (opcode 0x7e, currently OP_SUCCESS126) concatenates the top two stack items:
Stack before OP_CAT: [<item_a>, <item_b>]
Stack after OP_CAT: [<item_a + item_b>] (concatenation)
OP_CAT was disabled in Bitcoin in August 2010 because it enabled quadratic memory growth attacks — a script could repeatedly double a stack item to fill memory. In Tapscript, the 520-byte stack item limit prevents this attack.
OP_CAT enables a surprisingly large range of constructions:
# OP_CAT enables covenants when combined with OP_CHECKSIG:
# You can construct the sighash preimage on the stack and verify
# it matches what's being signed — constraining transaction structure
# Example: Force an output to have a specific scriptPubKey
# (simplified, requires OP_CAT + OP_SHA256 + OP_CHECKSIGFROMSTACK or similar)
# Building a Schnorr signature from parts:
<R_x_bytes> <s_bytes>
OP_CAT
# Stack: [<64-byte Schnorr sig>]
OP_CHECKSIG # Verify this assembled signature
BIP 347 proposes OP_CAT for Tapscript and has significant developer support as of 2024-2025.
OP_CHECKTEMPLATEVERIFY (OP_CTV) — BIP 119
OP_CTV (proposed as 0xb3) commits to the "template" of a transaction — its outputs, input count, sequence numbers, and lock time — without committing to which inputs are used.
OP_CTV behavior:
Stack input: <32-byte template hash>
Operation: Hash the current transaction's template
Compare to stack input
Fail if they don't match, continue if they do
Template hash commits to:
- nVersion
- nLockTime
- input count
- sequence of current input
- output count + outputs hash
- (NOT: which UTXOs are being spent)
This enables covenants — scripts that constrain how funds can be spent in future transactions:
// Vault using OP_CTV:
// Initial deposit goes into a "cold" vault output
Cold vault locking script:
<template_hash_to_warm_vault> OP_CTV
// This script can ONLY be spent by a specific transaction
// that sends funds to the warm vault — no other destination allowed
// The warm vault then has a timelock before final spending
Warm vault locking script:
<timelock> OP_CHECKLOCKTIMEVERIFY OP_DROP
<template_hash_to_final_dest> OP_CTV
// If the vault is ever compromised, the covenant structure
// gives the owner time to cancel (clawback) during the timelock
OP_VAULT (BIP 345)
OP_VAULT is a higher-level opcode specifically designed for vault constructions, proposed to use OP_SUCCESS values in Tapscript:
OP_VAULT enables:
- "Trigger" transaction initiates a withdrawal with a mandatory timelock delay
- During the delay period, funds can be "recovered" to a cold key
- After the delay, funds can be sent to the originally specified destination
- Much cleaner than trying to build vaults from OP_CTV primitives
Current Status of Proposals (as of early 2026)
``` Proposal | BIP | Status | OP_SUCCESS slot
Technical Insight
This topic covers essential mechanics for Chapter 11. Understanding these details is key to mastering advanced Bitcoin script constructions like Taproot and specialized covenants.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: