This blog is now an archive. Find content from Hiro here and Stacks news and announcements here.

Video: Reusing Bitcoin’s hashpower to launch the Stacks blockchain

How an open blockchain arrives at consensus over the state of its ledger is a key element not just for security of the system but also for scalability. We presented the initial ideas for how consensus will work in our Stacks blockchain in our white papers. Here’s a summary in plain language along with a video with Stacks blockchain Core Developer Jude Nelson explaining this system during his presentation in Hong Kong for the Decentralizing the World Tour.

Rather than risk bootstrapping a new proof-of-work blockchain, and instead of working with the limitations and issues inherent to proof-of-stake consensus, the Stacks blockchain uses a novel proof-of-burn consensus mechanism to bootstrap. This mechanism reuses the hashpower of an established blockchain like Bitcoin. There is a path available to slowly transition away from Bitcoin as the hashpower on the new Stacks blockchain builds up.
​​
First the basics.

In traditional cryptocurrency mining, like we see with Bitcoin and many other cryptocurrency networks, the economic cost imposed on miners is the actual electricity, hardware, etc. needed to do the proof-of-work calculations. This makes it more and more costly (as the network hashrate increases) to tamper with transaction data entering the blockchain. This is a great security model which has worked well—as Bitcoin has demonstrated.

Rather than try to mimic that success, the Stacks blockchain builds on it. Instead of expending electrical and hardware costs, participants in proof-of-burn consensus do just that—they provably destroy (or “burn”) their own bitcoin as the economic cost for their participation. Every participant competing for the opportunity to write the next block must burn a certain amount of proof-of-work token (bitcoin) to enter the competition. A participant’s likelihood of winning the competition increases with the percentage of bitcoin they burn compared to other participants. The competition’s winner writes the block, collects transaction fees, and earns the block reward of Stacks tokens.

Safely bootstrapping the Stacks blockchain:

The Stacks blockchain has its own memory-hard proof-of-work process but initially, a very small (5%) weight is given to it and the majority of the weight (95%) is given to Bitcoin’s proof-of-work. This 5%-95% threshold is tunable and is our mechanism to safely bootstrap a new blockchain while not being tied to Bitcoin in the long run. As the Stacks blockchain starts to get significant hashpower there is a path available (by changing the tunable threshold) to reduce the percentage for Bitcoin and slowly transition away from it.

How miners write new blocks:

The next Stacks block is chosen via cryptographic sortition. In each Bitcoin block, the burns from each participant are used to calculate a probability distribution that gets sampled via a verifiable random function (VRF) — the VRF gives us a random sample from the probability distribution that picks the winner.

A good way to understand the process is to imagine how a dart thrown at a dart board at random will “select” a pie slice on it. At each epoch, the protocol chooses the next block roughly as follows:

  • The protocol constructs a “dartboard” with pie slice sizes proportional to each distinct chain tip that got burned for.
  • The VRF is like a dart — when “thrown” at the board, it will select one of the burners’ chain tips. The more burned for a chain tip, the bigger its slice on the dart board, the higher the chance the VRF-dart has of hitting it.
  • The VRF-dart gets“thrown” in the previous epoch — when a new block is generated, the Stacks miner “throws the next dart”.
  • The positions of the pie slices on the dart board are randomized by the proof-of-work solution itself. This is necessary because it prevents the Bitcoin miners from “moving the pie slices” to where the VRF-dart will strike (something that Bitcoin miners can tell in advance, but no one else can). Using the proof-of-work solution to randomize their positions effectively prevents Bitcoin miners from gaming the system — Bitcoin miners literally don’t have time to try more than one randomization induced by a PoW solution, since it takes them ~10 minutes to find a PoW solution in the first place.

Censorship resistance:

The system is designed so that neither Stacks miners nor Bitcoin miners can influence the choice of the next block by spending additional energy. The only way the outcome can be influenced is by Bitcoin miners censoring transactions — and even then, selectively censoring transactions can only slow down (but not stop) the Stacks blockchain.

But what if I spend a lot of bitcoin and don’t get rewarded?

The same thing that happens to all those Bitcoin miners who spend all that electricity but lose the block race — it’s irrevocably wasted. If you contribute 90% of all burns in an epoch, there’s still a 10% chance that you will lose (but your Bitcoin is destroyed either way). It must be this way, since otherwise a Stacks miner could “recycle” their burns and build many competing forks (i.e. the Stacks miner could become a Sybil node and work on many parallel forks for marginal cost).

It’s worth noting though; the burns aren’t truly “wasted” — they still improve the chain quality since their (wasted) burns get used to calculate a “burn quota” which helps slow down attackers.

We are building this system because it would be fruitless to compete with Bitcoin on network security though proof-of-work. Instead, we are piggybacking on the most secure blockchain in a way that the cost of mining is only paid once. This way the decentralized web gets the benefits of being verified by people acting out of rational economic self interest.

Version 2 of the Stacks Blockchain is currently under development and there are two open SIPs or Stacks Improvement Proposals for this new consensus algorithm and smart contract system.

Stacks blockchain Core Developer Jude Nelson explained this system in his talk at Blockstack Hong Kong. Here is a video of his presentation:

Jude Nelson

Jude Nelson

Jude Nelson earned his PhD in computer science at Princeton and worked as a core member of PlanetLab, which received the ACM Test of Time Award for enabling planetary scale experimentation and deployment. His research covered wide-area storage systems and CDNs. 10+ years of Vim usage.