All subjects · Computer Science · WCP03 Advanced Principles of Computer Science

Blockchain

Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science

A blockchain is a shared record that nobody can secretly rewrite. It is best known for cryptocurrencies, but the idea of a tamper-evident distributed ledger has many other uses.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

What a blockchain is

A blockchain is a distributed ledger: a growing list of records (blocks) linked together using cryptographic hashes, with copies held by many computers (nodes) in a peer-to-peer network rather than by one central authority.

Each block contains: the data (for example transactions), a timestamp, the hash of the previous block, its own hash (calculated from its contents), and often a nonce used in mining.

Why it is tamper-evident

Each block stores the previous block's hash, so the blocks form a chain. If someone changes the data in an old block, that block's hash changes, so it no longer matches the 'previous hash' stored in the next block, and every later link breaks. To hide the change, an attacker would have to recalculate every following block on most copies of the ledger at once.

BlockDataPrevious hashOwn hash
0 (genesis)Genesis00000000cf0cb18a
1Ana pays Ben 5cf0cb18a92cb57a1
2Ben pays Cy 292cb57a184936894
1 after tamperingAna pays Ben 50cf0cb18ab3f4f7ab (no longer matches block 2's previous hash)

Hashes are the first 8 hex digits of SHA-256, calculated for this example

How new blocks are added

1. A transaction is broadcast to the network.

2. Nodes check it is valid (for example, signed with the owner's private key and not already spent).

3. Valid transactions are grouped into a new block.

4. The network agrees (consensus) which block is added. In proof of work, miners repeatedly change the nonce until the block's hash meets a difficulty target, which takes a lot of computing; in proof of stake, validators are chosen according to the stake they lock up.

5. The block is added to every node's copy.

Benefits and drawbacks

Benefits: no central authority needed; tamper-evident, permanent history; transparent and auditable; no single point of failure.

Uses: cryptocurrencies, supply chain tracking, smart contracts, land and certificate registers.

Drawbacks: proof of work uses huge amounts of energy; slow and limited in transactions per second compared with central databases; mistakes cannot easily be reversed; storing the full ledger takes a lot of space; privacy concerns because records are public; legal and regulatory uncertainty; a group controlling most of the network's power could rewrite recent history (a 51% attack).

Worked example

Explain how the network detects that block 1 has been modified.

  1. Block 1's hash is recalculated from its contents.
  2. Because the data changed, the new hash is different.
  3. Block 2 stores the original hash of block 1 as its 'previous hash', so the two no longer match and the chain is shown to be broken.

Answer: The stored previous-block hash in block 2 no longer matches block 1's hash.

Key idea: Blockchain: distributed ledger of blocks, each holding data, timestamp, previous block's hash and its own hash. Changing a block breaks every later link. Consensus (proof of work or stake) adds blocks. Secure and decentralised, but slow and energy-hungry.

Check yourself

  1. What links each block to the one before it?
    • Each block stores the previous block's private key
    • Blocks are stored in the same file
    • Each block stores the hash of the previous block
    • Each block contains a copy of every earlier block
    Show answer

    Each block stores the hash of the previous block. The previous hash is the chain.

  2. Why would changing the data in an earlier block be detected?
    • Its hash would change and no longer match the previous-hash value in the next block
    • The data is encrypted with a password
    • The block would be deleted automatically
    • Timestamps cannot be changed
    Show answer

    Its hash would change and no longer match the previous-hash value in the next block. The mismatch breaks the chain from that point.

  3. What does it mean that a blockchain is a distributed ledger?
    • The ledger is split into pieces and each node holds one piece only
    • The ledger is stored on a single cloud server
    • Copies of the ledger are held by many nodes rather than one central authority
    • The ledger is emailed to users
    Show answer

    Copies of the ledger are held by many nodes rather than one central authority. Many full copies give resilience and trust without a central owner.

  4. In proof of work, what do miners do?
    • Vote using their stake
    • Repeatedly change a nonce until the block's hash meets a difficulty target
    • Encrypt every transaction twice
    • Delete invalid blocks
    Show answer

    Repeatedly change a nonce until the block's hash meets a difficulty target. It takes much computation to find, but is quick to check.

  5. Which is a drawback of proof-of-work blockchains?
    • They have a single point of failure
    • They allow records to be edited easily
    • They need a central bank to approve each block
    • They use very large amounts of energy
    Show answer

    They use very large amounts of energy. Mining consumes vast computing power.

  6. Which is a suitable non-financial use of blockchain?
    • Storing a video game's high-resolution graphics
    • Tracking goods through a supply chain so each handover is permanently recorded
    • Running a computer's operating system
    • Speeding up a single-user spreadsheet
    Show answer

    Tracking goods through a supply chain so each handover is permanently recorded. A tamper-evident shared record suits multi-party tracking.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.