5.2 Digital currency

Cambridge IGCSE Computer Science, syllabus 0478. Paper 1, theory.

Digital currency and blockchain

You can explain a digital currency, and how a blockchain keeps its record.

A digital currency is money that exists only as electronic data. There is no note or coin to hold. A cryptocurrency is one kind of digital currency. A shared network tracks it, not one bank.

  • 5.2.1 Digital currency
  • 5.2.2 Blockchain
  • Paper 1

5.2.1

What a digital currency is

You can state what a digital currency is.

Alice has 2.5 coins in an app on her phone. She cannot hold those coins in her hand. The app is her digital wallet. A digital wallet stores the currency on a computer, a phone, or a secure server.

A digital currency exists only in electronic form. It has no paper notes and no metal coins. Cash is different, because you can hold a note.

A blockchain is the ledger that records the payments. It is not another name for the money.

Quick question

State two features of a digital currency.

It exists only electronically. It has no notes or coins. State needs the facts only, so you do not add “because”.

Which idea is it?

Digital currency, blockchain, or not the definition.

Money that exists only as electronic data in a wallet

A shared ledger of time-stamped records that cannot be altered

Digital currency means Bitcoin, and only Bitcoin

The hash of the previous block, stored inside this block

A paper banknote issued by a central bank

5.2.1 continued

How people use a digital currency

You can describe a use, then discuss one benefit and one risk.

Alice sends 2.5 coins from her wallet to Bob’s wallet. A bank does not have to pass that payment on. The same coins can pay a shop, or an online service, in another country.

A private key is the secret that controls a wallet. You will use it again when you sign a payment. If Alice loses her private key, the coins stay locked, because she cannot prove they are hers.

PointBenefitRisk
TimeThe network is open all day, so you are not limited to bank hours.A network failure can stop the payment.
CostA payment abroad can cost less than a bank transfer.The price of the coins can rise or fall sharply.
After you payThe coins can arrive quickly.A finished payment cannot be reversed if you paid the wrong wallet.
Quick question

Give one benefit of paying with a digital currency.

The network is open all day. Give needs only the fact. You do not need a reason unless the question says “explain”.

Benefit or risk?

The network is available 24 hours a day

The price can change sharply

Lower overhead, and access for people without a bank branch

A completed payment cannot be reversed

Losing the private key locks the funds

Before 5.2.2

How a cryptocurrency differs from a bank balance

You can compare a cryptocurrency with other electronic money.

Bitcoin is a cryptocurrency. Alice’s 2.5 coins are not printed as notes by a central bank. A network of computers keeps the record of who paid whom. No single bank is in charge of the accounts.

A cryptocurrency is still a digital currency, because it exists only as electronic data in a wallet. “Digital currency” is the wider term. It is not another name for Bitcoin.

WordMeaning
Digital currencyMoney that exists only electronically.
CryptocurrencyA digital currency tracked by a shared network, not by one bank.
Bank balanceThe number is electronic, but the bank keeps the account.
BlockchainThe ledger that stores the payments. It is not another name for the money.
Quick question

Compare a cryptocurrency with a balance in a banking app.

Both are electronic, so there is no note to hold. A cryptocurrency is tracked by a shared network. A bank balance is kept by the bank. Compare needs both sides.

Building the record

How a hash shows that data has changed

You can explain what a hash is used for.

The payment “Alice to Bob, 2.5 coins” has the hash 4951b1d8. Hash that same payment again and you get 4951b1d8. Change it to “Alice to Bob, 9 coins” and the hash becomes a380f610.

A hash is a short fingerprint of some data. The same data always gives the same hash. Change one character and the hash changes.

You cannot rebuild the payment from the hash, and the hash does not hide it. Hiding a message is encryption. That is topic 2.3.

Same payment, same fingerprint

Same payment Alice to Bob, 2.5 coins Alice to Bob, 2.5 coins hash 4951b1d8 8 characters same hash Amount changed Alice to Bob, 9 coins hash a380f610 8 characters different hash One way 4951b1d8 × no way back Alice to Bob, 2.5 coins

Look at the two top arrows. They start from the same payment and both end at 4951b1d8. Look at the lower arrow. The amount has changed, so the hash is a380f610. Each hash is eight characters. The crossed arrow means you cannot turn the hash back into the sentence.

Quick question

Explain why “Alice to Bob, 9 coins” has a different hash from “Alice to Bob, 2.5 coins”.

The hash is worked out from the payment. The amount is part of that payment, so the hash changes. One mark for the point, and one mark for the reason.

Change one detail and watch the hash

This is a short classroom hash, not a real blockchain hash. A real hash is much longer. You do not need the method’s name.

Hash

Building the record

How a digital signature shows who authorised a payment

You can describe how a digital signature is checked.

Alice signs “Alice pays Bob 2.5 coins”. A digital signature shows who authorised a message. It also shows that the message is still the one they signed. It does not hide the payment. The computers still need to read who is paying whom.

You met the private key as the secret in the wallet. A public key is the matching key that other people can use. Alice signs with her private key. A node checks with her public key.

A node is one computer on the network.

The order matters. The wallet hashes the payment first, because the signature is made from that hash. The private key is used next. The node then hashes the copy it received. A change to the wording makes the two hashes differ, so the check fails.

Why the keys are used this way

The private key stays in the wallet, so only Alice can sign. The public key can be shared, so any node can check. Topic 2.3 uses the keys the other way round. There, the public key hides a message and the private key reads it.

The four steps, in this order

  1. Hash the payment, such as “Alice pays Bob 2.5 coins”.
  2. Use Alice’s private key on that hash. The result is the signature.
  3. The node hashes the payment it received.
  4. It checks the signature with Alice’s public key. A changed amount, or another person’s key, is rejected.
HashDigital signatureEncryption
JobShows whether the data changedShows who authorised the paymentHides the message
KeyNo keyPrivate key signs. Public key checks.Public key hides. Private key reads.
Can you read the payment?YesYesNo. The message is hidden.

How a signature is checked

Alice signs Alice pays Bob 2.5 coins readable Hash Private key stays in the wallet Signature A node checks Alice pays Bob 2.5 coins still readable Hash again Public key Alice’s, shared Match? Match: accept Differ: reject

Look at the top row. Alice hashes the payment, then her private key makes the signature. Look at the lower row. The node hashes the copy it received and checks it with Alice’s public key. Match means accept. Differ means reject.

Check Alice’s signature

Alice signed “Alice pays Bob 2.5 coins” with her private key. The nodes check it with Alice’s public key.

Quick question

Describe how a node checks Alice’s signature.

The node hashes the payment it received. It checks the signature with Alice’s public key. It accepts the payment only if they match. Describe needs those steps.

Hash, signature, or encryption?

The same data always gives the same result. Change one character and the result changes.

Made with the private key and checked with the public key, to show who authorised this payment.

Hides a readable message so another person cannot read it.

A value kept beside a message, so you can tell later whether that message was edited.

Building the record

What a transaction stores

You can state the four items in one payment.

Alice pays Bob 2.5 coins, and she signs that payment. A transaction is one payment written as data. It stores the sender, the recipient, the amount, and the digital signature.

The sender is Alice’s wallet. The recipient is Bob’s wallet. These are addresses on the network, not names written in a paper book. A node checks the signature with Alice’s public key before the payment can be stored.

Quick question

State the four items in Alice’s transaction.

Alice, Bob, 2.5 coins, and Alice’s digital signature. State needs the four facts. You do not need to explain the keys.

Building the record

What one block stores

You can state the contents of a block.

Block 1 stores Alice’s payment, the time 09:15:02, the hash 0e42f289, and the previous hash 00000000. A block groups waiting transactions. It also stores the time it was checked, its own hash, and the previous block’s hash.

The hashes on this page are short classroom hashes. A real hash is much longer. You do not need the method’s name. The next section shows why the previous hash is stored.

Look at what Block 1 and Block 2 store

A transaction stores Sender Alice Recipient Bob Amount 2.5 coins Signature Alice signed it stored in Block 1 A block stores Block 1 Transactions Alice to Bob, 2.5 coins Timestamp 09:15:02 This hash 0e42f289 Previous hash 00000000 Block 2 Transactions Bob to the shop, 1 coin Timestamp 09:16:40 This hash 584081b6 Previous hash 0e42f289

Look at Block 2’s previous hash. It is 0e42f289, the same hash as Block 1. Look at Block 1’s previous hash. It is 00000000, because there is no earlier block.

The four items inside a block

  • The transactions: sender, recipient, amount, and a digital signature.
  • The time the block was checked.
  • This block’s hash, worked out from its own data.
  • The previous hash, which is the hash of the block before this one.
Quick question

State two things a block stores besides the transactions.

The time it was checked, and the previous block’s hash. Its own hash is also correct. State needs the names only.

5.2.2

How linked blocks make a blockchain

You can describe a blockchain in the form Paper 1 expects.

Block 2 stores Block 1’s hash, 0e42f289. If Alice’s 2.5 coins in Block 1 are changed to 9, Block 1’s hash changes. Block 2 still holds the old hash, so the link fails.

A blockchain is a digital ledger. A digital ledger is a shared record of transactions. It is a time-stamped series of records that cannot be altered. Time-stamped means each block stores the time it was agreed. Copies are kept on many computers. No single bank owns the ledger.

Digital ledger

The nodes keep the same record of transactions. A node is one computer on the network.

Time-stamped

Each block stores when it was checked, so the payments stay in order.

Cannot be altered

After the network has agreed a block, a change breaks the later links. The other nodes can see that.

Each block stores its own hash and the hash of the block before it. This matters because a change to an old payment changes that block’s hash. Later blocks still store the old hash, so the chain no longer matches. The signature checked one payment. The block hash checks that the agreed history was not rewritten.

Quick question

Explain why a change to Block 1 is detected.

Block 1’s hash changes, so it no longer matches the previous hash stored in Block 2. One mark for the changed hash, and one mark for the broken link.

Alter a block that was already agreed

5.2.2 continued

How a payment is added to the ledger

You can describe the six steps in order.

Alice’s payment is requested, grouped into a block, sent to the nodes, checked, added to the chain, and then the ledger updates. The order matters. The nodes must check the block before it is added. If it is added first, a bad payment could enter the ledger.

  1. WalletRequest
  2. BlockGroup transactions
  3. NetworkBroadcast
  4. NodesValidate
  5. ChainAppend
  6. RecipientFunds arrive

Put the steps in order

Click a step to add it. Click a chosen step to remove it.

5.2.2 continued

Why the ledger stops a coin being spent twice

You can explain double-spending.

The ledger already says Alice sent coin C-19 to Bob. She then tries to send C-19 to the shop as well. Double-spending means spending the same digital coin more than once.

A digital coin is data, so it can be copied. A paper note cannot be handed over twice, because you no longer have it. The ledger is checked before a new payment is accepted. A coin that was already spent is rejected.

No single bank keeps the only copy of this ledger. If one node fails, the other nodes still hold it. That is why one broken computer does not delete the currency.

Quick question

Explain how the ledger stops Alice spending coin C-19 twice.

The ledger shows that C-19 was already paid to Bob, so the shop payment is rejected. The point is the earlier record. The reason is that the same coin would be spent twice.

Try to spend a coin twice

The ledger already contains one payment. Ask for another and see which coin the network will accept.

    Exam practice

    How to answer the written questions

    Write first. Then open the scheme and award the marks yourself.

    Question 1 2 marks

    Command word: State. Give a short fact for each mark. Do not explain.

    State what is meant by a digital currency.

    Question 2 3 marks

    Command word: Describe. Give the details. Do not turn it into a story about Bitcoin.

    Describe the role and characteristics of a blockchain in tracking digital currency transactions.

    Question 3 2 marks

    Command word: Explain. Give a point and a reason, using “because” or “so”.

    Explain why timestamps are essential in a blockchain transaction record.

    Written marks you awarded 0 / 7
    Quick check 0 / 10

    Quick check

    Ten short questions. The explanation appears as soon as you choose.

    Section 5.2 review

    Say these without looking back

    Tick an idea only when you can say it. The ticks stay in this browser.

    0 / 11