Proof-of-Work Mining Simulator illustration

Proof-of-Work Mining Simulator

A hands-on proof-of-work laboratory using real SHA-256. Mine live: edit a block’s transactions, set the difficulty in leading zero bits and watch the miner grind through nonces at thousands of hashes per second until one hash clears the target — then chain the next block onto it. Tamper with a finished 4-block chain and see every later block turn invalid instantly, because each block commits to the previous hash; re-mining them in order shows the cumulative work an attacker must redo. A third panel measures the probability side: expected attempts double with every difficulty bit (2^bits), an empirical histogram of attempts shows the huge geometric spread around that average, and the classic random-walk formula plots an attacker’s chance of catching up from k blocks behind at a given share of the hashrate.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Mining is a lottery, not a puzzle: each nonce is an independent coin flip with success probability 2^-bits. Attempts follow a geometric distribution — finding a block in 10 hashes or 4× the expected number is perfectly normal, as the histogram shows.
  • One more difficulty bit doubles the expected work. Bitcoin’s ~76 leading zero bits mean around 10²² hashes per block — this simulator’s 8–24 bits are the same mechanism at a millionth-of-a-trillionth scale.
  • The chain is tamper-evident, not tamper-proof: anyone can rewrite a block, but every descendant must then be re-mined. Honest nodes simply follow the chain with the most cumulative work, so an attacker must outrun the entire network.
  • The catch-up probability is a biased random walk: with attacker hashrate share q < ½ it decays like (q/(1−q))^k — exponentially in the deficit k. That is why exchanges wait for confirmations, and why q ≥ ½ (a 51% attack) means certain success.
  • Runs 100% in your browser — keys and data never leave your device.