Skip to content

Instantly share code, notes, and snippets.

@jcnelson
jcnelson / how-stacking-helps-the-network.md
Created November 16, 2021 13:50
How Stacking Helps the Network

PoX can't occur unless the network is sufficiently stable. The only way to get PoX to start for a reward cycle is to confirm a PoX anchor block with 80% confidence within a 100-block window called the "prepare phase." Miners collectively determine the anchor block when they mine blocks that descend from it -- if PoX begins, there will be exactly one Stacks block in which at least 80 of the 100 sortitions in the prepare phase are its descendants. By deciding on an anchor block, miners collectively determine what the PoX reward set will be. But in order to choose an anchor block, they have to have it in their chainstate; otherwise, they'd be unable to mine a block that descends from it. Miners don't know what the anchor block will be until the end of the prepare phase, so this means that they need all of the Stacks blocks in order to begin the next PoX reward cycle (since any Stacks block can be the anchor block -- even one from many reward cycles ago).

At the same time, because Stacks blocks are stored a

@jcnelson
jcnelson / appchains.md
Last active February 2, 2023 05:09
Appchains

Revisions

  • Oct 19 2021: deployed MVP v2 of the appchain mining contract and updated the links and examples in this document to use it instead.

Introduction

Blockchains don't scale. The fact that all nodes process all transactions means that the blockchain only goes as fast as the slowest node allowed on the network. If that's something like a Raspberry Pi, then that's as fast as the blockchain goes.

And that's okay! The upside is that the more people can run nodes, the more resilient the blockchain will be. It's much harder to break a 10,000-node blockchain where most nodes run on home computers all across the world than a 10,000-node blockchain where most nodes run in a few datacenters.