A record that cannot be altered

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

A record that cannot be altered

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A record has just been added to a blockchain. Can someone go back and edit it?
A Yes, the owner can edit it at any time
B No, it cannot be changed once added
2. A user wants to remove an old transaction from the blockchain. What happens?
A It cannot be deleted and stays in the history
B It is deleted after the user asks the network
3. A payment was recorded with the wrong amount. How is the mistake fixed?
A The old record is edited to the right amount
B A new record is added to correct it
4. Which word describes a blockchain record that cannot be changed or deleted?
A Immutable
B Editable
5. What happens to the history of transactions on a blockchain over time?
A It stays permanent and fixed
B Old parts are erased to save space

Match the Pairs

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

Left columnRight column
1immutable AA mistake is fixed by adding a new record, not by editing the old one
2add_record(correction) BRecords on a blockchain cannot be edited, so you cannot change the amount of an old record. Add a new correcting record instead.
3Old records cannot be edited, so trying to change a past amount is refused Cdelete(block5) -> REFUSED
4Old records cannot be deleted, so the history stays permanent DA record that cannot be changed or deleted once it has been added to the blockchain
5change_amount(old_record, 50) ERecords on a blockchain cannot be deleted, so you cannot erase a mistake. Add a new record that corrects it instead.
6remove(old_record) Fedit(block5, amount) -> REFUSED

Definitions

immutable

Fill in the Blanks

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

1.
blockchain.______(record)
2.
correction ← NewRecord(-50) blockchain.append(__________)
3.
immutable ← ____
4.
IF record.immutable = TRUE THEN ______ "Cannot edit"
5.
history ← history _ newRecord

Spot the Error

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

Question 1
A chain ← []
B ADD(chain, 'A pays B 5')
C ADD(chain, 'B pays C 2')
D chain[2] ← 'B pays C 3'
E OUTPUT LENGTH(chain)
Question 2
A chain ← []
B ADD(chain, 'A pays B 5')
C DELETE(chain, 1)
D OUTPUT chain
Question 3
A record ← 'A pays B 5'
B locked ← TRUE
C IF locked = TRUE THEN
D record ← 'A pays B 50'
E ENDIF
Question 4
A immutable ← FALSE
B IF immutable = TRUE THEN
C OUTPUT 'Record is fixed'
D ENDIF
Question 5
A chain ← ['A pays B 5']
B chain ← ['B pays C 2']
C OUTPUT LENGTH(chain)
D OUTPUT chain[1]

Answer Key

A record that cannot be altered
Section A: Quick Questions
Q1
B — No, it cannot be changed once added
Q2
A — It cannot be deleted and stays in the history
Q3
B — A new record is added to correct it
Q4
A — Immutable
Q5
A — It stays permanent and fixed
Section B: Match the Pairs
Q1
immutable → A record that cannot be changed or deleted once it has been added to the blockchain
Q2
add_record(correction) → A mistake is fixed by adding a new record, not by editing the old one
Q3
Old records cannot be edited, so trying to change a past amount is refused → edit(block5, amount) -> REFUSED
Q4
Old records cannot be deleted, so the history stays permanent → delete(block5) -> REFUSED
Q5
change_amount(old_record, 50) → Records on a blockchain cannot be edited, so you cannot change the amount of an old record. Add a new correcting record instead.
Q6
remove(old_record) → Records on a blockchain cannot be deleted, so you cannot erase a mistake. Add a new record that corrects it instead.
Section C: Definitions
Q1
immutable — Cannot be changed or deleted once added. A blockchain record stays fixed, so mistakes are fixed by adding a new record and the history stays permanent.
Section D: Fill in the Blanks
Q1
blockchain.append(record)
Q2
correction ← NewRecord(-50) blockchain.append(correction)
Q3
immutable ← TRUE
Q4
IF record.immutable = TRUE THEN OUTPUT "Cannot edit"
Q5
history ← history + newRecord
Section E: Spot the Error
Q1
D — An old record on a blockchain cannot be edited. The mistake must be fixed by adding a new correction record with ADD, not by overwriting chain[2].
Q2
C — Old records cannot be deleted from a blockchain. The mistake is fixed by adding a new correction record, so line 3 should be ADD(chain, 'Fix: A pays B 4').
Q3
D — When a record is locked it cannot be altered. The program should refuse the edit with a message, not change the record's value.
Q4
A — Blockchain records are immutable, which means they cannot be changed. The variable should be set to TRUE, not FALSE.
Q5
B — This replaces the whole chain and erases the first record. History must stay permanent, so the new record should be added with ADD(chain, 'B pays C 2').