Why records that cannot be altered matter

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Why records that cannot be altered matter

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Why does a ledger that cannot be altered build trust in a digital currency?
A It makes every transaction happen faster than before
B Nobody can secretly change past records, so everyone can rely on the ledger
2. Ava paid Ben 50 coins. Later Ava tries to edit the record to say 5 coins. What happens on a ledger that cannot be altered?
A The change is rejected and the record still says 50 coins
B The record changes to 5 coins and Ben loses money
3. Which cheat does an unalterable ledger stop?
A Choosing which digital wallet to use
B Deleting a payment you made so it looks like you never paid
4. What is the main danger if a ledger records CAN be altered?
A People could cheat by changing amounts or removing payments
B The ledger would use too many time-stamps
5. Zoe says: 'I will change the amount in an old transaction to get more money.' Will this work on an unalterable ledger?
A No, the old amount is fixed and cannot be changed afterwards
B Yes, as long as she changes it before anyone checks

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1amount = 50 -> amount = 5 Atrust = records_unchanged
2delete payment #204 BA cheat that tries to change a saved payment amount afterwards, which an unalterable record stops
3Because saved records cannot be changed, everyone can trust the ledger and the currency CIf records could be altered, no one could trust the ledger. Trust exists because records cannot be altered.
4A cheat fails when the changed record no longer matches the shared copies DA cheat that tries to remove a payment from the ledger, which cannot work if records cannot be altered
5Ben edits his old payment from 20 to 2 and the ledger accepts it EIn a ledger with unalterable records, the edit would be rejected. Saved amounts cannot be changed afterwards.
6Records can be altered, so everyone can trust the ledger Fif edited_copy != shared_copies: reject

Definitions

immutable record

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF newAmount __ record.amount THEN OUTPUT "Change rejected" ENDIF
2.
IF action = "DELETE" THEN ______ "Payments cannot be removed" ENDIF
3.
ledgerChanged ← FALSE trusted ← ___ ledgerChanged
4.
savedAmount ← 50 newAmount ← 500 cheatFailed ← newAmount != ___________
5.
ledger.add(payment) payment.locked ← ____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A IF record IS EMPTY THEN
B REJECT delete request
C ENDIF
Question 2
A SAVE 20 TO ledger
B TRY TO CHANGE 20 TO 5
C OUTPUT "Change allowed"
Question 3
A IF payment NOT IN ledger THEN
B REJECT delete request
C ENDIF
Question 4
A FOR EACH payment IN ledger
B LOCK payment
C NEXT payment
D trusted ← FALSE
Question 5
A SAVE payment TO ledger
B UNLOCK payment
C TRY payment.amount ← 5
D OUTPUT "Edit failed"

Answer Key

Why records that cannot be altered matter
Section A: Quick Questions
Q1
B — Nobody can secretly change past records, so everyone can rely on the ledger
Q2
A — The change is rejected and the record still says 50 coins
Q3
B — Deleting a payment you made so it looks like you never paid
Q4
A — People could cheat by changing amounts or removing payments
Q5
A — No, the old amount is fixed and cannot be changed afterwards
Section B: Match the Pairs
Q1
amount = 50 -> amount = 5 → A cheat that tries to change a saved payment amount afterwards, which an unalterable record stops
Q2
delete payment #204 → A cheat that tries to remove a payment from the ledger, which cannot work if records cannot be altered
Q3
Because saved records cannot be changed, everyone can trust the ledger and the currency → trust = records_unchanged
Q4
A cheat fails when the changed record no longer matches the shared copies → if edited_copy != shared_copies: reject
Q5
Ben edits his old payment from 20 to 2 and the ledger accepts it → In a ledger with unalterable records, the edit would be rejected. Saved amounts cannot be changed afterwards.
Q6
Records can be altered, so everyone can trust the ledger → If records could be altered, no one could trust the ledger. Trust exists because records cannot be altered.
Section C: Definitions
Q1
immutable record — A record that cannot be changed once saved, so no one can cheat by editing an amount or deleting a payment, and everyone can trust the ledger.
Section D: Fill in the Blanks
Q1
IF newAmount != record.amount THEN OUTPUT "Change rejected" ENDIF
Q2
IF action = "DELETE" THEN OUTPUT "Payments cannot be removed" ENDIF
Q3
ledgerChanged ← FALSE trusted ← NOT ledgerChanged
Q4
savedAmount ← 50 newAmount ← 500 cheatFailed ← newAmount != savedAmount
Q5
ledger.add(payment) payment.locked ← TRUE
Section E: Spot the Error
Q1
A — The ledger should only reject a delete request when the record is locked (cannot be altered). Checking for an empty record does not stop anyone removing a payment. The line should be IF record IS LOCKED THEN.
Q2
C — The saved record cannot be altered, so the cheat of changing 20 to 5 fails. The message should say the change is blocked, not allowed.
Q3
A — A delete request must be rejected when the payment IS in the ledger. A saved payment cannot be removed afterwards. The condition should be IF payment IN ledger THEN.
Q4
D — Every payment has been locked so none can be changed or removed, which means everyone can trust the ledger. trusted should be set to TRUE.
Q5
B — The payment must be locked after saving so that its amount cannot be changed later. UNLOCK would let a cheat edit the amount. The line should be LOCK payment.