Close Menu
StreamLineCrypto.comStreamLineCrypto.com
  • Home
  • Crypto News
  • Bitcoin
  • Altcoins
  • NFT
  • Defi
  • Blockchain
  • Metaverse
  • Regulations
  • Trading
What's Hot

Rutherford Chang Retrospective: Hundreds And Thousands At UCCA Beijing

February 4, 2026

NVIDIA Nemotron Models Power Enterprise Document AI for Finance and Legal

February 4, 2026

Pepe Dollar emerges as a leading crypto to buy now over Maxi Doge, Dogeball token and Based Eggman

February 4, 2026
Facebook X (Twitter) Instagram
Wednesday, February 4 2026
  • Contact Us
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms of Use
  • DMCA
Facebook X (Twitter) Instagram
StreamLineCrypto.comStreamLineCrypto.com
  • Home
  • Crypto News
  • Bitcoin
  • Altcoins
  • NFT
  • Defi
  • Blockchain
  • Metaverse
  • Regulations
  • Trading
StreamLineCrypto.comStreamLineCrypto.com

Bitcoin Covenants: TXHASH And CHECKTXHASHVERIFY(BIP 346)

April 18, 2025Updated:April 18, 2025No Comments7 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Bitcoin Covenants: TXHASH And CHECKTXHASHVERIFY(BIP 346)
Share
Facebook Twitter LinkedIn Pinterest Email
ad


That is the third article in a sequence deep diving into particular person covenant proposals which have reached a degree of maturity meriting an in-depth breakdown.

TXHASH and CHECKTXHASHVERIFY (TXHASH), put ahead by Steven Roose and Brandon Black with a BIP quantity presently unassigned, is a “template primarily based” covenant that may conceptually seen as an extension or extra superior model of CHECKTEMPLATEVERIFY (CTV). 

Earlier than stepping into the nitty gritty of how TXHASH works, let’s refresh on the items of information in a Bitcoin transaction. 

At a excessive stage you’ve got the outputs, the inputs, and the witness (or script sig for non-Segwit transactions within the enter). 

International transaction fields:

  • Model
  • Marker, indicating Segwit with a flag worth
  • Flag, indicating Segwit with a flag worth
  • Enter rely
  • Output rely
  • nLocktime, used for timelocks

Every enter incorporates:

  • TXID of the earlier transaction
  • VOUT (index) of the output from that transaction being spent
  • ScriptSig dimension
  • ScriptSig (if a non-segwit transaction)
  • Sequence quantity (used for RBF flagging and relative timelocks).

Every output incorporates:

  • Quantity of satoshis assigned to the output
  • ScriptPubKeySize, the scale of the locking script
  • ScriptPubkey, the precise locking script

We will ignore the witness subject when contemplating TXHASH or CHECKTXHASHVERIFY as neither opcode constrains the witness subject to retain sure properties. 

How TXHASH Works

Each TXHASH (tapscript solely) and CHECKTXHASHVERIFY (legacy script and tapscript) have completely different behaviors on the stack due to the variations between legacy script and tapscript. For the needs of this text, these variations should not materials, so we’re merely going to disregard them.

If CTV is a covenant opcode that constrains a bitcoin output to solely be spent in a singular and precisely outlined manner, TXHASH is a supercharged model of CTV that allows you to decide and select precisely what items of a transaction are constrained and have to be spent within the precisely pre-defined manner, and which items of a transaction will be no matter somebody desires at spending time. 

It provides you the very best of each worlds, requiring one thing be performed when spending a covenant restricted coin, however then permitting a consumer to do no matter they need with the remainder of the funds obtainable to them or the transaction they’re crafting. 

That is achieved utilizing the ‘TxFieldSelector’. 

CTV merely makes use of a single hash of the pre-defined transaction with the intention to confirm at spending time. With TXHASH, you want a solution to talk what items of knowledge that hash is committing to, and what items of knowledge it isn’t. That’s the TxFieldSelector’s job. 

TxFieldSelector is actually a sequence of bytes (that may be variable in size), with every bit speaking what fields in a transaction are dedicated to by the hash that shall be verified in opposition to. This lets you choose particular fields of the transaction, nLocktime, model and so forth. It lets you choose particular fields of the inputs and outputs, i.e. embody or not the sequence quantity, or the earlier output id, or the taproot annex (a datafield particular to taproot scripts). The outputs, whether or not to decide to the ScriptPubkey, the quantity values, each, or neither. You may also resolve precisely which outputs and inputs these restrictions apply to. 

There’s some complexity and suppleness in how the TxFieldSelector is put collectively, and you may learn all of the finer particulars right here within the proposed BIP in case you’re excited by these, however the chief level to remove is it permits you to decide precisely which elements of the transaction are restricted by the covenant when somebody goes to spend the encumbered output, and which elements should not, to a really granular diploma. 

What Is TXHASH Helpful For

Firstly, TXHASH permits you to do every thing which you can with CTV. So all the worth supplied by CTV to optimize the coordination prices of something presently potential with pre-signed transactions can also be supplied by TXHASH. However it supercharges that functionality massively. As an alternative of getting to decide to the whole thing of a transaction, you may commit to only the elements you care about. 

This has two massive advantages in idea proper off the bat. To begin with, in band price administration for layer twos turns into simpler to cope with. At present using anchor outputs is required to fee-bump layer two settlement transactions with Baby Pays For Dad or mum, the place a transaction spending an output from an unconfirmed one can add to the web charges for each. TXHASH enables you to decide to solely your counterparties outputs in a multiparty transaction, and go away yours free to do no matter you need with (caveat right here that different issues have to be performed to make this secure so a 3rd social gathering can’t burn all your funds to charges), together with decrementing barely to RBF the transaction. 

Second, the door is now open for multiparty protocols to permit granular ensures about what off-chain transactions are committing to. Some customers can now obtain a assure about how their cash shall be spent, however not should care about what another group of customers does with theirs. I can ensure that one TxFieldSelector ensures my cash are dealt with correctly, and I don’t should care about the place anybody else’s cash go. 

Together with CHECKSIGFROMSTACK (CSFS), TXHASH can facilitate a very generalized SIGHASH system. The SIGHASH flag is part of a signature that communicates what elements of the transaction to test the signature in opposition to. They’re presently: 

  • SIGHASH_ALL – indicators all inputs and outputs
  • SIGHASH_NONE – indicators all inputs and no outputs
  • SIGHASH_SINGLE – indicators all inputs and the output with the identical index as this enter

None of those SIGHASH flags enable including any new inputs to a transaction with out invalidating them, however every has an ANYONECANPAY model that solely indicators its personal enter and the suitable outputs, permitting anybody else to then add new inputs, and new outputs for the ANYONECANPAY model of SIGHASH_NONE and SIGHASH_SINGLE.

By having the ability to “sideload” new TxFieldSelectors utilizing CSFS, customers can emulate a SIGHASH system that permits them to select and select precisely which particular person items of a transaction the signature commits to or not. 

TXHASH additionally permits imposing equality between the worth of inputs and outputs through the use of particular person TxFieldSelectors that commit solely to a single worth subject of an enter or output you want to examine, after which making certain their hashes are the identical on the stack. 

Closing Ideas

TXHASH is a possible supercharging of CTV, enabling an extremely granular diploma of introspection of the spending transaction which will be extremely highly effective, particularly together with one thing like CSFS. 

Nonetheless, that energy is expressive sufficient that it opens up the door to an extremely massive design area. One that would probably have a fabric impact on the general incentives of Bitcoin. Issues like making certain quantity equality throughout outputs or inputs is getting very near the territory of what’s wanted for trustless automated trade on-chain. That may be a critical supply of Miner Extractable Worth (MEV), which has been a really critical incentive and centralization drawback for different blockchains to cope with. 

TXHASH ought to completely not be dismissed, because it offers extremely highly effective primitives for protocol builders to make the most of, the potential second order implications of what individuals will construct with it ought to be weighed in opposition to the positives.



Source link

ad
Bitcoin CHECKTXHASHVERIFYBIP Covenants TXHASH
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Related Posts

Rutherford Chang Retrospective: Hundreds And Thousands At UCCA Beijing

February 4, 2026

NVIDIA Nemotron Models Power Enterprise Document AI for Finance and Legal

February 4, 2026

Pepe Dollar emerges as a leading crypto to buy now over Maxi Doge, Dogeball token and Based Eggman

February 4, 2026

Hyperliquid beats Bitcoin, XRP with double-digit gains

February 4, 2026
Add A Comment
Leave A Reply Cancel Reply

ad
What's New Here!
Rutherford Chang Retrospective: Hundreds And Thousands At UCCA Beijing
February 4, 2026
NVIDIA Nemotron Models Power Enterprise Document AI for Finance and Legal
February 4, 2026
Pepe Dollar emerges as a leading crypto to buy now over Maxi Doge, Dogeball token and Based Eggman
February 4, 2026
Hyperliquid beats Bitcoin, XRP with double-digit gains
February 4, 2026
Bitcoin-native USDT protocol joins CTDG Dev Hub
February 4, 2026
Facebook X (Twitter) Instagram Pinterest
  • Contact Us
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms of Use
  • DMCA
© 2026 StreamlineCrypto.com - All Rights Reserved!

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