This is Part 2 in the technical article series about Bitcoin covenants by Cointelegraph Research. To read the previous article click here.
OP_CHECKTEMPLATEVERIFY (OP_CTV) was proposed by Jeremy Rubin in BIP 119. It defines spending conditions in a simple template structure that can include the outputs, version, and locktime of the next transaction. The opcode takes a commitment hash as an argument and requires that any transaction executing the opcode include only outputs that match this commitment.
Upon execution, OP_CTV expects this 32-byte commitment hash on top of the stack. The opcode then computes a fresh StandardTemplateHash from the current spending transaction to compare with this commitment hash. The serialized fields that go into the StandardTemplateHash include the transaction version and locktime, the counts of inputs and outputs, and a hash of all outputs, which commits to both their values and their locking scripts (scriptPubKeys). If the transaction matches the template, OP_CTV pushes a 1 on the stack to signal success; otherwise, it pushes a 0 to signal failure.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments