Skip to content

Consensus Intuition (Longest Chain)

~6 minMedium

Blockchain consensus ensures all nodes agree on the valid chain when multiple versions exist. The "longest chain" rule states that nodes adopt the chain with the most accumulated work (blocks). This prevents double-spending and ensures network convergence.

Watch how nodes follow the longest chain, even when temporary forks occur. The "leader bias" simulates miners with more hashrate producing blocks faster, demonstrating how mining power affects chain growth.

Related Topics: Consensus MechanismsAnatomy of a Block

0.40
What happens each step? One node is randomly chosen (with optional bias) to produce the next block.
Leader bias: raising bias increases the chance the first node becomes producer more often (simulating more hashrate/stake).
Adoption: all nodes adopt the longest chain they see.