How Blockchains Work
What problem does a blockchain solve?
Imagine you and a friend keep score in a game, but you each write the score on your own paper. If there is a disagreement, who is right?
A blockchain solves this by giving everyone the same paper, and making it so nobody can erase what was already written.
In the real world, this matters for money. If Alice sends $100 to Bob, how do both sides know the money actually moved? Today, a bank keeps the record. A blockchain replaces the bank with math and thousands of computers.
Blocks: bundles of transactions
A blockchain is, quite literally, a chain of blocks.
Each block is a container. It holds a list of recent transactions — "Alice sent 2 ETH to Bob," "Charlie sent 0.5 ETH to Diana," and so on. A typical Ethereum block holds a few hundred transactions.
Notice the blue text: each block's "Previous hash" matches the hash of the block before it. This is what creates the chain. If you change even one character in Block #1, its hash changes completely, and Block #2's "Previous hash" would no longer match. The chain breaks.
Hashes: digital fingerprints
A hash is a fingerprint for data. You feed any amount of data into a hash function, and it spits out a fixed-length string of characters. The same input always gives the same output. But change even one letter, and the output is completely different.
This is what makes blockchains tamper-proof. Each block contains the hash of the previous block. Change one old transaction, and its block's hash changes. That breaks every block after it. To fake a transaction, you would need to redo the hash for every block that comes after — and do it faster than the entire network adds new ones.
Nodes: thousands of copies
A blockchain does not live on one computer. It lives on thousands of computers called nodes. Each node keeps a complete copy of the entire blockchain.
When someone broadcasts a transaction, every node checks it independently. Does Alice actually have 2 ETH? Is the signature valid? If most nodes agree the transaction is good, it gets included in the next block.
If an attacker tries to submit a fake transaction, the other nodes reject it. To successfully cheat, an attacker would need to control the majority of the network's computing power (in Proof of Work) or staked tokens (in Proof of Stake) — which for large blockchains costs billions of dollars.
Consensus: how nodes agree
With thousands of independent computers, how do they agree on which transactions are valid and in what order? This is called consensus, and it is the hardest problem in blockchain design.
There are two main approaches:
Proof of Work is like a lottery where buying a ticket requires solving a hard math problem. The more computing power you have, the more tickets you buy. Bitcoin uses this method.
Proof of Stake is like a security deposit. Validators put up their own money (ETH) as collateral. If they act honestly, they earn a small reward. If they try to cheat, their deposit gets taken away. Ethereum switched to Proof of Stake in September 2022 and now uses 99.95% less energy than before.
How a transaction actually works
When you send ETH to someone, here is what happens step by step:
On Ethereum, new blocks are added every 12 seconds. Once your transaction is in a block, it is permanent. After a few more blocks are added on top, it becomes practically impossible to reverse.
Why this matters
Blockchains are slow (12 seconds per block) and expensive (you pay gas fees for every transaction) compared to a regular database. So why use one?
Because they solve a problem regular databases cannot: trust without a middleman. A bank can freeze your account. A company can edit its database. A blockchain cannot be changed by anyone once a transaction is confirmed.
| Feature | Regular database | Blockchain |
|---|---|---|
| Speed | Milliseconds | 12+ seconds |
| Cost | Free (for the company) | Gas fees per transaction |
| Who controls it | The company that owns it | No single entity |
| Can be edited | Yes, by the database admin | No, once confirmed |
| Needs trust | Yes, trust the company | No, trust the math |
| Best for | Speed-sensitive apps | Money, ownership, voting |
The right question is not "blockchain or database?" It is "which parts of my app need trust guarantees, and which parts need speed?" Most Web3 apps use both.
Key takeaways
- A block is a bundle of transactions. A chain is blocks linked by hashes.
- A hash is a digital fingerprint. Change one bit of input, and the entire hash changes.
- Nodes are computers that each hold a copy of the blockchain and verify transactions independently.
- Consensus is how nodes agree. Proof of Work uses computing power. Proof of Stake uses staked tokens.
- Blockchains are slow and expensive, but they remove the need to trust a middleman.
Quiz: How Blockchains Work
1 / 5What is a block in a blockchain?