Quiz: Ethereum Architecture — The World Computer Concept

Multiple Choice

1. Which of the following is NOT one of the four fields in an Ethereum account state?

(a) Nonce (b) Balance (c) Transaction history (d) Code hash

2. What distinguishes a contract account from an externally owned account (EOA)?

(a) Contract accounts have a higher balance (b) Contract accounts have non-empty code hash and storage hash (c) Contract accounts can initiate transactions (d) Contract accounts do not have a nonce

3. In Ethereum's account model, what is the primary purpose of the nonce?

(a) To generate the account's address (b) To prevent replay attacks by ensuring each transaction is unique (c) To determine the account's position in the state trie (d) To calculate gas costs

4. Ethereum's global state is stored in which data structure?

(a) Binary search tree (b) Hash table (c) Modified Merkle Patricia Trie (d) Red-black tree

5. A simple ETH transfer (no contract interaction) costs approximately how much gas?

(a) 2,100 gas (b) 21,000 gas (c) 32,000 gas (d) 210,000 gas

6. Why is writing a new storage slot (SSTORE) so much more expensive than an arithmetic operation (ADD)?

(a) SSTORE uses more CPU cycles (b) SSTORE permanently changes the global state that every node must store (c) SSTORE is a legacy operation that has not been optimized (d) SSTORE requires cryptographic operations

7. Under EIP-1559, what happens to the base fee portion of gas costs?

(a) It is paid to the block validator (b) It is distributed to all stakers (c) It is burned (permanently destroyed) (d) It is placed in a treasury

8. What happens when a transaction runs out of gas during execution?

(a) The transaction is completed with the remaining operations skipped (b) All state changes are reverted, but the gas fee is still charged (c) All state changes are reverted and the gas fee is refunded (d) The transaction is placed back in the mempool for retry

9. Which event occurred on September 15, 2022?

(a) The launch of the Beacon Chain (b) The Merge — Ethereum's transition from PoW to PoS (c) The deployment of EIP-1559 (d) The DAO hack

10. The Merge reduced Ethereum's energy consumption by approximately:

(a) 50% (b) 75% (c) 90% (d) 99.95%

11. What was the purpose of "shadow forks" in testing the Merge?

(a) To create backup copies of the blockchain (b) To test the Merge transition using real mainnet state without affecting the live network (c) To simulate attacks on the PoS consensus mechanism (d) To test new EVM opcodes

12. Which of the following is a consequence of Ethereum's Turing completeness?

(a) Transactions can always be validated instantly (b) It is provably impossible to determine whether arbitrary smart contract code is bug-free (c) Gas is unnecessary because all programs eventually halt (d) Smart contracts can modify their own bytecode after deployment

13. In the context of Ethereum's state growth, what are Verkle Trees designed to improve?

(a) Transaction throughput (b) Smart contract execution speed (c) Proof size, enabling more practical stateless clients (d) Gas cost calculations

14. In Ethereum's EIP-1559 fee mechanism, when does the base fee increase?

(a) When ETH price increases (b) When blocks are more than 50% full (c) Every 100 blocks automatically (d) When validators vote to increase it

15. Which statement about the relationship between EOAs and contract accounts is correct?

(a) Contract accounts can initiate transactions to call other contracts (b) EOAs can store code that executes when they receive ETH (c) Only EOAs can initiate transactions; contracts execute reactively (d) Contract accounts and EOAs are functionally identical after ERC-4337

Short Answer

16. Explain why Ethereum chose the account model over Bitcoin's UTXO model. List at least two advantages and one disadvantage of the account model.

17. A transaction calls a function that performs 2 storage reads (2,100 gas each), 1 new storage write (20,000 gas), and 10 arithmetic operations (3 gas each). Including the base transaction cost of 21,000 gas, calculate the total gas used. If the base fee is 30 gwei, what is the transaction cost in ETH (ignoring priority fee)?

18. Describe the dual-layer architecture that resulted from the Merge. What does the execution layer do? What does the consensus layer do?

19. Why can a smart contract not initiate an action on its own at a specific time (e.g., "execute this trade at midnight")? What infrastructure has been developed to work around this limitation?

20. In the voting dApp state model from this chapter, explain why the developer chose to store the proposal description hash on-chain rather than the full description text. What is the tradeoff?


Answer Key

1. (c) — Transaction history is not stored in the account state. The four fields are nonce, balance, storage hash, and code hash.

2. (b) — Contract accounts have non-empty code hash (the hash of their deployed bytecode) and typically non-empty storage hash. EOAs have the hash of the empty string for code hash and an empty storage hash.

3. (b) — The nonce ensures each transaction from an account is unique, preventing the same signed transaction from being submitted and executed multiple times.

4. (c) — Ethereum uses a Modified Merkle Patricia Trie, combining the space efficiency of a Patricia trie with the cryptographic verification properties of a Merkle tree.

5. (b) — A simple ETH transfer with no contract interaction costs exactly 21,000 gas, which is the base transaction cost.

6. (b) — SSTORE permanently modifies the global state. Every full node in the network must store the new value indefinitely. Arithmetic operations happen in memory and are discarded after the transaction.

7. (c) — Under EIP-1559 (London hard fork, August 2021), the base fee is burned — permanently removed from circulation. Only the priority fee (tip) goes to the validator.

8. (b) — When a transaction runs out of gas, all state changes from that transaction are reverted (rolled back), but the gas already consumed is charged to the sender. The validator performed the computation and is compensated.

9. (b) — The Merge occurred on September 15, 2022, at block 15,537,393, transitioning Ethereum from proof-of-work to proof-of-stake.

10. (d) — The Merge reduced Ethereum's energy consumption by approximately 99.95%, from roughly 83 TWh/year to approximately 0.01 TWh/year.

11. (b) — Shadow forks copied the real Ethereum mainnet state and ran the Merge transition on those copies. This tested the transition with real contract code and account balances, revealing bugs that testnets with synthetic data could not find.

12. (b) — By Rice's theorem (a consequence of the halting problem), it is impossible to algorithmically determine non-trivial properties of programs in a Turing-complete language, including whether they are bug-free.

13. (c) — Verkle Trees use vector commitments to produce dramatically smaller proofs (100-200 bytes vs. several KB for Merkle Patricia Trie proofs), making stateless clients practical.

14. (b) — The EIP-1559 base fee increases when blocks are more than 50% full (by up to 12.5% per block) and decreases when blocks are less than 50% full.

15. (c) — Only EOAs (controlled by private keys) can initiate transactions. Contract accounts execute code only when called by a transaction originating from an EOA (or by another contract that was itself called by an EOA).

16. Advantages: (1) Natural support for stateful computation — contracts can read and write persistent storage with simple key-value operations. (2) Space efficiency — a single balance field vs. potentially thousands of UTXOs. (3) Simplicity for developers — the account model maps intuitively to application state management. Disadvantage: Reduced privacy (address reuse is the norm), state growth (every account exists permanently), and sequential nonce requirement limits parallelism.

17. Total gas = 21,000 (base) + 2 * 2,100 (reads) + 20,000 (new write) + 10 * 3 (arithmetic) = 21,000 + 4,200 + 20,000 + 30 = 45,230 gas. Cost = 45,230 * 30 gwei = 1,356,900 gwei = 0.0013569 ETH.

18. After the Merge, Ethereum has two layers: the execution layer processes transactions, executes smart contracts, and manages the state trie (the original PoW chain's functionality). The consensus layer (formerly the Beacon Chain) manages validator selection, block proposal, attestation, and finality using proof-of-stake. The execution layer produces the "payload" (transactions and state), and the consensus layer wraps it in a block and achieves agreement.

19. Contract accounts are reactive — they can only execute when called by an external transaction. Since no transaction arrives at midnight automatically, the contract cannot act on its own. To work around this, "keepers" or "automation networks" (such as Chainlink Automation or Gelato) use off-chain bots that submit transactions at the specified time, triggering the contract's time-dependent logic.

20. Storing the full description on-chain is expensive because each byte of transaction data costs gas, and long strings require significant storage writes. By storing only a hash (32 bytes) on-chain and the full text on IPFS, the developer reduces gas costs dramatically. The tradeoff is that users must access IPFS to read the full description, and if the IPFS content becomes unavailable, only the hash remains on-chain (though the hash can verify any copy of the text found elsewhere).