A plain-language explainer Ledger · Hash · Chain · Consensus

What is a blockchain?

A shared record book. Thousands of strangers keep identical copies, pages are only ever added to the end, and each page carries a fingerprint of the one before it — so altering old history breaks every seal that follows.

The problem01

Digital money has a copying problem

A photo can be copied a million times and every copy is as good as the original. That is harmless for photos and fatal for money: if a coin is just a file, you could spend it twice.

  1. SHOP Awaiting

    No payment yet.

  2. SHOP Bwaiting

    No payment yet.

  3. LEDGERnone

    Nothing records who has spent what.

Banks solve this by keeping the ledger themselves: they check every payment against their own records. Bitcoin, launched in 2009, solves it with no bank at all. Thousands of strangers each keep a copy of the ledger, and the rest of this page shows how they agree on it, and why nobody can quietly rewrite it.

Definition02

Three properties do all the work

A blockchain is a database with three unusual rules. Everything else — mining, keys, confirmations — exists to defend one of them.

  1. I

    Everyone holds a copy

    No master server. Each full node stores the whole history and checks new entries itself. Losing one copy loses nothing.

  2. II

    You may only add to the end

    Entries are grouped into blocks and appended in order. Nothing is edited or deleted — a refund is a new entry, not an erased one.

  3. III

    Tampering is obvious

    Each block carries a fingerprint of the one before it. Change old history and the fingerprints stop matching, in public, on every copy.

Not “unhackable.” Tamper-evident: you can still lie, you just can’t do it quietly.

Inside a block03

What one block actually contains

A real entry: the first block of Bitcoin, mined 3 January 2009. A block is mostly bookkeeping — a pointer backwards, a summary of its contents, and proof someone did the work to seal it.

BLOCK 0 · “THE GENESIS BLOCK” 2009-01-03 18:15:05 UTC
prev_hash
0000000000000000000000000000000000000000000000000000000000000000 All zeros. Nothing sits behind it — the chain starts here.
merkle_root
4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b One hash summarising every transaction. Change any of them and this changes.
transactions
1 Its single transaction carries a message: “The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.”
nonce
2083236893 A throwaway number. Miners try billions until the block’s hash comes out small enough.
hash
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f The block’s fingerprint. Those leading zeros are the proof of work — the only way to find them is to guess.
Going deeper: how one hash can summarise thousands of transactions
MERKLE ROOT H( AB + CD ) H( A + B ) H( C + D ) tx A tx B tx C — edited tx D transactions pair hashes only this path re-hashes
One field commits to everything. Transactions are hashed in pairs, then those hashes are hashed, up to a single root. Edit one transaction and only its path to the root changes — which is also how a phone can prove one payment was included without downloading the other few thousand. (The genesis block has only one transaction, so its root is simply that transaction’s hash.)
Fingerprints04

A hash is a fingerprint you can’t run backwards

A hash function turns any input into a fixed-length string. Same input, same result. No practical way to work backwards from the output to the input. And one changed character scrambles the whole output.

SHA-256 outputhighlighted: differs from the hash of “Hello”
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Publish a block’s fingerprint and nobody can quietly swap out what’s inside — anyone can recompute it in microseconds and see.

The chain05

Why it is a chain, not a list

Every block stores the hash of the block before it. That one field is the chain: each fingerprint depends on the block’s own contents and on all the history behind it.

BLOCK 812 PREV_HASH 0000…4b71c2 HASH 0000…a93f10 BLOCK 813 PREV_HASH 0000…a93f10 HASH 0000…7e02dd BLOCK 814 PREV_HASH 0000…7e02dd HASH 0000…c518a4 copies the hash of the block before it copies the hash of the block before it
The link is one field. Block 813’s prev_hash is a copy of block 812’s hash — so verifying the chain is just recomputing hashes and checking each quote.

Now tamper with it yourself

Here is a tiny chain of four real, mined blocks: every hash starts with 0000. You play a cheat trying to rewrite one payment.

Step 1 of 3 · Tamper

Change any amount in the boxes below, for example make Ben pay Cai 100 instead of 0.1.

    Rewriting history compounds. The edited block’s fingerprint changes, and because the next block quotes it, that fingerprint changes too, all the way to the end. To make your edit stick you must re-mine every block after it, while the honest network keeps extending the real chain. That race is what “immutable” means.

    Who decides06

    Who decides which version is real?

    Hashing catches tampering but settles no arguments. When two blocks conflict, the rule is simple: the valid chain with the most accumulated work behind it wins, and nodes reject anything that breaks the rules, whoever sent it.

    What “work” means — mine a block yourself

    There is no clever method. A miner changes the nonce and re-hashes, over and over, until the hash happens to start with enough zeros. Your browser manages somewhere around a hundred thousand guesses a second (watch the counter below). Bitcoin’s whole network makes around 900 million trillion every second, billions of billions of times more.

    Target: hash must start with 0000
    What’s being hashedthe nonce is the only part that changes
    block 813 | Ana pays Ben 0.4 | prev 0000a93f10 | nonce ?
    Press Mine to start guessing.
    0attempts
    —hashes / sec
    65,536expected attempts

    Each extra zero makes it 16 times harder. Bitcoin currently needs about 19.

    Every run starts from a random nonce, so each time you press Mine the answer, and how long it takes, will differ. Run it a few times: some runs finish almost instantly, others take several times the average. That unpredictability is why no miner can “queue up” to win.

    Why would anyone burn electricity on this? The miner who seals a block is paid in newly created bitcoin: 3.125 BTC per block since the April 2024 “halving”. The reward halves roughly every four years, which is why there will never be more than 21 million bitcoin. Miners also collect the fees attached to the transactions they include.

    Bitcoin uses this proof of work. Some newer chains use proof of stake instead; Ethereum switched in 2022. Rather than burning electricity, validators lock up coins as a deposit and are picked at random to propose blocks. If they cheat, they lose part or all of that deposit (“slashing”).

    The security argument is economic, not magical: attacking has to cost more than it pays. Control a majority of mining power or stake and you can rewrite recent blocks — the 51% attack — which is why a chain with few participants is a weak one.

    One payment07

    What happens when you send one

    Five steps, every time. On Bitcoin the first confirmation takes about ten minutes on average.

    1. You sign it

      Your private key signs “pay Ana 0.4”. Anyone with your public key can verify it came from you. Lose the key and the funds are gone; there is no reset link.

    2. It is broadcast

      The signed transaction spreads node to node. Each node holds it in its mempool, a waiting room for payments not yet in a block.

    3. Someone bundles it

      A miner picks transactions (usually the highest-fee ones) and builds a block containing the previous block’s hash.

    4. They seal it

      They grind through nonces until the block’s hash hits the target, then broadcast it. Everyone else re-checks every signature and hash before accepting.

    5. Confirmations pile up

      Each block built on top makes reversal exponentially less likely. On Bitcoin nothing is ever strictly final; it just becomes absurdly expensive to undo.

    Attacker holds 10% of the power Attacker holds 30%
    Why six blocks. Satoshi Nakamoto’s original paper computes the odds an attacker catches up from z blocks behind. Against a 10% attacker, six confirmations put reversal at about 1 in 4,000 — which is roughly where the six-block habit comes from. Against a 30% attacker, reaching that same odds takes 29 blocks, nearly five hours of waiting.
    Table view
    Trade-offs08

    Bought at a real price

    Every property above costs speed, storage and privacy. A blockchain is a deliberately inefficient database: thousands of machines redo the same work and every full node stores every byte forever. That redundancy is the product.

    Worth it when

    • Nobody can be the operator. Parties who distrust each other still need one agreed record.
    • The audit trail is the point. Anyone can verify the whole history from scratch.
    • Censorship is the threat. No single party to pressure or shut down.

    Not worth it when

    • Throughput matters. Bitcoin settles roughly 3–7 transactions a second; card networks can handle tens of thousands.
    • Data is private. Public chains publish everything, permanently.
    • Mistakes need fixing. No undo, no support line, no chargeback.
    Check yourself09

    Four questions

    Tap an answer. Wrong answers explain themselves; keep going until you hit the right one.

    1. Someone edits one payment in a block from last year. What happens?

    2. At 4 zeros your mining run took 150,000 guesses. Your friend’s took 9,000. Who did it wrong?

    3. Why do people selling something big often wait for six confirmations?

    4. An attacker controls 51% of all mining power. Which one can they not do?

    Balance—
    The whole argument, in one line

    If you trust the operator, use a database.

    A blockchain is what you build when nobody will agree on who the operator should be — and every cost on this page is the bill for that one disagreement.