Blocks of transactions

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

Blocks of transactions

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement describes a block in a blockchain?
A A group of transaction records saved together as one unit
B A single coin that is stored in a digital wallet
2. How many transactions can one block hold?
A Only ever one transaction
B Several transactions
3. What is saved with the transaction records in a block?
A A time-stamp
B The password of every user
4. What does the time-stamp of a block show?
A The total value of all the coins in the world
B The date and time the block was saved
5. What happens when a block is full?
A It is closed and no more transactions are added
B It keeps growing so more transactions can be added

Match the Pairs

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

Left columnRight column
1block AA group of transaction records saved together, with a time-stamp, as one unit of the blockchain
2block_timestamp BA full block is closed and is not reopened. New transactions must go into a new block.
3Several transactions can be stored together in one block Cblock = [transaction1, transaction2, transaction3]
4When a block is full it is closed, and new transactions go into a new block DA blockchain is made of many blocks, and each block holds a group of transactions. Transactions are not each saved in a separate blockchain.
5Every transaction is saved in its own blockchain instead of in a block EThe date and time recorded for the whole block when its group of transactions was saved
6A full block is reopened so extra transactions can be added to it Fif block_full: close(block); block = new_block()

Definitions

block

Fill in the Blanks

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

1.
IF block.isFull THEN block._____() ENDIF
2.
block._________ ← NOW() block.add(transaction1) block.add(transaction2)
3.
IF block.isFull THEN newBlock ← NEW Block() newBlock.___(transaction4)
4.
block.add(transaction1) block.add(transaction2) _____.add(transaction3)
5.
IF block.count __ 3 THEN block.close() block ← NEW Block()

Spot the Error

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

Question 1
A block ← new Block()
B block.add(transaction1
C block.add(transaction2)
D block.timestamp ← now()
Question 2
A WHILE block.count < 5
B block.add(nextTransaction)
C ENDWHILE
D block.open()
Question 3
A IF block.isFull() THEN
B block.close()
C block.reopen()
D ENDIF
Question 4
A block ← new Block()
B block.timestamp = now()
C block.add(transaction1)
Question 5
A FOR i ← 1 TO 3
B block.add(transaction[i])
C NEXT j
D OUTPUT block.count

Answer Key

Blocks of transactions
Section A: Quick Questions
Q1
A — A group of transaction records saved together as one unit
Q2
B — Several transactions
Q3
A — A time-stamp
Q4
B — The date and time the block was saved
Q5
A — It is closed and no more transactions are added
Section B: Match the Pairs
Q1
block → A group of transaction records saved together, with a time-stamp, as one unit of the blockchain
Q2
block_timestamp → The date and time recorded for the whole block when its group of transactions was saved
Q3
Several transactions can be stored together in one block → block = [transaction1, transaction2, transaction3]
Q4
When a block is full it is closed, and new transactions go into a new block → if block_full: close(block); block = new_block()
Q5
Every transaction is saved in its own blockchain instead of in a block → A blockchain is made of many blocks, and each block holds a group of transactions. Transactions are not each saved in a separate blockchain.
Q6
A full block is reopened so extra transactions can be added to it → A full block is closed and is not reopened. New transactions must go into a new block.
Section C: Definitions
Q1
block — A group of transaction records saved together with a time-stamp as one unit of the blockchain. When a block is full it is closed, and new transactions go into a new block.
Section D: Fill in the Blanks
Q1
IF block.isFull THEN block.close() ENDIF
Q2
block.timestamp ← NOW() block.add(transaction1) block.add(transaction2)
Q3
IF block.isFull THEN newBlock ← NEW Block() newBlock.add(transaction4)
Q4
block.add(transaction1) block.add(transaction2) block.add(transaction3)
Q5
IF block.count >= 3 THEN block.close() block ← NEW Block()
Section E: Spot the Error
Q1
B — The closing bracket is missing. It should be block.add(transaction1) so the first transaction is added to the block.
Q2
D — Once a block is full it must be closed, not opened. The line should be block.close().
Q3
C — New transactions go into a new block after the full block is closed. A closed block is never reopened. The line should be block ← new Block().
Q4
B — In this pseudocode, assignment uses the ← arrow, not =. It should be block.timestamp ← now().
Q5
C — The loop variable is i, so the loop must end with NEXT i. This adds several transactions to one block.