Close Menu
    Trending
    • KULR Expands Bitcoin Treasury To $78M, Cites 220% BTC Yield YTD
    • Bitcoin’s Latest Rebound Signals a Healthier, More Sustainable Bull Market
    • CME Group Launches XRP Futures, Eyes Institutional Crypto Adoption
    • Dogecoin Breakout Expected Within The Next 7 Days: Analyst
    • Auradine Expands Bitcoin Mining Solutions With Advanced ASIC Chips, Cooling Systems, And Modular Megawatt Containers
    • Does Ripple Have the Upper Hand Against Coinbase in the Battle for Circle?
    • Elon Musk’s xAI Partners with Kalshi to Integrate AI-Generated Content
    • Massive XRP Selling Pressure Is Stalling Price Action: Analyst
    Simon Crypto
    • Home
    • Crypto Market Trends
    • Bitcoin News
    • Crypto Mining
    • Cryptocurrency
    • Blockchain
    • More
      • Altcoins
      • Ethereum
    Simon Crypto
    Home»Bitcoin News»Bitcoin Covenants: OP_CAT (BIP 347)
    Bitcoin News

    Bitcoin Covenants: OP_CAT (BIP 347)

    Team_SimonCryptoBy Team_SimonCryptoMay 3, 2025No Comments6 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    That is the fifth article in a series deep diving into particular person covenant proposals which have reached some extent of maturity meriting an in-depth breakdown.

    OP_CAT, put ahead for reactivation in tapscript by Ethan Heilman and Armin Sabouri in BIP 347, just isn’t a covenant. It was an opcode that was initially included within the first launch of Bitcoin for manipulating knowledge parts on the stack. It was deactivated in 2010 with the release of Bitcoin 0.3.10 together with quite a few different opcodes resulting from issues of denial of service assaults that might crash nodes. A world most restrict of 520 bytes for any particular person merchandise on the stack whereas executing a script was additionally added. 

    It is best to have already got a fundamental understanding of how script analysis on the stack works, and the essential items of a bitcoin transaction, so there isn’t actually a lot pre-requisite explaining mandatory for OP_CAT. 

    Whereas OP_CAT might not be a covenant in and of itself, it may emulate covenants resulting from a quirk in how Schnorr signatures work. This can be a fairly in depth matter, absolutely defined here by Andrew Poelstra from Blockstream, so I’ll simply stick to a excessive degree view. Each elliptic curve has a generator level, which is actually “0”, that’s used within the elliptic curve math for key technology and signing. With Schnorr, you possibly can signal utilizing the generator level as a key, and provides or take a couple of bytes that it’s a must to signal repeatedly to get proper, the ensuing signature is definitely the identical hash of the transaction you signed. 

    Put aside the mechanics of how that works mathematically for now, and simply bear in mind for later that these “bizarre” signatures will let you get the present transactions TXID on the stack. 

     How OP_CAT Works

    OP_CAT takes the highest two knowledge objects on the stack and concatenates them collectively. So if the highest two objects on the stack are “1” and “2”, OP_CAT removes each of them after which places “12” on high of the stack. That’s it. 

    What Is OP_CAT Helpful For

    Okay, so what’s the large deal? Why is everybody freaking out about OP_CAT although it’s so easy the reason of the way it works didn’t even take a full paragraph to jot down? 

    Two causes, though given the character of OP_CAT I may give no ensures these are the one two causes. OP_CAT permits the development and verification of merkle timber instantly on the stack, which opens the door to some fascinating conduct and performance. It additionally permits emulation of covenants enabling full granular introspection because of the “bizarre” Schnorr signatures talked about above. 

    Merkle proof verification is a key part of Taproot, however the best way it’s applied merkle tree verification solely happens within the context of verifying {that a} tapscript spending path is dedicated to within the root Schnorr public key within the output script of the coin being spent. Taproot doesn’t assist generic merkle proof verification. 

    OP_CAT permits this in a very generic method. Merely offering the leaf hash(es) after which inside hash nodes in the precise order and calling OP_CAT successively will will let you reconstruct a merkle root hash, and examine towards a pre-defined hash within the script. You would do that to supply unilateral withdrawal paths for shared UTXOs like in CatVM, you possibly can make transactions depending on different transactions having been included in a block with legitimate work, you may make a transaction depending on just about any situation that may be verified with a merkle proof. 

    Now, for the covenant emulation that allows full introspection. What you are attempting to do is make sure that a transaction has to have sure traits to be legitimate. Bear in mind now that the “bizarre” signature will get the hash of the transaction on the stack. A transaction signature isn’t really achieved over the uncooked transaction, it’s achieved over its hash. This enables us to do one thing fascinating. 

    You possibly can assemble very difficult and convoluted scripts utilizing OP_CAT to take the person uncooked items of the transaction as a part of the witness, and slowly put them collectively on the stack with OP_CAT. Alongside the best way, particular person items of the transaction may be checked towards predefined hashes by simply hashing them and utilizing OP_EQUAL. On the finish of the script you could have the total transaction on the stack itself, and might append the mandatory knowledge to it after which hash it, as soon as once more evaluating it with OP_EQUAL, this time towards the “bizarre” signature. If that examine passes, a standard CHECKSIG may be run and so long as the “bizarre” signature was made with the transaction being spent, all the pieces executes as legitimate. 

    The OP_EQUAL checks of particular person items of the transaction alongside the best way assure that these items of the transaction are precisely what they need to be. If any of them fails verification, the transaction is invalid. This enforces the emulated covenants. On the finish, if the transaction hash constructed with OP_CAT and the “bizarre’ signature match, then the ultimate CHECKSIG ensures that the transaction constructed with OP_CAT and checked towards the emulated covenant matches the precise transaction being spent on the time. 

    Closing Ideas

    OP_CAT blows open the doorways of introspection and ahead knowledge carrying fully. Introspection may be achieved to any granular diploma desired, with every particular person subject of the transaction having the ability to be independently dedicated to. It permits all the identical introspective capabilities that TXHASH does, after which some. 

    The aptitude to confirm generic merkle proofs can also be a strong performance, however brings into query how that functionality will probably be used, and what sort of incentives that might create. Bitcoin scripts could possibly be constructed requiring some transaction be made on exterior blockchain methods, so long as they use merkle timber constructed with the hash features accessible in Bitcoin script. 

    Whereas OP_CAT is itself not a covenant, it permits full emulation of covenants with a a lot much less environment friendly blockchain footprint (and potential for builders to make errors and burn cash). It’s a proposal that regardless of being extremely easy itself, must be approached cautiously given the huge design house it opens up. 



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    KULR Expands Bitcoin Treasury To $78M, Cites 220% BTC Yield YTD

    May 20, 2025

    Auradine Expands Bitcoin Mining Solutions With Advanced ASIC Chips, Cooling Systems, And Modular Megawatt Containers

    May 20, 2025

    Ben Allen Receives Maelstrom Bitcoin Developer Grant To Advance Payjoin Tech

    May 20, 2025

    Abraaj Restaurants Becomes First Bitcoin Treasury Company In The Middle East

    May 20, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    Archives
    • May 2025
    • April 2025
    • March 2025
    • February 2025
    • January 2025
    • December 2024
    • November 2024
    Archives
    • May 2025
    • April 2025
    • March 2025
    • February 2025
    • January 2025
    • December 2024
    • November 2024
    Top Posts

    Shiba Inu Sees $120-M Weekly Surge—Whales Tighten Their Grip

    April 20, 2025

    About us

    Welcome to SimonCrypto.in, your ultimate destination for everything crypto! Whether you’re a seasoned investor, a blockchain enthusiast, or just beginning your journey into the fascinating world of cryptocurrencies, we’re here to guide you every step of the way.

    At SimonCrypto.in, we are passionate about demystifying the complex world of digital currencies and blockchain technology. Our mission is to provide insightful, accurate, and up-to-date information to empower our readers to make informed decisions in the ever-evolving crypto space.

    Top Insights

    Swiss canton passes legislation to explore Bitcoin mining with surplus energy

    November 30, 2024

    Ethereum’s Pectra Upgrade Finally Goes Live

    May 7, 2025

    How the Exchange is Fighting Crypto Crime

    February 15, 2025
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 SimonCrypto All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.