Disclaimer: The contents of this report reflect the author's opinions and are for informational purposes only and are not a recommendation to buy or sell tokens or use the protocol. Nothing in this report is, and should not be construed as, investment advice.

Opening up new possibilities on the Bitcoin network

In early 2023, the introduction of "Ordinals" to the Bitcoin network sparked a new debate on how to treat the network's block space. In May of the same year, the market demand for BRC-20 surged, causing the Bitcoin network to be temporarily unable to process blocks, forcing Binance, the world's largest centralized exchange, to temporarily suspend Bitcoin withdrawals.

Ordinals, named after the word ordinal, meaning "numbers arranged in order", is a protocol created by Casey Rodarmor in January 2023 that adapts Bitcoin Script to enable the ability to attach arbitrary data to the smallest unit of Bitcoin, "sats". Since inscriptions can store text, images, voice, video, and code on the Bitcoin blockchain, it is natural that many PFPs and NFTs have emerged on the Bitcoin ecosystem, just like Ethereum (learn more).

As of April 24, the top 10 NFT collections by market value; Source: Coingecko

Today, more than a year after Odinals came out, three NFT projects issued on the Bitcoin network have made it into the top 10 of all NFT market cap (NodeMonkes, Runestone, and Bitcoin Puppets), demonstrating its potential as a viable smart contract platform.

Bitcoin L2 and Stacks

This has also led to a surge in L2 projects on the Bitcoin network. According to data from defillama, at the time of writing (April 15), there are 11 projects classified as "Bitcoin sidechains" with a total TVL of nearly $900 million. Although there is controversy over whether these projects are actually based on the Bitcoin network as L1, etc., the rapidly growing TVL and number of projects reflect the market's growing interest in the Bitcoin narrative.

Among these projects, Stacks' recent development is unique. Not only is it an OG project launched in 2017, but it has also been aiming to introduce smart contracts to the Bitcoin network since 2021. Below, we will discuss the recent developments of Stacks and the upcoming major upgrade "Nakamoto Upgrade".

The Beginning of Stacks - Blockstack

Munib Ali's 2016 TED talk video; Source: TEDx Talks

In 2017, Dr. Muneeb Ali completed his degree, published a white paper on Stacks (then called Blockstack), and successfully raised $52 million in a token sale on CoinList. Prior to this, he and his early team had built a protocol and application called Onename directly on Bitcoin L1, which could create decentralized identity and profile pages on the Bitcoin network. These experiences helped shape the idea of ​​Stacks in 2017 and inspired the team to create an even more powerful platform.

Blockstack noticed that the existing Internet is overly dependent on centralized data storage and management, so it hopes to use blockchain technology to create a decentralized network that allows users to have sovereignty over their own data and create a blockchain layer that allows developers to easily build dApps, similar to Ethereum.

In 2019, the Blockstack ecosystem’s token Stacks (STX) was approved by the U.S. Securities and Exchange Commission (SEC) under Regulation A+ and successfully raised $23 million. This was the first token sale approved by the SEC, which attracted considerable attention from the market.

From 2018 to 2020, the Stacks team focused on building a solid project infrastructure. Stacks is a cross-chain consensus blockchain that integrates seamlessly with the Bitcoin network and is designed to help program editing functions on Bitcoin. The team also developed a custom programming language Clarity for Stacks. During this period, Stacks raised funds from well-known investors such as Union Square Ventures, Harvard Endowment, Winklevoss Capital, and Naval Ravikant.

Stacks 2.0

"I think Bitcoin is the best and most decentralized currency layer. Currently, 1% of all circulating Bitcoin is issued on Ethereum in the form of wrapped Bitcoin (wBTC), which means that users need to use Bitcoin in smart contracts. Instead of wrapping Bitcoin in a smart contract platform, why not port smart contract functionality to the Bitcoin network?" -- Excerpted from "Bitcoin DeFi? It's a Thing, Says Stacks Founder Muneeb Ali, Decrypt".

In January 2021, Blockstack launched the Stacks 2.0 mainnet, which became the Stacks network. As shown in an interview with Muneeb Ali, the starting point of Stacks 2.0 is to port smart contract functionality to the Bitcoin network without modifying Bitcoin. The design of the chain inherits the decentralization and security of the Bitcoin network, while adding smart contract functionality to improve the scalability of the network.

Proof-of-Transfer

Transfer proof process; Source: stacks.co

Stacks' consensus mechanism, Proof-of-Transfer (PoX), can be seen as an extension of Proof of Burn, and is the key to inheriting the security of the Bitcoin network. Proof of Burn refers to a consensus mechanism in the Proof of Work (PoW) environment that mines by burning cryptocurrencies in the network.

Unlike "Proof of Burn" where miners burn Bitcoin, in "Proof of Transfer", miners send Bitcoin to STX holders who participate in the Stacking process. Miners can participate in the mining process by running Stacks nodes, which use the Bitcoin network as an anchor chain to generate and mine blocks. The transfer proof mechanism is as follows:

  • Registration: Miners register as candidate miners by sending consensus data to the network.

  • Commitment: Registered miners participate in mining by sending Bitcoin to STX token holders.

  • Election: Miners are selected using a verifiable random function (VRF), and the elected miners create new blocks on the Stack blockchain.

  • Assembly: Selected miners create blocks and receive STX tokens as rewards.

Miners selected through the election process need to record the hash values ​​of all new transactions on the Stacks chain in the Bitcoin block, and complete the incentive system for Bitcoin miners and Stackers who maintain the Stacks chain by following the transfer proof. The so-called "Stacking" operation is similar to "Staking" on the Proof of Stake (PoS) network, except that Stacking is rewarded by locking STX to obtain the anchor chain BTC token. The specific roles of miners and Stakers are shown in the figure below:

The roles of miners and stackers; source: stacks docs

[miner]

  1. Miners send BTC to Stacker to receive Stacks’ transaction fees and block rewards.

  2. The probability of each miner being selected through VRF is determined by the proportion of the amount of BTC sent by the miner.

  3. Elected miners earn the right to create new blocks and stream microblocks on the Stacks chain.

  4. The elected miners receive STX and transaction fees as block rewards.

[Stacker]

  1. Stacker locks the STX it holds for a certain period.

  2. You can choose to stack independently or stack together with other stackers (pooling).

  3. Stacker provides his own BTC address to claim BTC rewards, and the probability of claiming rewards is proportional to the amount of locked STX.

  4. Stacking’s STX will be unlocked after the lock-up period set at the beginning.

Bitcoin L2?

The significance of Stacks 2.0 is that Stacks will be able to function as a smart contract platform on the Bitcoin network with the launch of the mainnet and the introduction of the transfer proof mechanism. However, there is some controversy about calling it L2 on the Bitcoin network.

  • Stacks 2.0 has its own token and an independent security budget, which is completely different from the Bitcoin network.

    • Security Budget: refers to the resources allocated to maintain the integrity of the network, including mining reward funds, operating costs, network fees, etc.

  • In L1, assets are not deposited or withdrawn by security and validators, like L2 in Ethereum and other ecosystems.

For the reasons mentioned above, it is difficult to classify Stacks 2.0 with traditional L2. However, Stacks can hardly be called a sidechain because transactions on the Stacks chain must ultimately be settled on the Bitcoin network. This unique structure of the Stacks chain led Stacks co-founder Muneeb Ali to call it "Layer 1.5" in an interview with Decrypt in 2021.

Since the Bitcoin network did not start out as a smart contract platform, there have been no moves to introduce smart contracts or improve scalability like there have been with Ethereum and the EVM chain. Refer to the article "BITCOIN LAYERS - Tapestry of a Trustless Financial Era" published by Spartan Group in December 2023 to learn more about how to distinguish Bitcoin L2.

Bitcoin L2’s trilemma; Source: BITCOIN LAYERS — Tapestry of a Trustless Financial Era

As shown in the figure above, the Bitcoin L2 trilemma includes:

  1. Open Network: Adopt an open network rather than a consortium model.

  2. No New Token: No new tokens will be introduced.

  3. Full VM/Global State: Uses "Global State" instead of limited off-chain contracts.

Stacks can be seen as a Bitcoin L2 solution that satisfies conditions 1 and 3, but not condition 2. In contrast, the Lightning Network satisfies conditions 1 and 2, but fails to meet condition 3 due to its "local consensus" method of recording transactions on a peer-to-peer network separate from the main chain.

Towards Stacks 3.0, Nakamoto Upgrade

Stacks existing problems

The unique structure of the Stacks chain described above is the reason why Stacks can function as a smart contract platform on the Bitcoin network, but it also brings some problems to the system, including:

  • Security Model

    • The Stacks chain has an independent security budget, which is different from the security budget of the Bitcoin network, which is defined by the BTC paid by Stacks miners.

    • This makes the security of the chain highly dependent on the budget of Stacks miners, meaning the potential for increased security risks.

  • Performance and Scalability

    • The connection structure between the Stacks chain and the Bitcoin network (such as the transfer proof mechanism) helps improve decentralization and security, but limits on-chain performance and scalability.

    • In particular, the process of creating new blocks through miner election ties the Stacks chain to the Bitcoin block generation cycle, resulting in very high transaction confirmation delays.

    • This is not only a loophole in user experience, but also the root cause of the difficulty in developing Stacks dApps.

  • MEV Problem

    • Bitcoin miners with a significant percentage of Bitcoin hash rate can review commitment transactions (transactions that transmit BTC in order to participate in STX mining) sent by other Stacks miners in the Bitcoin blocks they mine, thereby ensuring that they receive Stacks rewards and transaction fees.

Main goals and design changes

main target

The Nakamoto version is a major upgrade of the Stacks chain planned for this year to solve the above-mentioned problems of the Stacks chain and improve the performance and security of the chain.

  • Fast blocks

    • The time it takes for a transaction submitted by a user to be mined and confirmed within a block is shortened from tens of minutes to a few seconds.

    • After the Nakamoto upgrade, by separating the miner election process from the block generation mechanism, miners are allowed to generate multiple blocks before the next miner election process.

  • Transaction security through Bitcoin’s finality

    • Transactions on the Stacks chain are secured by the hashing power of the Bitcoin network.

    • This means that transactions are settled on the Bitcoin network, guaranteeing the immutability of transactions on the most secure network.

  • Improve anti-MEV function

    • Improved the BTC bidding mechanism for STX rewards to address the MEV issue in the miner election process.

    • Changed the miner election algorithm so that Bitcoin miners do not have an advantage over Stacks miners.

Changes to block generation mechanism and Stacker role

Before the Nakamoto upgrade, the ratio of blocks generated on the Stacks chain to Bitcoin blocks was fixed at 1:1, resulting in slow block generation time and transaction confirmation time.

After the Nakamoto upgrade, the "Tenure-based block production" mechanism will be introduced to speed up block generation. A block in the Stacks chain is no longer 1:1 corresponding to a Bitcoin block, but miners can generate multiple Stacks blocks during the term of the elected miner (that is, during the Bitcoin block generation cycle). This mechanism shortens the block generation and confirmation time to about 5 seconds, greatly improving the scalability of Stacks.

The Stacks blocks generated at this time will be verified by Stackers. Before the Nakamoto upgrade, Stackers only locked (Stacking) STX tokens to contribute to the economic security of the Stacks network, but after the Nakamoto upgrade, Stackers will take on the role of signers, responsible for verifying, storing, signing, and propagating each Stacks block generated during the miner's term. The relationship between miners and Stackers is shown in the following figure:

How miners and Stackers (or signers) interact after the Nakamoto upgrade; Source: stacks docs

  1. Miners send BTC to Stakers to participate in the Stacks miner election process.

  2. When a new miner is elected, a "tenure change" transaction occurs, granting the new miner a new term.

  3. Miners must collect signatures from Stakers every second when creating and verifying blocks.

  4. Block verification requires at least 70% of Stackers to sign and approve the block.

As shown in the figure above, miners need the signature of the Stacker to create the next block, and the Stacker needs to perform a signature operation to obtain rewards under the transfer proof mechanism and unlock the STX tokens he stacked.

Changing the chain structure to achieve Bitcoin’s finality

The signer (Stacker) prevents miners from arbitrarily forking the Stacks chain by signing only the latest generated block during term changes (or miner elections). This means that the Stacker is responsible for supervising miners, verifying previously generated blocks, and ensuring that new blocks are generated based on the latest blocks.

In addition, when a miner submits a transaction (term change transaction), it must include the indexed block hash, which includes the hash of the first Stacks block recorded during the previous miner's term and the hash of the block itself. This ensures that the state of the Stacks blockchain is recorded in the Bitcoin block, and each miner works the same way to ensure that the history of the Stacks blockchain is continuously recorded on the Bitcoin network.

Diagram of the relationship between Bitcoin blocks, Stacks blocks, and inventory bitmaps; Source: stacks docs

Therefore, the relationship between Stacks blocks and Bitcoin blocks is shown in the figure above. Transactions submitted in the Nth period on the Stacks chain will not be recorded in the Bitcoin block until the next two periods, that is, the N+2th period, which means that it will take three term changes before reversing Stacks transactions is as difficult as reversing Bitcoin blocks. From the user's perspective, the structure of the chain is the same as the L2 we are familiar with, and transactions can be confirmed within a few seconds, while the settlement in Bitcoin takes a longer time of about 30 minutes.

This system also brings a positive change to the security budget of the Stacks chain. The mechanism of Stacks block verification occurs through the signature of at least 70% of Stackers, which increases the security budget of Stacks to 70% of Stacking assets, and once the transaction achieves the final settlement of Bitcoin, the security budget can reach 51% of Bitcoin mining power.

To summarize the Stacks mechanism after Nakamoto's upgrade:

  • When a miner submits a term change transaction, it must include an index block hash value and the first block hash value recorded in the previous term.

  • The signer will force the miner to generate the next block based on the last block signed in the previous term.

  • Transactions submitted during the Nth term will be written into the Bitcoin block during the N+2th term, with Bitcoin finality.

After the Nakamoto upgrade, the transaction speed of the Stacks chain will be greatly improved, and at the same time, the finality of Bitcoin will be achieved, ensuring the immutability of data. For users, this means faster transaction confirmation speed, and for the system, it is closer to the real Bitcoin L2, inheriting the security of Bitcoin.

Solving the Bitcoin MEV Problem

Before the Nakamoto upgrade, the MEV problem in the Stacks chain occurred mainly in the following way. Bitcoin miners with a considerable proportion of Bitcoin hash rate, such as F2Pool, were able to review the submitted transactions submitted by other Staking miners within the Bitcoin block to adjust the BTC bid amount they submitted to ensure that they can obtain the block rewards and transaction fees of the Staking block. This behavior reduces the BTC rewards of Stakers and also undermines trust in the mining process.

The Nakamoto upgrade introduces several new miner selection criteria to improve the fairness of the block mining process.

  • Miners participating in recent blocks

    • Miners must have a record of participating as miners in the last 10 blocks to be eligible to be selected when the term changes.

    • The standard could promote stability in the miner community and discourage attempts to steal blockchain rewards.

  • Consider the median of past bids (Median of Past Bids Method)

    • The probability of a miner being selected is calculated based on the median of all BTC bids recorded in the past 10 blocks.

    • This standard prevents miners from obtaining block rewards by submitting abnormal bids.

  • Consider the absolute value of the bid total (Absolute Bid Total)

    • The miner selection process is based on stable economic criteria that considers the absolute value of the sum of bids, rather than considering bid variables based on the immediate mining environment.

By introducing these MEV-proofing standards, the Nakamoto upgrade will increase transparency and trust in the mining process on the Stacks blockchain.

Planning Nakamoto Upgrades

Nakamoto upgrade roadmap; Source: nakamoto.run

Since the release of the sBTC and Nakamoto white papers at the end of 2022, the Stacks Foundation and related developers have been working on the Nakamoto upgrade for a long time. As shown in the figure above, since the Nakamoto function was finalized and integrated into the testnet in February 2024 (called Nakamoto milestone 0.3, codenamed Argon), the update of the Nakamoto upgrade has been in full swing. The first phase of the Nakamoto upgrade is now online on the mainnet, and the upgrade will be launched in succession.

The Nakamoto upgrade consists of two phases, each of which will be a hard fork. The process is divided into two phases, "Instantiation" and "Activation", with the purpose of allowing a period of time after the Nakamoto update before fully activating the function to make final adjustments, such as fixing bugs, to eliminate interference caused by changes in the chain environment.

Original plan

  • Phase 1: Instantiation (starting April 22)

    • The POX-4 (upgraded version of the Proof of Transfer mechanism) contract and most of the code contained in the Nakamoto version will be applied, but the functionality will not be enabled.

    • At least two stacking cycles are left for signers and partners to register the POX-4 contract. During this period, it is verified whether the signers who registered the POX-4 correctly verified the blocks and whether they can enter the activation phase.

  • Phase 2: Activation (expected to take place between May 15 and May 29)

    • This phase will apply the Nakamoto updates, including the signer-based system, fast blocks and Bitcoin finality, and activate the Nakamoto rules.

    • The Nakamoto rule refers to the overall logic that distinguishes before and after the Nakamoto upgrade.

Nakamoto launch schedule; Source: Nakamoto Launch: Testnet and Mainnet Rollout Overview

Changes in plans

The first phase of the upgrade (instantiation) started on April 22, and assuming no major bugs are found and the instantiation is completed, the second phase is scheduled to start in mid-May. However, after the start of the first phase, some flaws in the signer recovery system (Signer Resiliency/Recovery) were discovered, so the Stacks Foundation announced on May 1 that the original plan would be modified. The main points are as follows

  • The initial activation phase of the Nakamoto upgrade will only include a basic signer recovery system.

  • The plan to upgrade to the Advanced Signer Recovery System was to deploy in late 2024 after the Nakamoto upgrade was activated, but after signers were onboarded and progressed during the instantiation phase, it was determined that an Advanced Signer Recovery System was needed.

  • Therefore, 8 weeks of development time will be added before the Nakamoto upgrade activation phase, with the signer recovery system code completed on July 15 and the Nakamoto upgrade version activated on August 28.

  • Work content

    • Enhance miners’ resilience to signature timeouts and signer errors

    • Strengthen signer response and key loss process

    • Improved the way miner terms are created and extended

    • Improved prevention of network uncertainty and flash block handling

revised Nakamoto release timeline; Source: stacks.org

According to the revised plan, code development will be completed on July 15, 8 weeks later, and the activation phase of the Nakamoto upgrade, originally scheduled for mid-May, will begin on August 28, about 3 months later. The good news is that the sBTC upgrade originally scheduled for the third quarter will not be postponed and is expected to take place in the fourth week after the activation phase begins.

sBTC - The final piece of the puzzle to achieve L2

The Nakamoto upgrade is expected to be fully activated in May, and its purpose is to significantly improve the performance of the Stacks chain and achieve Bitcoin finality for Stacks blocks. However, to truly become L2 of the Bitcoin network, the Nakamoto upgrade is only half the battle.

Standards for distinguishing Bitcoin L2; Source: light tweet

After the release of the Nakamoto upgrade, Stacks will have an environment similar to Sovereign Rollup. However, it can only function as a true Bitcoin smart contract platform and L2 if BTC, the native asset of the Bitcoin network, is brought into the chain and utilized. In the same tweet, Stacks founder Muneeb Ali said that moving BTC in and out of the Bitcoin Layer is the hardest part, and explained that sBTC is the closest solution to a trustless bridge, a decentralized group of public signers that can perform a peg mechanism on BTC without modifying Bitcoin L1.

sBTC builds a bridge between the Bitcoin network and the Stacks chain based on two main properties:

  • 1:1 Redeemability: sBTC and BTC are always redeemable at a 1:1 ratio unless the Stacks chain ceases to function.

  • Open membership: Anyone can join the sBTC protocol, and no centralized entity can control BTC.

Previously, there were BTC-related assets such as xBTC and aBTC on the Stacker chain, such as Ethereum's wBTC (wrapped BTC), but they were based on a bridge method that required multi-party signatures through a centralized custodian. sBTC uses Stacker as a group of signers on the transfer proof mechanism to achieve BTC bridging in a trustless manner.

How sBTC works (1); Source: stacks docs

How sBTC works (2); Source: sbtc.tech

The update and implementation of sBTC is scheduled for the third quarter of 2024. The Nakamoto upgrade and the update of sBTC are key milestones in Stacks' ambition to become the preferred smart contract platform for the Bitcoin network. We can continue to pay attention to Stacks to see if it can truly become Bitcoin L2 and use a smart contract platform to effectively utilize the still dormant BTC.

来源:BITCOIN LAYERS — Tapestry of a Trustless Financial Era

<References>

  • Stacks docs

  • Stacks: A Bitcoin Layer for Smart Contracts

  • sBTC: Design of a Trustless Two-way Peg for Bitcoin

  • Jeff Benson and Daniel Roberts, Bitcoin DeFi? It’s a Thing, Says Stacks Founder Muneeb Ali, Decrypt

  • Katelyn Peters, Blockstack (Stacks): What it is, How it Works, FAQ, Investopedia

  • muneeb.btc tweet

  • light tweet

  • Stacks, A Showcase For Stacks Nakamoto Release Transactions

  • Stacks, What’s Next for Stacks After Nakamoto Upgrade

  • The Spartan Group, Bitcoin Layers: Tapestry of a Trustless Financial Era

  • Mitchell Cuevas, Nakamoto Activation: 8 Weeks of Additional Development Time Expected, Stacks Foundation