Start here · Five minutes
How a blockchain works
A ledger copied across thousands of computers, extended by a rule everyone can check, where changing the past would mean redoing everything after it.
- BlockA batch of transactions
- HashA fingerprint that changes if anything changes
- NodeA computer that holds and checks the whole ledger
Start with a list of transactions. Group them into a block. Take a fingerprint of the block, a hash, which is a fixed-length number computed from the contents so that any change to the contents changes the fingerprint completely. Put that fingerprint into the next block.
Now every block contains the fingerprint of the one before it. Change a transaction in block 500 and its fingerprint changes, which means block 501 no longer matches, and so on to the present. That is the chain, and it is why the past is expensive to alter.
Who decides what goes in the next block
This is the part that needed inventing. Thousands of computers hold the ledger and must agree on the next block without trusting each other and without a coordinator. The rule for deciding is called consensus, and there are two main ones, described in proof of work versus proof of stake.
Both work the same way at the level that matters: adding a block requires spending something real, either electricity or capital at risk, and the network rewards whoever does it honestly.
Why anyone can check it
Every node holds the full ledger and validates every block against the rules. A block containing an invalid transaction, a double spend or an incorrect reward is rejected by every honest node. The rules are enforced because anyone can run a node and verify, not because an authority says so.
This is also the reason blockchains are slow. Every node verifies everything, so capacity is limited by what an ordinary computer can handle. Making the chain faster by requiring powerful nodes means fewer people can verify, which gives away the property that made it worth doing.
What it is good and bad at
Good at: recording who owns what without a trusted operator, settling value transfer across borders, running code that nobody can stop or alter, and proving that a record existed at a point in time.
Bad at: speed, privacy, storing large data, and anything where the information entering the ledger is unverified. A blockchain guarantees that a record was not altered, not that it was true when written.
Terms used here
Read next
Long reads that use this
Tokens & Crypto
Ethereum
The computer that cut its power bill by 99 percent
In September 2022 Ethereum swapped its consensus mechanism while running, with billions of dollars on it, and nothing broke. What that bought, and what it cost, is still being worked out.
Tokens & Crypto
Layer 2
The second floor
Ethereum decided not to get faster and to let other networks do the work instead. Fees fell by an order of magnitude, and the ecosystem acquired a fragmentation problem it has yet to solve.
Tools