Home▸Cryptography▸Blockchain Consensus — Proof-of-Work Mining & Forks (2D)

⛓️ Blockchain Consensus — Proof-of-Work Mining & Forks (2D)

A 2D chain-of-blocks diagram: real toy proof-of-work mining with an adjustable difficulty target, live nonce search, and a real longest-chain fork resolution you can trigger yourself.

Cryptography2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-blockchain-consensus ↗ Open standalone

About this 2D Blockchain Consensus companion

This is a 2D companion to the 3D Blockchain Consensus simulator. It keeps the same real mechanics — a toy but genuine string-hash of each block's data, previous hash and nonce, a real proof-of-work nonce search against an adjustable difficulty target, and a real longest-chain fork-resolution rule — drawn as the canonical chain-of-linked-boxes diagram used to teach blockchain consensus.

Use Mine new block to run one real nonce search and append a block to the chain, or flip Auto-mine to keep mining continuously. Create fork spawns a rival branch off the current tip's parent that mines in parallel with its own nonce search; whichever branch pulls ahead in height becomes canonical, and the losing branch's blocks are marked orphaned — exactly the rule real proof-of-work networks use to agree on a single history.

⚙ Under the hood

Run a real toy proof-of-work mining loop: search for a nonce against an adjustable difficulty target, watch a genuine chain of hash/prev-hash-linked blocks grow, and trigger a real fork that gets resolved by the longest-chain rule.

blockchainproof of workconsensusminingcryptography

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)