Close Menu
  • Coins
    • Bitcoin
    • Ethereum
    • Altcoins
    • NFT
  • Blockchain
  • DeFi
  • Metaverse
  • Regulation
  • Other
    • Exchanges
    • ICO
    • GameFi
    • Mining
    • Legal
  • MarketCap
What's Hot

These Finland homes get free heat from bitcoin miners (as long as BTC stays above $70,000)

08/11/2026

Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

08/11/2026

Threshold Sets tBTC Reconnection Target as Week-Long Pause Continues

08/11/2026
Facebook X (Twitter) Instagram
  • Back to NBTC homepage
  • Privacy Policy
  • Contact
X (Twitter) Telegram Facebook LinkedIn RSS
NBTC News
  • Coins
    1. Bitcoin
    2. Ethereum
    3. Altcoins
    4. NFT
    5. View All

    Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

    08/11/2026

    Bitcoin sentiment turns cautious – Yet ONE signal hints at BTC’s local bottom

    08/11/2026

    Liquid Network at 86% Backing as Bitcoin Redemption Freeze Drags On

    08/11/2026

    Bitcoin Sees 84,000 BTC Accumulation by Whales

    08/11/2026

    Ethereum needs an hourly close above $2,250.95 to confirm breakout

    08/11/2026

    Ethereum price crashes 7% as $213M liquidations hit: is $2,000 at risk?

    08/11/2026

    Tom Lee says Ethereum is bottoming – A whale is betting $45M that he’s right

    08/11/2026

    EIP-8037 state-gas rules force Ethereum dApps to rewrite billing

    08/11/2026

    Ripple’s $24M XRP Debt Fight Puts a $400M Tranglo Stake on the Block

    08/11/2026

    Solana Shows Positive Turnaround with $400K in Net Income

    08/11/2026

    XRP Ledger patched decade-old bug that could create billions of dollars in XRP from nothing

    08/11/2026

    SkyAI’s Transfer of 568,000 SOL Raises Concerns Over Market

    08/11/2026

    Machi Liquidated Again, Losing $223K from NFT Sale

    07/11/2026

    PixieChess Confirms New Weekly Packs for Collectors on Base

    29/10/2026

    Fuzzy Launches Dynamic NFT Collection With Four Phases

    29/10/2026

    Machi’s NFT Sales Exceed 60 as Trader Faces $2.35M Loss

    28/10/2026

    These Finland homes get free heat from bitcoin miners (as long as BTC stays above $70,000)

    08/11/2026

    Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

    08/11/2026

    Threshold Sets tBTC Reconnection Target as Week-Long Pause Continues

    08/11/2026

    Fireblocks Highlights Stablecoin Stability in NYSE Interview

    08/11/2026
  • Blockchain

    Chainlink Expands APAC Equities Streams to Cover Over $40 Trillion in Asian Stock Markets

    07/11/2026

    Xeni Travel Launches Booking Platform on Hedera for Travel

    07/11/2026

    OpenZeppelin Joins S&P Global, Strengthening Chainlink’s

    07/11/2026

    THORChain Restarts Most Swaps, With 14 Nodes Yet to Upgrade

    07/11/2026

    Solana co-founder Anatoly Yakovenko tells data centers to pivot to crypto

    07/11/2026
  • DeFi

    Threshold Sets tBTC Reconnection Target as Week-Long Pause Continues

    08/11/2026

    Stacks leads Bitcoin layers in Q3 DeFi TVL at $88.9 million

    08/11/2026

    Loopscale Reopens All Vaults After Attack-Related Freeze

    08/11/2026

    Kraken parent Payward and its clients buy AAVE tokens in DeFi investment push

    07/11/2026

    Lido adds Firelight as first line of loss protection for EarnETH and EarnUSD

    07/11/2026
  • Metaverse

    Exploring the Future of the Metaverse

    19/10/2026

    Is Solana Gaming Back? Kintara Activity Fuels Renewed Optimism in Onchain MMOs

    24/06/2026

    The Sandbox launches AI game engine ‘The Sandbox Studio’ for next-generation creators

    10/06/2026

    Meta commits $13M in funding for Oversight Board through 2028

    29/05/2026

    Why Animoca’s Yat Siu says the future is 100 billion AI agents

    07/05/2026
  • Regulation

    Fireblocks Highlights Stablecoin Stability in NYSE Interview

    08/11/2026

    $250M FalconX Facility Powers Ibis Push Into Onchain Credit

    08/11/2026

    India’s Households Could Drive Investment Growth, BlackRock

    08/11/2026

    Token Terminal Retweets Insight on Tokenized Asset Growth

    08/11/2026

    Market Sees Shift in Tokenized Assets, Reports James Seyffart

    08/11/2026
  • Other
    1. Exchanges
    2. ICO
    3. GameFi
    4. Mining
    5. Legal
    6. View All

    Backpack Securities Achieves $500M Weekly Volume

    07/11/2026

    Kraken Brings BTC and ETH Options to EEA under Cyprus Licence

    07/11/2026

    Binance Lists 227 Futures Pairs So Far as Traditional Assets Dominate

    07/11/2026

    USDC overtakes USDT in euro stablecoin trading as EU rules reshape market: Kaiko

    07/11/2026

    ICO market slows sharply with only six completions in 2026

    30/04/2026

    South Korea Poised to Lift Ban on Domestic ICOs After 7 Years

    19/12/2025

    Why 2025’s Token Boom Looks Both Familiar and Dangerous

    31/10/2025

    ICO for bitcoin yield farming chain Corn screams we’re so back

    22/01/2025

    FLOKI Ships Valhalla 1.13.2 ‘Special Delivery’ to Players on Mainnet

    27/10/2026

    Top 12 NFT games every player should know about in August 2026

    19/08/2026

    GameShame Studios founder details Raijin Protocol’s roadmap in NeoPod’s sixth AMA

    13/08/2026

    How BC.GAME is turning players into stakeholders

    04/08/2026

    These Finland homes get free heat from bitcoin miners (as long as BTC stays above $70,000)

    08/11/2026

    Bitcoin Mining Difficulty Has Not Set a Record in 374 Days, Its Longest Gap on Record

    08/11/2026

    Bitcoin Mining Difficulty Has Never Stayed Below Its Peak for This Long

    07/11/2026

    Core Scientific sells 816 BTC, holds just 32 BTC as AI pivot accelerates

    07/11/2026

    Why Netanyahu’s Crypto Sanctions Proposal Harms Israeli Web3 Ecosystem

    08/11/2026

    SingularityNET CEO Addresses Challenges of AI Regulation

    08/11/2026

    SEC’s Crypto Token Taxonomy FAQ Released by Eleanor Terrett

    08/11/2026

    Big crypto wants the one thing it can’t buy: your vote

    08/11/2026

    These Finland homes get free heat from bitcoin miners (as long as BTC stays above $70,000)

    08/11/2026

    Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

    08/11/2026

    Threshold Sets tBTC Reconnection Target as Week-Long Pause Continues

    08/11/2026

    Fireblocks Highlights Stablecoin Stability in NYSE Interview

    08/11/2026
  • MarketCap
NBTC News
Home»Bitcoin»Bitcoin OP_CAT use cases series #4: Recursive covenants
Bitcoin

Bitcoin OP_CAT use cases series #4: Recursive covenants

NBTCBy NBTC19/07/2024No Comments4 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email


This post was first published on Medium.

Recursive covenants

As we explained in series #1, a Bitcoin covenant is a mechanism that allows the sender of a Bitcoin transaction to impose certain conditions on how the receiver can spend the coins.

A recursive covenant is a type of covenant that applies not only to the immediate transaction but also to any subsequent transactions that spend the bitcoins. This means that the conditions imposed by the covenant could be enforced recursively in perpetuity.

The main difference between a regular non-recursive covenant and a recursive covenant is the scope of the conditions. A regular covenant only applies to the immediate next transaction, while a recursive one extends to all future transactions that spend the bitcoins.

Here’s a simple example to illustrate the difference:

  • Regular covenant: Alice sends Bob 1 BTC with the condition that Bob can only spend the BTC if he provides a valid signature from a specific public key. This condition only applies to the immediate transaction.
  • Recursive covenant: Alice sends Bob 1 BTC with the condition that Bob can only spend the BTC if he provides a valid signature from a specific public key, and that any future transactions spending the BTC must also provide a valid signature from the same public key. This condition applies to all future transactions that spend the BTC.

Recursive covenants can be more powerful and flexible than regular covenants. They represent a significant step forward in the programmability and flexibility of Bitcoin transactions, potentially opening up a wide array of new applications and use cases. For instance, they allow implementing more complex transaction logic required for interoperability with sidechains or other Layer 2 solutions.

Bitcoin smart contracts with state

In Bitcoin’s UTXO model, smart contracts are inherently one-off and stateless, as the UTXO containing the contract is consumed and destroyed when spent. Recursive covenants introduce a form of state that can be maintained and updated across multiple transactions. When a transaction spends a UTXO (Unspent Transaction Output) containing a stateful contract, the state of the contract is updated, and the new state is stored in the output of the spending transaction, all enforced by recursive covenants. Unlike traditional Bitcoin transactions, which are stateless and immutable once confirmed, stateful smart contracts enable the tracking and modification of state over time, akin to smart contracts on other blockchain platforms like Ethereum.

Let us illustrate how it works with a simple counter contract. This basic contract maintains a single state: how many times it has been called since deployment.

TX0, TX1 and TX2 screenshot

Counter in a chain of transactions with state 0, 1, and 2

The state is stored in an adjacent output next to the output containing the contract itself. More specifically, it is in an OP_RETURN output.

OP_RETURN OP_PUSHBYTES [counter value]

The Counter contract below resides in a Taproot output. There are two tricks worth highlighting:

  1. We choose to store state in a separate output, instead of the same taproot output. This allows us to avoid tweaking the taproot address in the contract, since the address remains unchanged. Tweaking involves heavy elliptic curve arithmetic, which necessitates either excessively long script or new opcode like OP_TAPLEAF_UPDATE_VERIFY/OP_TLUV.
  2. We use covenant to get the txid of the previous transaction, which in turns allows us to parse the raw transaction and access its outputs.

Counter contract

The contract ensure the spending transactions satisfy the following properties:

  • recursive covenant: the address of the first input is identical to the address of the first output
  • state transition: the second output (i.e., the state output) of the current transaction must have a counter value exactly one larger than that in the previous transaction’s second output
  • having one input and one two outputs

A single run results in the following transactions:

  • Deploy Transaction ID with initial state 0: https://mempool.space/signet/tx/142782e6dd8ffcf06554b8222637c237a65f47aab27c373da3ddd7b46cd8428c?source=post_page—–6a3127a24af4——————————–
  • Transaction ID with state 1 after incremented once: https://mempool.space/signet/tx/1d1112a7ba7d3dde969006ab3984564b67b5060d1d323d2d2bf963069b600f20?source=post_page—–6a3127a24af4——————————–
  • Transaction ID with state 2 after incremented twice: https://mempool.space/signet/tx/01a5ed59ec9497ec82d80dc2ba41025342d66a25eec6b4046ec5b8c4964295d1?source=post_page—–6a3127a24af4——————————–

Full code can be found at https://github.com/sCrypt-Inc/scrypt-btc-counter.

More sophisticated state machines can be implemented similarly, where state transition is enforced entirely on chain. There can be alternative places and ways to store and encode states, different from the counter contract.

Watch: Tokens on Bitcoin? One Sat Ordinals and sCrypt

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
NBTC

NBTC is the editorial account for NBTC News, covering Bitcoin, Ethereum, DeFi, blockchain infrastructure, exchanges, mining, regulation and digital asset markets. The editorial team focuses on clear sourcing, timely updates and practical context for crypto readers.

Related Posts

Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

08/11/2026

Bitcoin sentiment turns cautious – Yet ONE signal hints at BTC’s local bottom

08/11/2026

Liquid Network at 86% Backing as Bitcoin Redemption Freeze Drags On

08/11/2026

Bitcoin Sees 84,000 BTC Accumulation by Whales

08/11/2026
Add A Comment

Comments are closed.

Top Posts
Get Informed

Subscribe to Updates

Get the latest news from NBTC regarding crypto, blockchains and web3 related topics.

Your source for the serious news. This website is crafted specifically to for crazy and hot cryptonews. Visit our main page for more tons of news.

We're social. Connect with us:

Facebook X (Twitter) LinkedIn RSS
Top Insights

These Finland homes get free heat from bitcoin miners (as long as BTC stays above $70,000)

08/11/2026

Bitcoin Breakout Meets ‘Hard Reset,’ and Global Liquidity Is to Blame

08/11/2026

Threshold Sets tBTC Reconnection Target as Week-Long Pause Continues

08/11/2026
Get Informed

Subscribe to Updates

Get the latest news from NBTC regarding crypto, blockchains and web3 related topics.

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