After a very uncertain period, the market is finally moving again.
Bitcoin has climbed back to $30k, a very important and symbolic support.
Francesco's Joint is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.
As such, enthusiasm is slowly starting to spark.
Are we really going up?
I switch from max pain to max euphoria a few times a day.
Well, there’s no certainty on where we are right now, but one thing we do know: whenever there’s a market reversal towards the upside after a bottom, Bitcoin is the first asset to rise.
However, the returns of BTC may not be appealing enough for you crazy degens.
This article introduces Stacks, an interesting protocol trying to bring DeFi on top of BTC that may capture a big share of BTC upside.
Stacking Satoshis
The Bitcoin code base is very limited.
This is however to be intended as a feature, not a bug.
Bitcoin works exactly as it is intended to be.The code is written purposely to prioritize security, decentralization, and settlement on the network.
Any other functionality or feature introduced would come to the detriment of those.
Smart contract functionalities would, for example, introduce new logic and consequent risks to the code and the security model of Bitcoin would need to adapt accordingly.
This is an impossible scenario that would weaken the very reason why Bitcoin was created: Bitcoin is relatively slow and minimal by design and conservative in its evolution to preserve these powerful properties.
Therefore, let’s leave Bitcoin alone and just be mindful that everything that whenever people argue that Bitcoin is slow and limited, it helps us sleep better at night knowing that if everything in the world goes to shit we have Bitcoin to save us.
Still, the use case of DeFi and other crypto primitives on Bitcoin is too appealing to just be left alone.
And that’s where Stacks comes in.
What is Stacks?
The easiest way to describe Stacks is as an L2 built on top of Bitcoin both for scalability and for new functionalities: to allow everything that the limited codebase of Bitcoin doesn’t allow.
Stacks was initially launched in 2021 and is a protocol that enables smart contracts and the development of dApps that can leverage Bitcoin as an asset and settle transactions.
Q4 2023 will be a very important year for the protocol as Stacks is expected to release their Nakamoto Release, introducing:
- Bitcoin finality for Stacks transactions (after about 100 blocks): if you are booting up a new Stacks node you can look at Bitcoin history and independently verify if you are on the right chain. After the upgrade, Stacks transactions will be guaranteed by Bitcoin hash rate and finality: reorg resistance.
- sBTC: a decentralized and non-custodian asset pegged 1:1 to Bitcoin, that can run smart contracts faster and cheaper as well as run Atomic swaps.
- Clarity: a new smart contracts programming language
- Knowledge of the Bitcoin state: Stacks will be able to read Bitcoin transactions and state changes and execute smart contracts triggered by Bitcoin transactions (helps consensus and state being consistent with Bitcoin L1)
- Faster and more scalable transactions: including faster Stacks-layer blocks between Bitcoin blocks thanks to Proof-of-transfers, as well as subnets that allow for customization between performance and decentralization
- Fast Blocks: initially Stacks was as fast as Bitcoin (about one block every 10 minutes). With this update Stacks will be able to produce blocks each 5 seconds “in-between” two Bitcoin blocks. Fast blocks can be considered as “cryptographic proofs of passed time”.
In this way:
- The settlement still happens with Bitcoin blocks
- Lower and predictable latency (faster confirmation)Therefore Stacks has 2 types of Blocks:
- Fast Blocks: produced every 5 seconds (BTF quorum)
- Settlement Blocks: produced at each Bitcoin block, have no new transactions, but they settle the recent fast blocks.
- Subnets: scalability and execution framework, allowing customizability based on dApps needs: subnets are designed to allow tradeoffs between throughput and decentralization - while still settling on Bitcoin.A good analogy to explain subnets it to compare Bitcoin to the internet, and subnets to a sort of intranet.Subnets also support multiple execution environments: for instance, a gaming app can become a separate subnet, that does not affect the rest of the application (Vision: scaling in modular layers and sub-networks).Contrary to Avax and Polkadot, Stacks subnets benefit from Bitcoin settlement and security + they can use sBTC, and their contracts can be triggered by Bitcoin transactions.
What is Stacks value proposition?
Bitcoin is now a $590B assets and Stacks wishes to open Bitcoin asset base to DeFi and wider uses, unlocking all the value currently not used efficiently.
Why Bitcoin though?
Bitcoin is the most secure and decentralized cryptocurrency protocol. Nonetheless, the limited expressivity of its language does not allow sophisticated dApps to be built on top of it.
While there are a lot of efforts to extend Bitcoin functionalities, such as RGB, and Lightning, it currently cannot support general-purpose application development.
Stacks wishes to extend and improve what can be done on Bitcoin without affecting the Bitcoin L1 directly.
It wishes to “unlock the deployment of hundreds of billions of dollars of latent Bitcoin capital into applications like decentralized Bitcoin-backed lending, Bitcoin-backed stablecoins, and more”.
Bitcoin is the most secure, durable, and valuable blockchain; it is already used as a store of value by millions of people. It is robust, "hard" money, with unprecedented non-custodial ownership and a lack of inflation. The Bitcoin blockchain is also the best settlement layer for transactions, as it is the most decentralized, censorship-resistant, and durable blockchain.
By building on top of Bitcoin Stacks benefits from :
- Bitcoin Finality and Security: this is a major security upgrade for Satcks. Currently, it has a separate security from Bitcoin, defined as “the BTC capital spent by Stack miners”.
With the Nakamoto Update, after 1 day Stacks’ blocks are secured by the entire hash of the Bitcoin blockchain (unlike in Merge mining).
In order to reorg the Stacks chain and transactions, miners would need to attack and reorg the whole Bitcoin chain.
Furthermore, Stacks blocks are visible on Bitcoin, making it easy to detect possible attacks.
- Smart Contracts triggered by Bitcoin Transactions: Stacks nodes also run Bitcoin nodes as part of their consensus, as such, smart contracts can read Bitcoin states and be triggered by Bitcoin transactions.
- Writing Transactions on Bitcoin: atomic swaps allow dAppas to deploy BTC directly from the Bitcoin chain, and users to swap BTC and other assets on Stacks. The non-custodial pegged BTC introduced by Stacks also does not rely on third parties or a federation, therefore being more decentralized than its predecessors.
- Settlement on Bitcoin: all Stacks tx settle on Bitcoin.
- Bitcoin Liquidity: huge amount of liquidity unitilized.
A Revolutionary Consensus Model: the Proof-of-Transfer (PoX)
Novel consensus mechanism using both Stacks and Bitcoin layers that recycles POW energy.
Similar to Bitcoin POW:
- Miners bid for blocks using previously minted BTC and (if they win) they are rewarded in STX as a block reward. Their possibilities of miners becoming a leader and choosing the new block to commit are weighted according to their bids (BTC you are willing to spend).The amount of BTC bid is the input here (like electricity for POW).
- Stakers can stake STX to participate in the consensus (identify the right chain) and earn BTC rewards.
In practice, POX reuses the electricity used by Bitcoin miners — it does not consume any additional electricity and pays BTC rewards to STX stakers.
Furthermore, the hashes of all Stacks smart contracts and transactions are settled and recorded on the Bitcoin blockchain.
Permissionless: anyone can become a miner. Any holder can lock STX to participate in the consensus and earn BTC rewards.
Stacks has a system of incentives in place to create value for the ecosystem, and disincentivize bad actors — but without slashing.
On-Chain Bitcoin Price Oracle: the price ratio of BTC/STX is always recorded and available on-chain
A graphical representation of the design of the POX consensus:
How is Stacks different than other Bitcoin Sidechain Solutions?
Previous attempts to scale Bitcoin have focused on building sidechains (e.g. RSK, Liquid).
The problem with sidechains is that they have “pegged” to a different blockchain as a 1:1 pegged assets. As such:
- They don’t really interact much with the Bitcoin blockchain itself — aside from when users “peg-in or peg-out” assets to the Bitcoin blockchain.
- No record of them on the Bitcoin blockchain
- Rely on a federation of custodians for peg-outs, sacrificing decentralization
- Rely on merge mining which does not guarantee Bitcoin finality: a merge mining chain is as secure as the amount of Bitcoin miners choosing to mine the sidechain.
Lightning for example, directly interact with Bitcoin and settle transactions on L1.
What would we expect from a Bitcoin L2?
- Secured by Bitcoin hash power
- Can be triggered by Bitcoin transactions
- Can write signed transactions on Bitcoin in a decentralized and trustless manner
- Transaction settlement on Bitcoin (so records are verifiable)
Stacks fulfills most of these objectives:
it has its own global ledger and execution environment, to support smart contracts and to not overwhelm the Bitcoin blockchain with additional transactions.
Furthermore, it also has unique properties and mechanisms such as
- Fast Blocks
- Decentralized Peg
- Subnets
AND, it also has its own native asset: STX.
The STX token and the Positive Feedback Loop
In fact, all previous approaches lacked a native token.
As such there were only a few incentives to support a permissionless system.
What is the point of STX?
A central role in POX consensus:
- Incentivize the mining of Stacks blocks with block subsidies paid (since Bitcoin transaction fees are currently not enough to sustain a new ledger)
- “Liveness incentive and the basis for the economically secured decentralized Bitcoin peg”.
What matters here is that STX does not compete with Bitcoin, but rather is instrumental in strengthening the network.
- The main goal of Stacks is to build an ecosystem of dApps making Bitcoin more efficient and useful.
- This will increase demand for block space and make Bitcoin more valuable.
- Higher transaction fees for Bitcoin miners: more apps = more transactions = more fees
- Stacks mining and settlement on Bitcoin results in high-fee BTC transactions, increasingly important as Bitcoin block rewards decrease.
- Fewer reasons to use other chains
Clarity
It’s pretty hard to bootstrap a new programming language for a protocol.
- Are developers coming and building?
- How hard it is to integrate with third parties?
Stacks is written using Clarity, a programming language deemed to be “much more secure” than Ethereum Solidity.
Clarity is non-turing complete, so devs will already know and predict what programs will do. As such this guarantees the correctness of the code when executed: smart contracts code will be visible on the blockchain, guaranteeing execution safety.
As mentioned, Stacks also leverage subnets, that allow devs to build on EVM or other languages…
sBTC: Scaling Bitcoin
The Problem: to truly use BTC, smart contracts on BTC must be able to modify the Bitcoin state, that is, signing txs on-chain with private keys.
It is, in fact, difficult to perform all updates on-chain on Bitcoin, as this would be slow and expensive.
Let’s have a practical example of the functioning of sBT:
- Users lock BTC in a “Peg wallet” on Bitcoin, issuing an equivalent amount on the other chain (“peg in”)
- Assets can be used as much as possible
- Whenever is desired, an amount is destroyed and an equivalent amount is released back in Bitcoin. This operation is called the peg-out and is the one that allows Stacks to write on Bitcoin.
The main issue with previous Bitcoin solutions is that they all sacrificed decentralization, as most pegs were managed by either centralized custodians or a federation of permissioned entities.
Instead, sBTC:
- Does not rely on centralized entities
- No wrapping fees
- Maintained by a permissionless, open-membership group of dynamically changing entities (with clear economic incentives to maintain the peg): the STX stakers. In fact, a new group of Stacks miners is elected at each new Bitcoin block (about 10 minutes), and they can mine for the Stacks blocks until the next Bitcoin block
Those users lock (“stack” STX) and perform per-out signing.
In return, they are rewarded with BTC (proportionally to staked Stacks).
sBTC also allows Atomic Swaps, since running a Stacks node also provides full visibility into the Bitcoin transactions.
As such Stacks contracts can be triggered on Bitcoin.
Let’s imagine you want to swap BTC to a stablecoin in a fully trustless manner:
you send your BTC on L1, which is swapped for an asset on an L2 in the same transaction, or else the swap will fail.
Food for Thought
Stacks finds itself somewhere in the middle:
- Bitcoiners hate it because of what they do and accomplish
- Non-bitcoiners hate it because they argue that they can already do this stuff on other chains
These are classic Mid-curve comments.
IMHO what matters is what follows:
- Stacks development does not impact Bitcoin settlement layer, nor weakens it
- Like it or not there’s a lot of potential that can be unlocked by introducing more and more possibilities to Bitcoin holders and the way Stacks is moving forward to it while not sacrificing decentralization and settlement of Bitcoin is indeed very interesting.
This is also reflected in a switch in the general thesis about Bitcoin: from 2018-2021 the common thesis was that users liked to build on other chains, and there was not ot much going on on Bitcoin.
Nonetheless, the rise of Ordinals and BRC-20 among others, have contirbuted to a change in this thesis and highlighting new use cases for Bitcoin.
For instance, Bitcoin is now the #2 in terms of NFTs total volume, something totally unimaginable even just 6 months ago.
This is reflected in the number of new tools and wallets being developed to support these emerging use cases. Nonetheless, arguably Bitcoin..
- infrastructure
- tooling
- devs
- infrastructure
- wallets
..need to be much more mature to support Stacks vision.
I am personally looking forward to the Nakamoto upgrade as it will be a gamechanger for Stacks.
Francesco's Joint is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.
All Comments