Beginner Lesson 3 4 min read

A blockchain: a ledger that everyone copies

It is not a magic database. It is a list of linked blocks that anyone can verify from the first to the last — and that becomes expensive to rewrite with each new block.

The word has become synonymous with the future and is now marketed to track lettuce, record diplomas, and sign contracts. It's worth starting with what it is, because it's much less mysterious than the hype: a list.

A list of blocks, in order, each carrying the transactions that entered it. The first of these was created on January 3, 2009, and is called the genesis block. Since then, the network has added more than nine hundred thousand, one every ten minutes on average, without ever stopping. Reading the list from start to finish is to read everything that has ever happened in Bitcoin.

What separates this list from any ordinary file is how one block is linked to the previous one. Each block carries in its header the hash of the block that came before it.

A hash is a kind of digital fingerprint of content. You provide a text, a photo, or an entire block, and the function always returns a number of the same size. Change a comma in the input, and the result comes out completely different—not similar, different. And there is no way back: with the fingerprint in hand, no one can reconstruct what produced it. This function has a lesson of its own in the intermediate track; for now, the effect is enough.

The effect is this. Since the next block holds the digital fingerprint of the previous one, altering anything within an old block changes its fingerprint, which no longer matches the one recorded in the block above. And since this is also recorded in the next, the break runs to the end of the list. You can't edit the past silently. You can rewrite it, redoing that block and all that came after it—which costs everything it took to build them, while the rest of the network continues building the next ones.

Each block carries the digital fingerprint of the previous one. Altering one breaks the seal of all the following ones.

The idea didn't originate in 2008. In 1991, Stuart Haber and Scott Stornetta published a method for timestamping digital documents by chaining their hashes, and the company they founded spent years printing the weekly summary in the classified section of the New York Times. The newspaper was the witness: millions of printed and distributed copies, impossible to collect. Changing the past would require changing every copy in the world. Bitcoin does the same thing without relying on any newspaper.

Changing the past would require collecting all the newspapers already distributed.

The second half is missing, and it's what supports the first. The record doesn't reside in one place. Tens of thousands of computers each maintain their complete copy, today around seven hundred gigabytes, and anyone with a regular machine and a disk can download theirs. It's not a copy based on trust: each one verifies everything it receives, from the genesis block onward, and only accepts what checks out.

Tens of thousands of complete copies, each verified from the first block onward.

This multiplication is what makes censorship expensive. Erasing a transaction would require erasing it from all copies simultaneously, and as long as one survives, the list can be reconstructed. Banning the network in a country removes the computers from that country and doesn't alter a line of what's written.

And it's also what answers who is in charge. A miner with a lot of computing power chooses which transactions enter the block he assembles, and nothing beyond that. He can't make an invalid block be accepted: if the block spends the same coin twice, creates bitcoin out of thin air, or breaks any other rule, each computer that receives it simply discards it and continues on the previous chain. It has happened. On August 15, 2010, a flaw allowed a block to create 184 billion bitcoins. It was detected within hours, corrected, and the chain containing that block was abandoned by those running the corrected version.

A block that breaks the rules is discarded by each node that receives it, no matter how costly it was.

To be fair to the buzzword: chaining hashes is genuinely useful whenever parties that don't trust each other need to agree on an order without an arbiter. That's precisely why most of the announced applications don't need it: when there's a company responsible for the record—and there is, in lettuce and diplomas—a common database is cheaper and equally reliable because the trust was already there.

One question remains: if adding a block is what makes the past costly, who adds it and why does it cost? That's the next lesson.