Blockchain Simulator

Understand how blockchain works by mining blocks, building chains, and seeing what happens when data is tampered with.

How It All Connects

Blockchain is the foundational technology behind Bitcoin, Ethereum, and many other cryptocurrencies. At its core, it combines three simple ideas into something remarkably powerful:

1. Hash — The Digital Fingerprint

A hash function takes any input and produces a unique, fixed-size output. It is a one-way function: you cannot reverse it to find the original data. Even changing a single character produces a completely different hash. This is the foundation of everything that follows.

2. Block — Data + Proof-of-Work

A block packages data together with a block number, a nonce, and a hash. The "mining" process means trying millions of nonce values until you find one that produces a hash starting with a certain number of zeros. This computational effort is called proof-of-work — it makes creating a valid block deliberately expensive.

3. Blockchain — The Immutable Chain

A blockchain links blocks together by including the previous block's hash inside each new block. If anyone changes the data in an earlier block, its hash changes, which breaks the link to the next block — and every block after it. To "fix" the chain, an attacker would need to re-mine every subsequent block faster than the rest of the network adds new ones. This is what makes blockchain tamper-proof.

Scroll down to try each concept yourself — from simple hashing to a full blockchain with mining and chain validation.

Step 1: Hash Function

A hash function takes any input and produces a fixed-size output (a 256-bit SHA-256 hash). Even a tiny change — a single character — completely changes the output. This is called the "avalanche effect".

Type anything in the box below and watch the hash change instantly. The output is always 64 hex characters, no matter the input length.

The information stored in this block — in real blockchains, this would be transactions.

The SHA-256 fingerprint of all the block's contents combined. Changes if any input changes.

e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Step 2: Block Mining

A block bundles data with a block number, a nonce, and the previous block's hash. Mining finds a nonce that makes the hash start with the required number of leading zeros — the proof-of-work.

Try changing the difficulty and clicking "Mine". Higher difficulty = more leading zeros = exponentially more computation. This is why Bitcoin mining requires enormous power.

The number of leading zeros required in the hash. Each additional zero makes mining ~16x harder.

The sequential position of this block in the chain.

A number that miners adjust to find a valid hash. "Mining" means trying nonces until the hash meets the difficulty target.

The information stored in this block — in real blockchains, this would be transactions.

The SHA-256 fingerprint of all the block's contents combined. Changes if any input changes.

0000000000000000000000000000000000000000000000000000000000000000
✓ Valid

Step 3: The Blockchain

Each block contains the hash of the previous block, creating an unbreakable chain. If you change data in any block, its hash changes and every subsequent block becomes invalid.

Click "Mine Blockchain" to mine all 5 blocks. Then try editing data in an earlier block — watch the chain break from that point forward. You can re-mine individual blocks to repair it, but in a real network this would be computationally impossible.

This is what makes blockchain immutable: altering history requires re-doing all proof-of-work for every subsequent block, faster than the entire network can produce new ones.