Bitcoin Network
Oct 29, 2024
The Stacks L2 has significantly unlocked BTC asset productivity via DeFi apps. However, high network latency and slow block finality affect the performance of Stacks blockchain dApps.
The much-awaited Stacks Nakamoto release, which launched on October 29, 2024, promises to address these longstanding issues and, most significantly, achieve 100% Bitcoin finality on the blockchain network.
What Is Bitcoin Finality?
Bitcoin finality refers to the stage at which transactions on the blockchain become irreversible. To change transaction history after finality, you’d need enormous computational power, which is economically unviable.
For example, in a 51% attack, miners gain control of more than 50% of the network’s mining hash rate and can tamper the transaction history. During a bear market in June 2023, an attacker still would have required $7.9 billion and additional infrastructure to execute such an attack.
The initial Stacks design encountered several obstacles such as slow block confirmation times. These infrastructural challenges prevented the L2 network from achieving complete Bitcoin finality. However, the Nakamoto upgrade will offer Stacks 100% Bitcoin finality and Stacks will be able to leverage the complete security benefits of the Bitcoin network.
Challenges with Stacks’ Initial Design
Over the past three years, the Stacks ecosystem has encountered several operational challenges. These challenges revolve around block production, microblock usage, orphaning or removing transactions and miners, and cheap reorganizations.
Slow block times
Originally, the Stacks block production rate was tied to Bitcoin block production in a 1:1 ratio. It takes approximately 10 minutes to produce a Bitcoin block and thus, all Stacks transactions have the same transaction confirmation time. A high confirmation time leads to network latency and slows down Stacks applications.
Ineffective microblocks
Microblocks are a legacy feature of the previous version of Stacks. They received unconfirmed transactions from the mempool and validated them before writing to the Bitcoin blockchain. Although microblocks were originally created to improve Stacks transaction throughput, the protocol could not ensure proper transaction storage in the microblocks. Essentially, there was no consensus procedure to start building from the latest microblock and new miners could remove recently confirmed transactions in the microblocks.
Cheaper block reorganization
Blockchain reorganization, popularly known as reorgs, occurs when validators disagree on the accuracy of a chain and remove existing blocks. Reorgs lead to delayed transaction confirmation, and high node costs, and the blockchain becomes more vulnerable to attacks.
It is cheaper to reorganize the last N blocks in the Stacks chain compared to the Bitcoin network. Thus, malicious miners can reorganize the Stacks chain history and alter transaction history.
How Will Nakamoto Achieve 100% Bitcoin Finality?
The Nakamoto upgrade will introduce three fundamental changes to the Stacks network that will reduce block production time to roughly 5 seconds.
Tenure-based block production
The new update decouples Stacks and Bitcoin’s block production through a tenure-based block production mechanism.
Each Bitcoin block begins a new tenure with a cryptographic sortition procedure. This process uses cryptography for selecting a new miner to validate transactions and create new blocks.
The Nakamoto upgrade enables a single miner to mine several Stacks blocks instead of just one block within the tenure.
To ensure the validity of Stacks block production, Stackers approve each miner's block during their tenure. Moreover, Stackers agree on the last signed block so that the next miner can start building from that block after a tenure change. Such a method also prevents Stacks forks.
Stackers and miners work together to increase transaction speeds and create blocks faster. During each new Bitcoin block, Stacks references the first Stacks block in the previous tenure, thereby ensuring network consistency. This also helps in easy transaction data synchronization between the two chains.
Block finality through indexed block hash
With the Nakamoto upgrade, Stacks writes transaction data to the Bitcoin chain using an indexed block hash. The indexed block hash is the first block hash that the previous Stacks miner mined during their tenure.
During the block commit transaction, miners will add the indexed block hash to the Bitcoin blockchain.
The indexed hash offers Bitcoin finality by resolving miner connectivity issues and provides nodes with updated Stacks chain state copies. Thus, Stackers can prevent Stacks forks and easily identify and recover Stacks transactions affected by Bitcoin reorgs.
At every Bitcoin block N+1, the Stacks chain state is already written to the Bitcoin network till the start of tenure N. So even if malicious actors gain access to Stackers’s signing keys, they cannot rewrite Stacks history without rewriting Bitcoin history.
MEV reduction
Miner Extractable Value (MEV) is a common problem on the Bitcoin blockchain. Essentially, miners can manipulate transaction ordering for more profits. In pre-Nakamoto Stacks, some Bitcoin miners could censor transactions of other Stacks miners to unfairly win block rewards.
However, the Nakamoto upgrade uses a variation of the Assumed Total Commitment With Carryforward (ATC-C) MEV mitigation strategy. The upgrade has also introduced other measures for fair Stacks mining.
For instance, miners must consistently participate in the last ten blocks to qualify for the cryptographic sortition process. Moreover, Stacks reduces extreme bidding behavior by calculating the miner’s winning probability through a median total BTC bid of the last ten blocks. It also includes an absolute bid total for a robust mining environment.
These methods safeguard Stacks against manipulation and reward genuine miners who contribute to the network’s security.
The Importance of Immediate Finality In The Bitcoin Ecosystem
Layer-2 networks like Stacks are crucial for tapping into the value of BTC assets through apps within the Bitcoin economy. These apps must rely on the Bitcoin blockchain’s security to offer maximum protection to users. However, in doing so, apps shouldn’t compromise on speed and efficiency.
The Nakamoto upgrade ensures enhanced transaction settlement speed and facilitates users' use of Stacks for everyday purposes. By guaranteeing 100% Bitcoin finality, Stacks will unlock a potentially booming DeFi economy with BTC-based payment systems, exchanges, and more.