A blockchain is a database where records are grouped into blocks, each block is sealed with a cryptographic fingerprint, and every block points to the one before it — forming a chain that makes tampering with any past record immediately obvious. Understanding how that chain is built, and why it is so hard to break, is the foundation for understanding nearly everything else in crypto.
From a Transaction to a Record
Before a transaction ends up on a blockchain, it starts in the hands of the sender. Say Alice wants to send some cryptocurrency to Bob. She creates a transaction message that says “Alice sends 1 coin to Bob,” then signs it with her private key. That digital signature proves she authorised the transfer without revealing the key itself.
The signed transaction is broadcast to the network, where it waits in a holding area called the mempool — a queue of unconfirmed transactions visible to the nodes running the network. Miners or validators pick transactions from the mempool, bundle them together, and begin the process of adding them to the chain.
Anatomy of a Block
Every block has roughly the same structure, regardless of which blockchain you are looking at:
| Field | What it contains |
|---|---|
| Block header | Metadata: block number, timestamp, and two critical hashes |
| Transaction list | The actual transfers and instructions bundled into this block |
| Previous block hash | The fingerprint of the block that came before — the “link” in the chain |
| Nonce (in some systems) | A number miners adjust to produce a valid hash |
The most important field is the previous block hash. It is what turns a pile of individual blocks into a chain.
Hashing: The Glue That Holds It Together
A cryptographic hash is a short fixed-length string computed from any input. Feed the same data into the same hash function and you always get the same output. Change even a single character of the input and the output changes completely and unpredictably.
Blockchains use hashing in two key ways:
- Sealing each block. Once a block’s transactions are finalised, the entire block is run through a hash function. The resulting hash is that block’s unique fingerprint.
- Linking blocks together. Each new block includes the previous block’s hash inside its own header. When the new block is then hashed, the previous hash gets folded into the new fingerprint.
This creates a dependency chain. Block 500’s hash is derived from its own contents plus block 499’s hash. Block 501’s hash depends on block 500’s hash, and so on all the way back to block 1 (the “genesis block”).
Why this matters: If someone went back and quietly changed a transaction in block 499, that block’s hash would change. Block 500 contains the old hash of 499, so block 500’s hash would also change. Block 501 would then be invalid too. Every block after the tampered one would need to be recomputed — and on a live network, new blocks keep arriving every few seconds. The attacker can never catch up.
Reaching Agreement: Consensus
Hashing makes tampering detectable, but it does not, on its own, decide which version of the chain is the correct one. That is the job of a consensus mechanism.
The two most common approaches are:
Proof of Work
In proof of work, adding a block requires solving a computational puzzle — finding a nonce value that makes the block’s hash start with a certain number of zeroes. This takes enormous trial-and-error effort, which costs real electricity and hardware. The longest chain (the one with the most accumulated work) is treated as the authoritative history. To rewrite history, an attacker would need to redo all that work for the tampered block and every block after it — while also outpacing the honest miners adding new blocks in real time.
Proof of Stake
In proof of stake, validators lock up (stake) cryptocurrency as collateral and are chosen to propose and confirm blocks. If a validator tries to cheat, their staked funds can be destroyed — a penalty called “slashing.” Agreement is reached when a supermajority of staked value signs off on a block.
Both approaches make it economically irrational to lie about the history of the chain.
Nodes: Who Keeps the Ledger
The chain is not stored on a single server. It is replicated across nodes and validators — computers around the world that each hold a full copy of every block. When a new block is proposed, nodes check it against the rules: are the transaction signatures valid? Does the hash match? Does it correctly reference the previous block? Only valid blocks are accepted and added to each node’s copy of the chain.
Because thousands of independent participants hold identical copies and check each other’s work, there is no single point of failure and no single gatekeeper who can alter records unilaterally.
Finality: When Is a Transaction Actually Done?
On most blockchains, a transaction is not considered fully final the moment it lands in a block. It becomes more secure with each additional block built on top of it. A transaction buried under six blocks is extremely difficult to reverse; one buried under a hundred is, for practical purposes, permanent.
This is why exchanges and merchants sometimes wait for a certain number of “confirmations” before treating a payment as settled. Each confirmation is another block added on top of the one containing your transaction.
What Blockchains Are Not Good At
Honesty requires noting the trade-offs. Because every node must store and verify every transaction, blockchains are far slower and more expensive per transaction than a centralised database. This is why layer 1 vs layer 2 scaling solutions exist — they move most activity off the main chain while still anchoring security to it.
Blockchains are also not magic truth machines. They guarantee that records have not been altered after they were written, but they cannot verify that the data was accurate when it was first recorded. That is a separate problem, addressed in part by oracles.
Key Takeaways
- A blockchain is a sequence of blocks where each block contains a hash of the previous one, making any past alteration detectable across the entire chain.
- Cryptographic hashing provides the tamper-evidence; consensus mechanisms provide the agreement on which chain is correct.
- Nodes store and verify independent copies of the chain, removing any single point of control or failure.
- Transactions become progressively more final as more blocks are added on top of them.
- The security of the chain comes at a cost: blockchains are intentionally slow and resource-intensive compared to centralised databases.
- Blockchains guarantee integrity of records after they are written, not the accuracy of data at the time of writing.
Next up: Consensus Mechanisms