Saturday, October 18, 2025
No Result
View All Result
Blockchain Broadcast
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • NFT
  • Blockchain
  • Metaverse
  • DeFi
  • Web3
  • Analysis
  • Regulations
  • Scam Alert
Crypto Marketcap
Blockchain Broadcast
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • NFT
  • Blockchain
  • Metaverse
  • DeFi
  • Web3
  • Analysis
  • Regulations
  • Scam Alert
No Result
View All Result
Blockchain Broadcast
No Result
View All Result

Bitcoin Covenants: CHECKSIGFROMSTACK (BIP 348)

April 4, 2025
in Bitcoin
Reading Time: 6 mins read
0 0
A A
0
Home Bitcoin
Share on FacebookShare on Twitter


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

CHECKSIGFROMSTACK (CSFS), put ahead by Brandon Black and Jeremy Rubin with BIP 348, just isn’t a covenant. As I stated within the introductory article to this sequence, a few of the proposals I’d be masking usually are not covenants, however synergize or interrelate with them in a roundabout way. CSFS is the primary instance of that. 

CSFS is a quite simple opcode, however earlier than we undergo the way it works let’s have a look at the fundamentals of how a Bitcoin script truly works. 

Script is a stack primarily based language. That implies that knowledge is “stacked” collectively on high of one another on the stack, and operated on by eradicating an merchandise from the highest of the stack to function on primarily based on what an opcode does, both returning the info or a end result from it to the highest of the stack. 

There are two elements of a script when it’s finally executed and verified, the “witness” offered to unlock the script, and the script included within the output being spent. The witness/unlocking script is “added” to the left aspect of the locking script, after which every component is added to (or operates on) the stack one after the other left to proper. Have a look at this instance (the “|” marks the boundary between the witness and script):

1 2 | OP_ADD 3 OP_EQUAL

This instance script provides the worth “1” to the stack, then the worth “2” on high of that. OP_ADD takes the highest two parts of the stack and provides them collectively, placing the end result again on to the stack (so now all that’s on the stack is “3”). One other “3” is then added to the stack. The final merchandise, OP_EQUAL, takes the highest two objects of the stack and returns a “1” to the stack (1 and 0 can symbolize True or False in addition to numbers).

A script should finish with the final merchandise on the highest of the stack being True, in any other case the script (and transaction executing it) fails and is taken into account consensus invalid. 

It is a primary instance of a pay-to-pubkey-hash (P2PKH) script, i.e. the legacy addresses that begin with a “1”:

<signature> <pubkey> | DUP HASH160 <pubkey-hash> EQUALVERIFY CHECKSIG

First the signature and the general public key are added to the stack. Then DUP is known as, which takes the highest stack merchandise and duplicates it, returning it to the highest of the stack. HASH160 takes the highest stack merchandise (the general public key duplicate), hashes it, then returns it to the highest of the stack. The general public key hash from the script is placed on high of the stack. EQUALVERIFY capabilities the identical as EQUAL, it grabs the 2 high stack objects and returns a 1 or 0 primarily based on the result. The one distinction is EQUALVERIFY additionally runs VERIFY after EQUAL, which fails the transaction if the highest stack merchandise just isn’t 1, and likewise removes the highest stack merchandise. Lastly CHECKSIG is run, which grabs the highest two stack objects assuming them to be a signature and a pubkey, and verifies the signature implicitly towards the hash of the transaction being verified. Whether it is legitimate it places a 1 on high of the stack. 

How CSFS Works

CHECKSIG is likely one of the most used opcodes in Bitcoin. Each transaction, with virtually no exceptions, makes use of this opcode in some unspecified time in the future in one among its scripts. Signature verification is a foundational part of the Bitcoin protocol. The issue is, there may be virtually no flexibility when it comes to what message you might be checking the signature towards. CHECKSIG will solely confirm a signature towards the transaction being verified. There may be some flexibility, i.e. you’ll be able to determine with a point of freedom what elements of the transaction the signature applies to, however that’s it. 

CSFS goals to alter this by permitting a signature to be verified towards any arbitrary message that’s pushed straight onto the stack, as an alternative of being restricted to the verification of signatures towards the transaction itself. The opcode follows a really primary operational construction:

<signature> <message> | <pubkey> CSFS

The signature and message are dropped on high of the stack, then the general public key on high of them, and eventually CSFS grabs the highest three objects from the stack assuming them to be the general public key, message, and signature from high to backside, verifying the signature towards the message. If the signature is legitimate, a 1 is positioned on the stack. 

That’s it. A easy variant of CHECKSIG that lets customers specify arbitrary messages as an alternative of simply the spending transaction. 

What Is CSFS Helpful For

So what precisely is that this good for? What’s the usage of checking a signature towards an arbitrary message on the stack as an alternative of towards the spending transaction? 

Firstly, together with CTV it may well present a performance equal to one thing that Lightning builders have wished for the reason that very starting, floating signatures that may connect to completely different transactions. This was initially proposed as a brand new sighash flag for signatures (the sphere that dictates what elements of a transaction a signature applies to). This was wanted as a result of a transaction signature covers the transaction ID of the transaction that created the output being spent. This implies a signature is simply legitimate for a transaction spending that precise output. 

It is a desired habits for Lightning as a result of it could enable us to put off channel penalties. Each previous Lightning state wants a penalty key and transaction with a purpose to be sure that your channel counterparty by no means makes use of any of them to attempt to declare funds they don’t personal. If they fight you’ll be able to declare all their cash. A superior performance could be one thing that lets you merely “connect” the present state transaction to any earlier one to cease the theft try by distributing funds accurately versus confiscating them. 

This may be achieved with a primary script that takes a CTV hash and a signature over it that’s checked utilizing CSFS. This might enable any transaction hash signed by that CSFS key to spend any output that’s created with this script. 

One other helpful characteristic is delegation of management of a UTXO. The identical method that any CTV hash signed by a CSFS key can validly spend a UTXO with a script designed for that, different variables will be handed into the script to be checked towards, resembling a brand new public key. A script might be constructed that enables a CSFS key to log off on any public key, which then might be validated utilizing CSFS and used for a traditional CHECKSIG validation. This might permit you to delegate the flexibility to spend a UTXO to anybody else with out having to maneuver it on-chain. 

Lastly, together with CAT, CSFS can be utilized to compose rather more complicated introspection performance. As we’ll see later within the sequence although, CSFS just isn’t truly required to emulate any of this extra superior habits, as CAT alone is in a position to take action. 

Closing Ideas

CSFS is a really primary opcode that along with providing easy helpful performance in its personal proper composes very properly with even the most straightforward covenant opcodes to create very helpful performance. Whereas the instance above relating to floating signatures particularly references the Lightning Community, floating signatures are a usually helpful primitive which can be relevant to any protocol constructed on Bitcoin making use of pre-signed transactions. 

Along with floating signatures, script delegation is a really helpful primitive that generalizes far past delegating management over a UTXO to a brand new public key. The identical primary potential to “sideload” variables after the actual fact right into a script validation circulate can apply to something, not simply public keys. Timelock values, hashlock preimages, and so on. Any script that hardcodes a variable to confirm towards can now have these values dynamically added after the actual fact. 

On high of that, CSFS is a really mature proposal. It has an implementation that has been stay on the Liquid Community and Parts (the codebase Liquid makes use of) since 2016. As well as Bitcoin Money has had a model of it since 2018. 

CSFS is a really mature proposal that goes again conceptually virtually so long as I’ve been on this house, with a number of mature implementations, and really clear use instances it may be utilized to. 



Source link

Tags: BIPBitcoinCHECKSIGFROMSTACKCovenants
Previous Post

Malta Issues $1.2 Million Fine to OKX for Past AML Failures amid MiCA License

Next Post

A New Meme Coin Emerges

Related Posts

XRP Stalls Below Key Resistance, But Setup Aligns For An Elliott Wave Finish
Bitcoin

XRP Stalls Below Key Resistance, But Setup Aligns For An Elliott Wave Finish

October 18, 2025
Every Penny Gone: Retired Therapist’s Portfolio Wiped out in Crypto Trap
Bitcoin

Every Penny Gone: Retired Therapist’s Portfolio Wiped out in Crypto Trap

October 18, 2025
Ripple Just Embedded XRP Into The World’s Treasury Plumbing
Bitcoin

Ripple Just Embedded XRP Into The World’s Treasury Plumbing

October 17, 2025
DOGE Price Breaks Key Support: Is Alt Run No More?
Bitcoin

DOGE Price Breaks Key Support: Is Alt Run No More?

October 17, 2025
A Privacy-First Bitcoin Wallet For All, Now Available Globally On IOS
Bitcoin

A Privacy-First Bitcoin Wallet For All, Now Available Globally On IOS

October 17, 2025
Why The Dogecoin Price Could Still Hit A 600% Rally To Send It Above .5
Bitcoin

Why The Dogecoin Price Could Still Hit A 600% Rally To Send It Above $1.5

October 17, 2025
Next Post
A New Meme Coin Emerges

A New Meme Coin Emerges

Wait… tariffs are good for Bitcoin

Wait… tariffs are good for Bitcoin

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Facebook Twitter Instagram Youtube RSS
Blockchain Broadcast

Blockchain Broadcast delivers the latest cryptocurrency news, expert analysis, and in-depth articles. Stay updated on blockchain trends, market insights, and industry innovations with us.

CATEGORIES

  • Altcoin
  • Analysis
  • Bitcoin
  • Blockchain
  • Crypto Exchanges
  • Crypto Updates
  • DeFi
  • Ethereum
  • Metaverse
  • NFT
  • Regulations
  • Scam Alert
  • Uncategorized
  • Web3
No Result
View All Result

SITEMAP

  • About Us
  • Advertise With Us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact Us

Copyright © 2024 Blockchain Broadcast.
Blockchain Broadcast is not responsible for the content of external sites.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
  • bitcoinBitcoin(BTC)$106,804.001.77%
  • ethereumEthereum(ETH)$3,882.174.67%
  • tetherTether(USDT)$1.000.03%
  • binancecoinBNB(BNB)$1,110.746.42%
  • rippleXRP(XRP)$2.356.27%
  • solanaSolana(SOL)$186.305.82%
  • usd-coinUSDC(USDC)$1.000.00%
  • staked-etherLido Staked Ether(STETH)$3,879.414.68%
  • tronTRON(TRX)$0.3127832.16%
  • dogecoinDogecoin(DOGE)$0.1873725.69%
No Result
View All Result
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • NFT
  • Blockchain
  • Metaverse
  • DeFi
  • Web3
  • Analysis
  • Regulations
  • Scam Alert

Copyright © 2024 Blockchain Broadcast.
Blockchain Broadcast is not responsible for the content of external sites.