O Level Computer Science 2210 · Area 1 · Computer systems

Digital currency and blockchain

This page explains what makes a currency digital, how a payment is actually made when nothing physical changes hands, and why a shared record is needed at all. It then works through the blockchain: transactions grouped into time-stamped blocks, each block carrying a hash that ties it to the one before, so the record of who paid whom cannot quietly be rewritten. Marks are lost by describing blockchain as 'a kind of money' rather than as the ledger that records it.

Not started

Syllabus coverage

  • Understand the concept of a digital currency: a currency that only exists electronically, with balances held as data rather than as coins or notes
  • Understand how digital currencies are used, including holding a balance in a digital wallet and transferring value from one address to another as a recorded transaction
  • Understand the process of blockchain: transactions are grouped into time-stamped blocks, and each block is linked to the block before it so that records cannot be altered
  • Understand how blockchain is used to track digital currency transactions, so that the same unit cannot be spent twice and no single party can rewrite the history of payments

Part of the O Level Computer Science syllabus 2210.

How a blockchain records a transactionA digital currency exists only as entries in a ledger; there is no coin to hand over.The chain is what makes the ledger hard to alter.block 1transactions + timestamphash of previous blockblock 2transactions + timestamphash of previous blockblock 3transactions + timestamphash of previous blockEach block carries the hash of the one before it, so changing an old block breaks every block after it.The ledger is copied across many machines, so there is no single copy to alter.
A chain of blocks, each one holding a time-stamped list of transactions, its own hash and a reference back to the hash of the block before it, so that changing any block breaks the link to the next and the tampering becomes visible.

A currency that exists only as data

A digital currency is one that only exists electronically. There are no coins in a pocket and no notes in a till: the balance is held as data in a computer system, and paying somebody means changing that data so that the amount moves from one holder to another. Nothing physical is handed over, and there is no drawer of cash anywhere behind the payment.

This is not the same as internet banking. When you pay a shop from a normal bank account, the money in that account is also just a number in a database, but the currency itself still exists as notes and coins and the bank is obliged to convert your balance into them. A digital currency has no physical version at all: there is nothing to withdraw, and the only form it takes is the record of who holds how much.

Because there is nothing to hold, ownership is proved entirely by the record. Whoever the ledger says holds a unit is the person who can spend it. That makes the record itself the thing of value, and it explains why so much of this topic is about how the record is kept rather than about the money.

One definition to memorise: a digital currency is one that only exists electronically. Say electronic, not online banking.

How a digital currency is used

A user holds a digital currency in a digital wallet, which is software or a device that stores the private key needed to authorise spending. The wallet does not contain the currency any more than a card contains a bank balance: it holds the key that proves the right to move a balance that is recorded in the ledger.

Each holder has a public address, a string of characters that others can send funds to, rather like an account number that is safe to share. The matching private key is what signs a payment out. To pay somebody, the payer's wallet creates a transaction naming the payer's address, the recipient's address and the amount, and signs it with the private key. That transaction is broadcast to the network of computers that maintain the ledger.

The network checks the transaction before it is accepted. It confirms that the signature is valid and that the payer's address actually holds enough to cover the amount and has not already committed those funds elsewhere. Once enough of the network agrees, the transaction is added to the ledger and the balances at both addresses change. The recipient can see the payment arrive without needing to trust the payer, because the check was done against the shared record rather than against the payer's word.

There is no bank in the middle of that process. No single institution holds the balance, approves the payment or can reverse it, which is the feature that attracts some users and the drawback that worries others: a payment sent to the wrong address, or made under pressure, cannot be called back by a customer service desk.

  • A wallet stores the private key; the balance itself lives in the ledger.
  • A public address can be shared so that others can send funds to it.
  • A payment is a signed transaction naming payer, recipient and amount, broadcast to the network.
  • The network validates the signature and the available balance before the transaction is recorded.
  • No central bank or institution sits in the middle, so recorded payments are not reversible.
Do not say the currency is 'stored in the wallet'. The wallet holds the key; the balance is a record in the blockchain.

The problem a shared record has to solve

Digital data can be copied perfectly and instantly. If a digital currency were just a file, a holder could send the same file to two different people, and both would believe they had been paid. This is the double-spending problem, and any digital currency has to prevent it.

A central authority could prevent it simply by keeping the only copy of the balances and approving each payment in turn, which is roughly what a bank does. A digital currency built to work without a central authority cannot rely on that, so it needs a record that many independent computers hold, check and agree on, and that no single one of them can rewrite.

That shared record also has to settle disputes about order. If two payments from the same address are broadcast at nearly the same moment, the network must agree which one came first, because only the first can be paid from the available balance. A record built as a chain of blocks solves both problems at once: it gives one agreed history, and it makes any attempt to change an earlier entry visible to everybody.

Double spending is spending the same digital unit twice. The blockchain exists to make that impossible without a central authority approving every payment.

The blockchain: a ledger that cannot be altered

A blockchain is, in its basic form, a digital ledger: a time-stamped series of records that cannot be altered. A ledger is simply a record of transactions, and here that record is kept as data, shared across a network of computers rather than in one organisation's database.

The record is built out of blocks. A block is a container holding a batch of transactions together with information about itself: the time it was created, and a value called a hash that is calculated from its contents. Blocks are added one after another in a fixed order, and each new block also stores the hash of the block before it. That stored reference is what turns a pile of blocks into a chain.

A hash is a fixed-length value produced by a mathematical function from the block's contents. The same contents always produce the same hash, and any change to the contents, even a single character, produces a completely different one. It is a one-way function: you cannot work backwards from the hash to the contents. That is what makes it useful as a fingerprint for a block.

The ledger is not kept in one place. Many computers on the network hold their own copy, and new blocks are accepted only when the network agrees they are valid. The result is a record of transactions that every participant can check and that no single participant controls.

  • A blockchain is a digital ledger: a time-stamped series of records that cannot be altered.
  • Transactions are collected into blocks, and blocks are added in a fixed order.
  • Each block stores its own timestamp, its list of transactions and the hash of the previous block.
  • Many computers hold a copy of the ledger, so there is no single copy to tamper with.
Learn the syllabus sentence exactly: blockchain, in its basic form, is a digital ledger, that is a time-stamped series of records that cannot be altered.

How the chain is built, block by block

New transactions arrive at the network and wait in a pool, unconfirmed. Computers on the network check each one: is the signature valid, does the address hold enough, has this unit already been spent in an earlier block? Transactions that pass are gathered into the next block, and the block is stamped with the time it was assembled.

The block is then sealed. Its transactions are put through the hash function together with the timestamp and, crucially, the hash of the previous block, and the result becomes this block's own hash. That hash is written into the block header and also copied into the next block when it is built, which is the link in the chain.

Adding a block is deliberately made difficult, so that blocks cannot be produced faster than the network can agree on them. In many systems the computers compete to find a value that makes the block's hash meet a required pattern, and the winner broadcasts the finished block for the others to check. The other computers verify the work and the contents, and if it all holds they add the block to their own copy. This is commonly called mining, and the reward for it is the incentive that keeps computers participating.

The exact rules differ between one digital currency and another, but the structure does not: transactions are batched, the batch is time-stamped, the batch is hashed together with the hash of its predecessor, and the network agrees to append it.

Part of a blockWhat it holdsWhy it matters
TimestampWhen the block was createdPuts the transactions in time order, so the ledger is a dated series of records
Transaction listThe transfers accepted into this blockThe actual record of who paid whom, and how much
Hash of the previous blockThe fingerprint of the block before itLinks each block to its predecessor, forming the chain
Own hashThe fingerprint calculated from this block's contentsAny later change to the block changes this value, which breaks the link to the next block
The link is the hash of the previous block stored inside the new one. If a question asks how the blocks are joined, that is the answer.

Why tampering shows, and how transactions are tracked

Suppose somebody edits a transaction in an old block to send themselves more. The contents of that block change, so the hash calculated from them no longer matches the hash that was recorded for it. The next block still stores the original hash of its predecessor, so the two no longer agree and the chain is visibly broken at that point.

To hide the edit, the attacker would have to recalculate that block's hash and then every hash after it, because each block's stored reference would also have to be rewritten. On top of that, most other computers hold their own copies of the ledger and check new blocks against the rules; a rewritten chain that disagrees with the majority is rejected. Altering history therefore stops being a matter of changing one record and becomes a matter of out-computing most of the network, which is what makes the record effectively unalterable.

This is how a blockchain tracks digital currency transactions. Every transfer is written into the ledger, in a dated block, in a position in the chain that everyone can see. A holder wanting to prove they have funds shows the transactions that paid them, and anyone can check that those transactions exist in the chain and have not been spent again. Because the chain records the movement of each unit from address to address, the same unit cannot be spent twice: the first valid spend is in the chain, and a second attempt fails validation.

The ledger is also pseudonymous rather than anonymous in the ordinary sense. Addresses are not names, but every transaction involving an address is permanently visible to everyone holding the ledger. If an address is ever linked to a person, the whole history attached to it becomes linkable too. That openness is a feature for auditing and a concern for privacy, and both follow from the same design decision to make the record shared and unalterable.

  • Changing an old block changes its hash, so the next block's stored reference no longer matches and the break is visible.
  • Hiding the change would mean recalculating every later block and beating the rest of the network's copies.
  • Each transaction sits in a dated block at a fixed position, so a unit's history can be traced from address to address.
  • Once a valid spend is recorded, a second attempt to spend the same unit fails validation.
  • Addresses are pseudonymous, but all activity against an address is permanently visible.
Two marks are usually available: the block's hash no longer matches, and every later block would also have to be recalculated. Give both if the question asks why the ledger cannot be altered.

What the design gives, and what it costs

The strengths follow directly from the structure. There is no single point of failure or single organisation that must be trusted, because many computers hold and check the ledger. Records are time-stamped and effectively permanent, which suits auditing. Transactions can be verified by anyone with a copy, and cross-border transfers do not wait for banks in two countries to settle between themselves.

The costs also follow from the structure. Because every participant keeps a copy and every block must be agreed, the network does more work than a single database would: the same transaction is stored many times, and the agreement process consumes computing power and electricity. Throughput is limited by how quickly blocks can be agreed, so a blockchain can be much slower than a central database for the same volume of payments.

There is also the question of responsibility. A mistaken payment cannot be reversed, a lost private key means the balance can never be moved again by anyone, and the value of a digital currency against ordinary money can change sharply because nothing fixes it. Those are not faults in the blockchain itself; they are consequences of running a currency without a central authority that could undo, restore or stabilise.

AdvantageDisadvantage
No single organisation controls the ledger, so there is no central point of failure or trustAgreement across many computers is slower and uses far more computing power than one database
Records are time-stamped and effectively cannot be altered, which makes them auditableA payment recorded in error cannot be reversed
Anyone holding a copy can verify transactions independentlyA lost private key means the funds can never be spent
Transfers can cross borders without waiting for banks to settleThe exchange rate against ordinary currency can change sharply
If a question asks you to evaluate, give one benefit and one drawback that both come from the same feature. Shared copies give independence from a central authority and cost speed and energy.

Key terms you must be able to define

Digital currency
A currency that only exists electronically: the balance is held as data and payments move that data, with no coins or notes in circulation.
Blockchain
In its basic form, a digital ledger: a time-stamped series of records that cannot be altered, built from blocks linked to the block before them.
Digital ledger
A record of transactions kept as data. A blockchain is one, shared across many computers rather than held by a single organisation.
Block
A container in the chain holding a batch of transactions, a timestamp, the hash of the previous block and its own hash.
Hash
A fixed-length value calculated from a block's contents. The same contents always give the same hash, and any change gives a completely different one, so it acts as a fingerprint.
Transaction
A record of a transfer naming the payer's address, the recipient's address and the amount, signed with the payer's private key.
Digital wallet
Software or a device that stores the private key needed to authorise payments of a digital currency; the balance itself is held in the ledger.
Private key
The secret value that proves the right to spend from an address and is used to sign transactions. Anyone who has it controls the funds.
Public address
A string of characters, safe to share, that others use to send funds; the matching private key is needed to spend what arrives.
Double spending
Sending the same digital unit to two different recipients. A blockchain prevents it by recording the first valid spend permanently.
Timestamp
The record of when a block was created, which places its transactions in order within the ledger.
Mining
The process by which computers on the network compete to assemble and seal the next block, and are rewarded for doing so.
Validation
The checks the network performs on a transaction or block: that the signature is valid, the balance is sufficient and the unit has not already been spent.

In context

2210 sets its questions inside systems a student already uses - a school network, a phone, a supermarket till, a vending machine, a website. These show how the theory is applied to a context you have not seen before, then you answer for the system you are given.

Paying a friend in digital currency

The payer opens a wallet, enters the friend's public address and the amount, and confirms. The wallet signs the transaction with the private key and broadcasts it. Computers on the network check the signature and the balance, the transaction is included in the next block, and once that block is agreed the friend's address shows the funds. No bank approved it and nobody can reverse it, so typing the address correctly matters more than it does in ordinary banking.

A shop accepting digital currency

The shop displays a public address as a QR code. The customer's wallet builds a transaction to that address and signs it. The shop waits for the transaction to appear in a block before handing over the goods, because an unconfirmed transaction is only a request, and the whole point of the ledger is that confirmation is what makes the payment final. The shop then converts the balance into ordinary currency if it does not want to hold the risk of the exchange rate moving.

Auditing a charity's spending

A charity publishes its public address. Any donor can follow every transfer out of it in the ledger, because each one sits in a dated block that anybody can read. Nobody needs the charity's permission to check, and nobody, including the charity, can quietly remove a payment that has already been recorded. The donors still have to work out which addresses belong to the charity, since the ledger gives addresses rather than names.

A tampered record

Someone with access to an old copy of the ledger edits a transaction from a year ago. The block's hash changes, so the hash stored in the following block no longer matches, and the break is visible at that point. Rebuilding the chain from there would mean recalculating every later block and producing a version longer than the one the rest of the network holds, which is not feasible. The other copies simply reject it.

A lost phone

A user's phone held the only copy of a private key. There is no customer service line to call and no password reset, because no organisation holds the account: the ledger still records the balance against the address, but nobody can sign a transaction to move it. The loss is permanent, which is the other side of having no central authority able to restore access.

Flashcards

Click a card to flip it. Mark honestly — the tracker uses this.

Q1What is a digital currency?
A currency that only exists electronically: the balance is held as data and payments move that data, with no coins or notes.
Q2What is a blockchain, in its basic form?
A digital ledger: a time-stamped series of records that cannot be altered, built from blocks linked to the block before them.
Q3What does one block contain?
A batch of transactions, a timestamp, the hash of the previous block, and its own hash.
Q4What is a hash and why is it useful in a blockchain?
A fixed-length value calculated from a block's contents. The same contents always give the same hash and any change gives a different one, so it acts as a fingerprint that reveals tampering.
Q5How are the blocks joined together?
Each block stores the hash of the block before it, so a change to an earlier block breaks the match with the next one.
Q6Why can a recorded transaction not be altered?
Changing a block changes its hash, so the reference stored in the next block no longer matches; hiding it would mean recalculating every later block and beating the majority of copies held by the network.
Q7What is double spending and how is it prevented?
Sending the same digital unit to two recipients. The first valid spend is recorded permanently in the chain, so a second attempt fails validation.
Q8What does a digital wallet hold?
The private key used to sign and authorise transactions. The balance itself is a record in the ledger.
Q9What is the difference between a public address and a private key?
The public address is shared so others can send funds to it; the private key is secret and proves the right to spend what is at that address.
Q10What is the role of the network's other computers?
They hold copies of the ledger, validate transactions and blocks against the rules, and reject a chain that disagrees with the majority.
Q11Give one advantage and one disadvantage of a blockchain.
Advantage: no single organisation controls the ledger, so there is no central point of trust or failure. Disadvantage: agreement across many computers is slower and uses much more computing power than one database.
0 of 11 marked as known

Exam-style questions

6 questions, 20 marks. Write your answer and press Mark my answer — it is marked against the scheme and tells you which points you made and what would gain the next mark. You can still reveal the scheme and mark it yourself instead.

DefineAO11 mark
Define what is meant by a digital currency.

Mark scheme — tick each point you actually made

Examiner tip: The key word is electronically. Do not define it as money in a bank account, because ordinary money also exists physically.
StateAO12 marks
State two items of information that are held in a block of a blockchain.

Mark scheme — tick each point you actually made

Examiner tip: Any two from the transaction list, the timestamp and the hashes. Naming only 'data' is too vague to earn a mark.
DescribeAO23 marks
Describe how a digital currency payment is made from one user to another.

Mark scheme — tick each point you actually made

Examiner tip: Follow the order: build and sign, broadcast, check, record. Mentioning the private key is what shows you understand how the right to spend is proved.
DescribeAO24 marks
Describe the process of blockchain and explain how it is used to track digital currency transactions.

Mark scheme — tick each point you actually made

Examiner tip: Describe the structure first, then say what it achieves. The tracking point is the second half of the objective and is often left out.
ExplainAO34 marks
Explain why a record held in a blockchain cannot easily be altered.

Mark scheme — tick each point you actually made

Examiner tip: Give the mechanism, not just the word immutable. The hash mismatch and the need to rebuild every later block are the two marks most often missed.
EvaluateAO36 marks
A small charity is considering accepting donations in a digital currency. Evaluate this decision, giving three benefits and three drawbacks.

Mark scheme — tick each point you actually made

Examiner tip: Three benefits and three drawbacks, each tied to this charity rather than to digital currency in general. A balanced answer with a short judgement at the end reads as a complete evaluation.

Exam technique for this topic

  • Define a digital currency in the syllabus words: one that only exists electronically. If you add 'like online banking', make clear that ordinary money still has a physical form, or leave the comparison out.
  • Keep the currency and the ledger apart. The blockchain is not money; it is the record that tracks the money. Answers that begin 'blockchain is a type of digital currency' lose the definition mark immediately.
  • For the process question, write the chain in order: transactions are collected, a block is formed and time-stamped, the block is hashed together with the previous block's hash, the network validates it, and it is appended. Five stages, five marks.
  • For 'why can the ledger not be altered', give the mechanism rather than the adjective. Say that a changed block no longer matches its recorded hash, and that every later block would have to be recalculated and accepted by the majority of copies.
  • Do not invent figures about prices, energy use or transaction speeds. Describe the trade-off in words: agreement across many computers is slower and more demanding than one central database.

Why students lose marks here

A student wroteA student wrote: 'Blockchain is a type of digital currency that you can spend online.'
Why it loses marksThis reverses the relationship. A blockchain is the ledger that records transactions in a digital currency; it is not the currency itself. The confusion costs the definition mark and usually the process marks that follow, because the answer then describes money rather than record keeping.
The answer that scoresA blockchain is a digital ledger, a time-stamped series of records that cannot be altered. A digital currency is the money that the ledger tracks. Transactions in the currency are grouped into blocks, each block is linked to the one before it, and the resulting chain is the record of who owns what.
A student wroteA student wrote: 'Each block stores a copy of all the transactions that came before it, which is why the chain is secure.'
Why it loses marksA block does not copy the earlier transactions. It stores only a hash, a short fingerprint, of the block before it. That single stored value is enough to detect any change to the earlier block, and it is far smaller than a copy would be.
The answer that scoresEach block holds its own batch of transactions, a timestamp and the hash of the previous block. Because any change to a block alters its hash, the stored reference in the next block no longer matches and the break in the chain is visible. Hiding the change would mean recalculating that block and every block after it.
A student wroteA student wrote: 'A digital currency is just money in a bank account, because both are only numbers in a computer.'
Why it loses marksThe balance in an ordinary bank account is data, but the currency behind it also exists as notes and coins and the bank must convert it on request. A digital currency has no physical form at all, so the record is the only form it takes.
The answer that scoresA digital currency is one that only exists electronically: there are no coins or notes and nothing can be withdrawn as cash. The balance is held as data and ownership is proved entirely by the ledger. Ordinary money held in a bank account is a digital balance representing a currency that still exists physically.
A student wroteA student wrote: 'A blockchain is anonymous, so nobody can see your transactions.'
Why it loses marksThe ledger is shared and permanent, so every transaction against an address is visible to everyone holding a copy. What is missing is the person's name, not the transaction. Once an address is linked to a person, its whole history becomes linkable.
The answer that scoresA blockchain is pseudonymous rather than anonymous. Transactions are recorded against addresses, not names, but every transfer involving an address is permanently visible in the shared ledger. Privacy comes from the address not being tied to an identity, not from the transactions being hidden.
A student wroteA student wrote: 'If you send a digital currency to the wrong address, you contact the network and they reverse it.'
Why it loses marksThere is no organisation in charge to contact, and reversing a recorded transaction would mean altering the ledger, which is precisely what the design prevents. Irreversibility is a consequence of having no central authority.
The answer that scoresA confirmed transaction cannot be reversed, because the record is shared and cannot be altered, and no central organisation has the power to rewrite it. The payment stands unless the recipient chooses to send the funds back. This is why the address must be checked carefully before a transaction is signed.

Where this fits in O Level Computer Science 2210

This page is one topic of Cambridge O Level Computer Science 2210. O Level Computer Science 2210 is the course home: every area and every topic in Cambridge's own order, the papers you sit and what each one tests, and the exam-practice tools. The full topic list, with each topic linked to its revision page, is on the O Level Computer Science 2210 syllabus page.