Free tech learning for everyone, from basics to pro

BlockchainEmerging Technologies and SecurityBeginner

How blockchain works: blocks, hashes and chains

In short: A blockchain is a shared record kept by many computers. Transactions are grouped into blocks, and each block includes the hash of the one before, so any change to old data is obvious. Digital signatures prove who authorised each transaction and consensus decides which block comes next.

A shared record nobody owns alone

Imagine a class register that every student keeps a copy of. When something new is recorded, everyone checks it and adds it to their copy. If one person secretly changes an old entry, their copy no longer matches everyone else's, and the change is rejected. That is the core idea of a blockchain: a distributed ledger held by many independent computers (called nodes) that agree on the same history without one central owner.

Blockchains became famous through Bitcoin, but the technology is a general way to keep tamper-evident records. This note is about how it works, not about buying or selling anything.

Hashes: the digital fingerprint

A hash function turns any input into a fixed-length output. Good cryptographic hashes such as SHA-256 have three useful properties: the same input always gives the same output, a tiny change in input gives a completely different output, and you cannot work backwards from the output to the input. Try it in a terminal or with the hash tool:

echo -n "pay Ali 10" | sha256sum
echo -n "pay Ali 11" | sha256sum

The two outputs look completely unrelated, even though only one character changed. That sensitivity is what makes tampering visible.

Blocks and the chain

Linking blocksBlock 1data + hash ABlock 2prev = A, hash BBlock 3prev = B, hash CBlock 4prev = C, hash D
Figure 1. Each block stores the hash of the block before it, so changing any old block breaks every link after it.

A block holds a batch of transactions plus a header. The header usually includes:

FieldPurpose
Previous block hashLinks this block to the one before it, forming the chain
Merkle rootA single hash summarising every transaction in the block
TimestampRoughly when the block was created
Consensus dataFor example a nonce in proof of work, or a validator signature in proof of stake

Because each header contains the previous block's hash, changing a transaction in block 2 changes block 2's hash. Block 3 still points at the old hash, so the link breaks, and so on up to the newest block. To hide a change you would have to rebuild every later block and convince most of the network to accept your version. Consensus rules make that very costly. The Merkle tree lets a node prove that one transaction is in a block without downloading every transaction.

Signatures, peers and consensus

Adding a transactionSignowner signswith keyBroadcastsent to peersValidatenodes checkrulesOrderconsensuspicks blockConfirmblock added,copied
Figure 2. A transaction is signed, shared, checked, ordered into a block and then copied by every node.
  • Digital signatures: each user has a private key and a public key. Signing a transaction with the private key proves the owner approved it; anyone can check with the public key. See cryptography basics.
  • Peer-to-peer network: nodes share new transactions and blocks directly with each other.
  • Consensus: a set of rules for agreeing which block is added next. The two best-known methods are compared in proof of work versus proof of stake.

Tip: "immutable" really means tamper-evident and very hard to change. It does not mean the data is true. If someone records wrong information honestly, the blockchain will keep that wrong information safely forever.

Common misunderstandings include thinking a blockchain is encrypted (most public chains are readable by anyone; signatures and hashes are not the same as encryption), and thinking it is always the best tool. A normal database is usually faster and simpler when one trusted organisation controls the data. Blockchains are most useful when several parties who do not fully trust each other need one shared history.

Practice

Why does changing an old block break the chain?
Its hash changes, but the next block still stores the old hash, so the link no longer matches and every later block would have to be rebuilt.
What does a digital signature prove in a blockchain transaction?
That the holder of the matching private key authorised the transaction and that it has not been altered since signing.
Is data on a public blockchain encrypted by default?
No. It is usually public and readable; hashes and signatures give integrity and authenticity, not confidentiality.

Key takeaways

  • A blockchain is a distributed ledger copied across many nodes.
  • Each block stores the previous block's hash, making changes obvious.
  • Hashes give integrity; digital signatures prove who authorised a transaction.
  • Consensus rules decide which block is added next.
  • Tamper-evident is not the same as true, private or always the right tool.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.