Cointime

Download App
iOS & Android

Unlocking DeFi's Potential on Bitcoin while Preserving Protocol Security and Decentralization

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:

  1. 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).
  2. 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:

  1. Incentivize the mining of Stacks blocks with block subsidies paid (since Bitcoin transaction fees are currently not enough to sustain a new ledger)
  2. “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:

  1. Users lock BTC in a “Peg wallet” on Bitcoin, issuing an equivalent amount on the other chain (“peg in”)
  2. Assets can be used as much as possible
  3. 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:

  1. Stacks development does not impact Bitcoin settlement layer, nor weakens it
  2. 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.

Comments

All Comments

Recommended for you

  • Volume 182: Digital Asset Fund Flows Weekly Report

    First inflows in 5 weeks totalling US$130m, hesitant Ethereum investors

  • Hong Kong Securities and Futures Commission: The Anti-Money Laundering Ordinance applies to the virtual asset industry

    The "virtual currency to ETF" mechanism in Hong Kong has raised concerns about money laundering. The industry believes that the review difficulty, such as KYT (Know Your Token), is high. Some individuals with mainland backgrounds are trying to conduct small-scale "virtual currency to ETF" transactions, taking the opportunity to "whiten" their own holdings of ether and bitcoin through forms such as personal accounts. They have also deployed some virtual currencies to Hong Kong's virtual currency exchanges and will decide whether to increase capital in the future depending on the situation. When responding to relevant questions, the Hong Kong Securities and Futures Commission emphasized that in the operation of ETF products, every link in the entire virtual asset ecosystem, including fund companies, custodians, asset trading platforms, participating brokers, etc., must be licensed or recognized institutions and strictly comply with requirements such as asset custody, liquidity, valuation, information disclosure, and investor education. The "Anti-Money Laundering Ordinance" of the Securities and Futures Commission also stipulates that financial institutions and designated non-financial enterprises and industry personnel must comply with customer due diligence and record-keeping requirements, and relevant regulations apply to the virtual asset industry.

  • TON community member: Some TON wallets received virtual account NFTs starting with "888", which is a phishing project

    On May 13th, according to a member of the TON official community, a new NFT with a virtual number starting with "888" has been added to the TON wallet. However, the transaction fee for each transfer is as high as 1 TON, which is caused by the fishing project changing the Gas.

  • Swiss Crypto Bank Amina: Listing Ethereum as a Security Could Cause Many Crypto Teams to Exit the Space

    Swiss encrypted bank Amina stated in the latest "Cryptocurrency Market Monitoring" report that classifying Ethereum as a security could not only bring risks to the entire cryptocurrency market, but also lead to many cryptocurrency teams exiting the field. This determination could hinder the development of the cryptocurrency market and potentially reverse progress made over the years. In addition, the US SEC is likely to delay its decision on the status of Ethereum, putting the cryptocurrency asset in a "gray area".

  • Ethereum has about $48.05 million in on-chain loan liquidation quota around $2,778

    According to Defi Llama data, there is approximately $48.05 million in on-chain liquidation volume for Ethereum around $2,778.

  • SoftBank Group to invest 10 trillion yen in "AI revolution"

    SoftBank Group (SBG) Chairman and CEO Masayoshi Son's "AI revolution" has begun. SoftBank Group plans to expand its business into industries such as data centers, robots, and power generation using AI semiconductors as a breakthrough. The expected investment amount could reach up to 10 trillion yen (approximately RMB 464.09 billion). American companies such as Microsoft are also making huge investments in the AI field, indicating a trend of global tech giants entering this growing field. (Nikkei News)

  • Ethereum has about $48.05 million in on-chain loan liquidation quota around $2,778

    On May 13th, according to DefiLlama data, there is approximately $48.05 million in on-chain loan liquidation volume for Ethereum around $2778.

  • The Philippine central bank has approved the PHPC, a stablecoin pegged to the peso

    The Central Bank of the Philippines has approved a stablecoin called PHPC, which is pegged to the Philippine peso and aims to promote cost-effective remittances. It is backed by cash and equivalents held by Philippine banks and will initially be launched on the Coins.ph platform, with plans to expand to other platforms. PHPC will be the first retail stablecoin backed by the peso and will offer real-time trading 24/7.

  • GBTC has seen a cumulative net outflow of over US$17.6 billion since the launch of the Bitcoin spot ETF

    On May 12th, according to Farside Investors data, the cumulative net outflow of GBTC since the launch of Bitcoin spot ETF reached 17.6329 billion US dollars. According to Coinglass data, GBTC's asset management scale has decreased to 17.647 billion US dollars.

  • The Ethereum network has currently destroyed more than 4.29 million ETH

    According to Ultrasound data, as of now, the Ethereum network has destroyed a total of 4,290,622.06 ETH. Note: Since the introduction of EIP-1559 in the Ethereum London upgrade, the Ethereum network will dynamically adjust the BaseFee of each transaction based on transaction demand and block size, and this portion of the fee will be directly burned and destroyed.