How does Stacks relate to Bitcoin?

written by Stephane Marbeau

How does Stacks relate to Bitcoin?

You’ll often hear that Bitcoin is an asset, while Ethereum is more like an operating system. Stacks claims to combine the best of both worlds, by offering complex smart contracts “secured by” the Bitcoin blockchain. But what does that even mean? Here’s how Stacks relate to Bitcoin, in simple terms. 🗝

TL;DR

  • Stacks is a way to bring DeFi to Bitcoin without changing Bitcoin’s code
  • Stacks is a smart contract layer-1 protocol that runs on a new consensus mechanism called proof-of-transfer (PoX)
  • PoX implies that Stacks’ security and existence depend on the Bitcoin blockchain

Buy Bitcoin

Buy Stacks

What’s Stack’s proof-of-transfer?

Since blockchains are decentralized, they don’t have a central authority to guarantee the integrity of their data. Instead they use consensus mechanisms to coordinate their different nodes. You might be familiar with “proof-of-work,” the consensus mechanism Bitcoin runs on, and with “proof-of-stake,” the mechanism used by plenty of altcoins. Stacks, however, relies on a new consensus mechanism called proof-of-transfer (PoX). 

PoX anchors Stacks to the Bitcoin blockchain and allows it to not only benefit from the network’s proven security, but also to recycle the computational energy used to mine new bitcoins. Stacks miners don’t need special hardware since they only use the stored energy of Bitcoin. 

Here’s how PoX works:

  1. Miners transfer bitcoin to stackers for a chance to win transaction fees and block rewards.
  2. The winning miner is selected programmatically based on the amount of bitcoin they transferred, relative to the total amount all of the other miners transferred.
  3. Each block of Stacks transactions corresponds to a single bitcoin transaction — so there is only one Stacks transaction block per bitcoin block. 

More of a visual learner? Here’s a handy 3mn video explaining how PoX works.

Thanks to PoX, Bitcoin acts as a rate-limiter for creating Stacks blocks, which prevents denial-of-service-attacks on its network. Any blockchain could write a hash of its transactions to a bitcoin block, though, so how does this mechanism secure Stacks?

How is Stacks secured by Bitcoin?

The difference between Stacks and other blockchains is that while other chains might choose to hash a block of their transactions on the bitcoin blockchain, Stacks has to. That’s because Stacks doesn’t have its own proof-of-work or proof-of-stake consensus mechanism. The only way to mine, the only way to confirm new transactions, and the only way to reach consensus is to secure the record of the Stacks chain state on the bitcoin chain.

To revise the current Stacks history would require revising the Bitcoin chain via a 51% attack. And this is all because the mechanism which governs the difficulty and rate of an attack on Stacks is — drumroll, please — Bitcoin itself! This is what makes Bitcoin the ultimate source of truth for Stacks and its final settlement layer. This is how the NFTs, dApps, DeFi protocols, and smart contracts running on Stacks are secured by Bitcoin.

As MattySTX noted, this architecture is close to Satoshi Nakamoto’s early insight that it is possible to have “a completely separate network and separate blockchain, yet share CPU power with Bitcoin”. 💡

Building Bitcoin DeFi

In fact, it’s because Stacks is a separate blockchain that it can offer expressive smart contracts without requiring changing Bitcoin’s codebase. 

There are lots of ongoing efforts to allow for more complex smart contracts directly on the Bitcoin blockchain. However, since Bitcoin’s security is crucial, these changes require extreme scrutiny and can only be adopted if they reach a wide consensus in the community. For instance Taproot, Bitcoin Core’s latest major upgrade, took about four years to be implemented. These upgrades rely on open source developers, who are funded on a voluntary basis. Okcoin has already contributed $1.25 million to supporting their efforts — and there’s more to come.

Stacks, thanks to its PoX mechanism and to its Clarity smart contract language, can move quicker. In just over one year, it has already given way to DAOs, CityCoins, DeFi (with Alex and Arkadiko), NFTs, and much more. 

Far from being opposite, these efforts are working towards the same goal: improving and building on the world’s first crypto network. We’re looking forward to 2022 being the year where both Bitcoin open source developers and Stacks developers build the next layer of the Bitcoin-centric Internet. 🌊

Buy Bitcoin

Buy Stacks

Leave a Reply

Your email address will not be published.