What is blockchain
Suggest an editYou now have the cryptographic primitives: hashes, keys, signatures and Merkle trees. Standing alone, none of these is a blockchain. This lesson builds the structure up from scratch, using only the parts you already have.
Many parties need one list, and none of them trusts the others
You want a shared record of facts, a list of "this happened, then this happened, then this happened." Many parties around the world need to agree on the contents of that list. None of them trusts any of the others, and there is no central authority they can all defer to.
So the task is to build a list of facts that everyone can read, anyone can append to, and nobody can secretly edit. A blockchain does this with a few simple structural choices, layered one on top of the next.
A plain list has no defence against edits
You need to record a list of items, in order. The word items is just a placeholder. We haven't said yet what they are. The list grows over time as new items are added.
A naive list would look like this:
item 1
item 2
item 3
item 4
...This works for one person on one computer. The problem starts when the list is shared. If you mail me a copy and I quietly change item 2 to say something different, you have no way to tell from my copy that anything is wrong. The list has no built-in defence against tampering.
Each block carries the hash of the one before it
Apply what you learned about hashing. Group items into batches called blocks, and let each block carry the hash of the previous block.
[Block 1: items] → [Block 2: items, prev_hash] → [Block 3: items, prev_hash] → ...This is where the name comes from: blocks, linked into a chain. As the hashing lesson showed, changing anything in an old block changes its hash, so the "previous hash" field of the next block no longer matches. Each hash covers the one before it, so the hash of the latest block depends on every block in the chain, and two people can check that their copies are identical by comparing that one hash.
Each block also carries a 32-byte Merkle root of its items, so a single item can later be checked against the block without downloading all of them. The block's header contains just this root plus the previous-block hash plus a few small bits of metadata such as a timestamp. In Bitcoin the header is 80 bytes even when the block contains thousands of items.
The chain needs other copies to compare with
The hashes do not stop me from editing my own copy. I can change item 2 and then recompute the hash of that block and of every block after it. Hashing is fast, so this is easy, and afterwards my copy is consistent again and nothing inside it shows the edit. The edit shows only when my copy is compared with yours, because the hashes differ from the edited block onwards.
So every party in the network holds a full copy of the chain. Instead of a few servers or a centralised database, thousands of independent computers each run the same software, each hold the same data, and each verify every new block against the same rules. Tampering with one copy doesn't change any other.
The chain is the data structure. The network is the set of machines, called nodes, that all hold the same copy of it.
A blockchain is a hash-linked chain of blocks copied on every node
A blockchain is a replicated, append-only, hash-linked sequence of blocks. Every node holds the same copy, and each block's hash binds it to all the blocks before it, so the structure is tamper-evident even though no central authority maintains it.
Two things are still open. Comparing copies shows that they differ, but not which one to keep. And anyone running the software can produce a new block that points at the current tip of the chain, so two nodes can produce two different new blocks at roughly the same time. The mechanism that settles both is called consensus, and it gets its own lesson: Why we need consensus.
Everything else you'll meet in the rest of this course (transactions, smart contracts, tokens, mining, staking) is what people put inside the items, or what they build on top of the chain once they trust its contents.