Architecture and Mechanics of Ethereum
Understand Ethereum's network architecture, consensus and validation mechanisms, and how the EVM and gas model shape its performance and scalability.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
What kind of network architecture does Ethereum use to store account states and process transactions?
1 of 15
Summary
Understanding Ethereum: Design and Architecture
Introduction
Ethereum is a decentralized network that maintains a shared state across thousands of computers worldwide. To understand how it works, you need to grasp three key ideas: (1) how the network reaches consensus on which transactions are valid, (2) how computation is executed and priced, and (3) why scalability remains a fundamental challenge. Let's explore each of these systematically.
Network Structure
Ethereum operates as a peer-to-peer (P2P) network, where every participant (called a "node") maintains a copy of the blockchain and can propose or validate new transactions. Rather than relying on a single authority, the network coordinates through cryptographic consensus.
The blockchain grows predictably: approximately every 12 seconds, a new block containing recent transactions is added to the chain. This consistent time frame is important because it affects how quickly transactions are confirmed and how much data can be processed per unit time.
To manage the flow of transactions before they are included in blocks, each node maintains a mempool—a temporary holding area for unvalidated transactions. When you submit a transaction to Ethereum, it first enters the mempool of the node you're communicating with, then propagates to other nodes through the P2P network. Validators later select transactions from mempools to include in new blocks.
Consensus and Validation
What problem does consensus solve? With thousands of independent computers maintaining the blockchain, they must agree on which transactions are legitimate and in what order they occurred. Ethereum solves this through a mechanism where participants called validators stake cryptocurrency to earn the right to propose and validate blocks.
How Validators Work
Any account can become a validator by depositing 32 ETH (or more) to the network. This deposit is called a stake. Validators are randomly assigned roles each epoch (a period lasting 32 slots, where each slot is approximately 12 seconds):
Block proposers are chosen to create the next block from pending transactions
Attesters are assigned to validate the proposer's block by cryptographically signing it
Think of proposers as creating a summary of recent transactions, and attesters as confirming that summary is correct.
Rewards and Penalties
The incentive structure is crucial: validators who perform their duties correctly and remain active receive rewards in ETH. However, validators who misbehave—or worse, try to cheat the system—have a portion of their stake removed (a process called slashing). This economic design makes attacking the network extremely expensive: to control the consensus process dishonestly, an attacker would need to own and risk losing billions of dollars in staked ETH.
Canonical Chain Selection
Because the network is distributed, different nodes might temporarily see slightly different versions of the blockchain. Ethereum resolves this by treating the blockchain with the highest accumulated weight of validator attestations as the canonical chain—the authoritative version of truth. Over time, this ensures all honest nodes converge on the same history.
Virtual Machine and Gas
The Ethereum Virtual Machine (EVM)
Ethereum is unusual among blockchains because it is not just a ledger for tracking account balances—it can also execute programs called smart contracts. These contracts are executed on the Ethereum Virtual Machine (EVM), a deterministic, stack-based runtime environment.
"Deterministic" means that given the same input, the EVM always produces the same output on every computer. "Stack-based" refers to the internal architecture: operations use a last-in-first-out (LIFO) data structure. This design ensures that smart contracts behave identically across the entire network, a critical requirement for a blockchain where thousands of nodes must independently verify computation.
Gas: Measuring Computational Cost
One of Ethereum's most important innovations is gas—a unit that measures how much computational work a transaction or smart contract requires. Every operation executed by the EVM has a fixed gas cost proportional to its resource usage. For example, adding two numbers might cost 3 gas, while writing data to storage might cost 20,000 gas.
Why measure computation this way? Without gas, malicious actors could submit transactions with infinite loops that would crash nodes. With gas, every operation has a cost, so infinitely long programs become prohibitively expensive to execute.
How Gas Pricing Works
When you submit a transaction, you specify two values:
Gas limit: The maximum amount of gas you are willing to spend (your safety cap)
Gas price: The amount of ETH you will pay per unit of gas
The total fee you pay is: Gas Used × Gas Price
Here's what happens at execution:
The network executes your transaction, consuming gas with each operation
If gas runs out before completion, the transaction reverts (all changes are undone), and you keep nothing—you still pay for the gas consumed
If the transaction completes with gas remaining, you are refunded the unused gas at your specified gas price
This refund mechanism is important: it means you can set a conservative gas limit (to avoid overpaying) without fear of losing ETH on the assumption you won't need all of it.
Gas Price Units
Gas prices are commonly quoted in gigawei (Gwei), a unit abbreviation where:
$$1 \text{ Gwei} = 10^{-9} \text{ ETH}$$
So if the gas price is 50 Gwei and you use 21,000 gas (the cost of a simple transfer), you pay:
$$21,000 \times 50 \text{ Gwei} = 1,050,000 \text{ Gwei} = 0.00105 \text{ ETH}$$
Performance and Scalability
Throughput Limitations
Ethereum's design prioritizes security and decentralization over raw speed. This creates a fundamental scalability trade-off: the network can only process a limited number of transactions per second.
Given current gas limits per block, Ethereum's theoretical maximum throughput is approximately 238 transactions per second (TPS). In practice, average throughput has been closer to 25 TPS, far below payment systems like Visa (which processes around 45,000 TPS).
Why the gap between theory and practice? Network congestion, varying transaction complexity, and the fact that not all block space is always utilized contribute to lower real-world throughput.
Data Structure Efficiency
Ethereum stores account state (balances, smart contract code and data) using a Merkle-Patricia Trie, a cryptographic data structure that enables two important capabilities:
Efficient proofs: You can prove that an account has a specific balance without downloading the entire blockchain
Light-client synchronization: Thin clients (like mobile wallets) can verify transactions without storing gigabytes of data
This efficiency is important background for understanding why Ethereum chose this structure, even though it doesn't directly appear on most exams.
Layer-2 Scaling Solutions
Because Layer 1 (the main Ethereum blockchain) has fundamental throughput limits, the ecosystem has developed Layer-2 solutions—separate blockchains that process transactions independently but periodically settle their results back to Ethereum.
The key advantage: Layer-2 chains inherit Ethereum's security. They don't require their own separate validator network; instead, they use cryptographic proofs to convince the Ethereum mainchain that they've correctly processed transactions. This means users get the security guarantees of Ethereum while enjoying:
Lower transaction costs (avoiding the expensive gas of the mainchain)
Higher throughput (processing thousands of TPS instead of 25-238)
The two primary types of Layer-2 solutions are:
Optimistic rollups: These assume transactions are valid by default and only run computation if someone challenges the result. They are fast and general-purpose but have longer withdrawal times (typically 7 days) because of the challenge period.
Zero-knowledge rollups: These use cryptographic proofs to immediately verify correct execution without a challenge period. They are more complex to build but offer stronger security guarantees and faster withdrawals.
<extrainfo>
Both types bundle thousands of Layer-2 transactions into a single transaction posted to Ethereum, dramatically reducing per-transaction costs and increasing throughput. The specific trade-offs between optimistic and zero-knowledge rollups—such as proof generation complexity and finality time—are sometimes covered in advanced courses but less commonly on introductory exams.
</extrainfo>
Flashcards
What kind of network architecture does Ethereum use to store account states and process transactions?
Peer-to-peer (P2P)
Approximately how often is a new block of transactions added to the Ethereum blockchain?
Every 12 seconds
What is the name of the data structure where each node maintains unvalidated transactions before they are processed?
Mempool
What is the minimum amount of ETH an account must deposit to become a validator?
32 ETH
What are the two specific slots that validators are randomly assigned to each epoch?
Block-proposal slots
Attestation slots
What happens to the stake of validators who are inactive or misbehave?
They lose a portion of their stake
How does Ethereum determine which version of the blockchain is the canonical chain?
The chain with the highest accumulated weight of validator attestations
What type of runtime environment is the EVM (Ethereum Virtual Machine) for executing smart-contract bytecode?
Deterministic and stack-based
What unit is used to measure the computational work required for transaction execution in Ethereum?
Gas
Which two parameters must a sender specify regarding gas when submitting a transaction?
Gas limit (maximum gas to spend)
Gas price (ETH paid per gas unit)
What occurs if a transaction is submitted with insufficient gas?
The transaction reverts
What is the mathematical definition of 1 Gigawei (Gwei) in terms of ETH?
$1\ \text{Gwei} = 10^{-9}\ \text{ETH}$
What has been the approximate average practical throughput (TPS) of Ethereum?
25 TPS
Which two features are enabled by storing Ethereum's state in a Merkle-Patricia Trie?
Efficient proofs
Light-client synchronization
What are two common types of Layer-2 scaling solutions used by Ethereum?
Optimistic rollups
Zero-knowledge rollups
Quiz
Architecture and Mechanics of Ethereum Quiz Question 1: Approximately how often is a new block added to the Ethereum blockchain?
- Every 12 seconds (correct)
- Every 1 minute
- Every 5 seconds
- Every 30 seconds
Architecture and Mechanics of Ethereum Quiz Question 2: What reward mechanism applies to validators who propose or attest valid blocks?
- They receive rewards (correct)
- They lose a portion of their stake
- They are required to pay a penalty fee
- They receive no change to their stake
Architecture and Mechanics of Ethereum Quiz Question 3: What two parameters does a transaction sender specify regarding gas?
- Gas limit and gas price (correct)
- Gas type and gas source
- Gas refund rate and gas exponent
- Gas priority and gas nonce
Architecture and Mechanics of Ethereum Quiz Question 4: What happens if a transaction runs out of gas during execution?
- The transaction reverts (correct)
- The transaction is automatically retried
- The remaining gas is burned
- The transaction is forwarded to a validator
Architecture and Mechanics of Ethereum Quiz Question 5: What is the theoretical maximum throughput of Ethereum Layer‑1 in transactions per second?
- About 238 TPS (correct)
- About 45 000 TPS
- About 25 TPS
- About 1 000 TPS
Architecture and Mechanics of Ethereum Quiz Question 6: What is the typical average transactions‑per‑second rate observed on Ethereum?
- Around 25 TPS (correct)
- Around 200 TPS
- Around 500 TPS
- Around 1 000 TPS
Architecture and Mechanics of Ethereum Quiz Question 7: Which property of the Ethereum Virtual Machine ensures that all nodes obtain the same execution outcome for a given transaction?
- Determinism (correct)
- Randomness
- Probabilistic execution
- Non‑determinism
Approximately how often is a new block added to the Ethereum blockchain?
1 of 7
Key Concepts
Ethereum Fundamentals
Ethereum
Ethereum Virtual Machine (EVM)
Gas (Ethereum)
Merkle‑Patricia Trie
Consensus and Validation
Proof‑of‑Stake (Ethereum)
Validator (Ethereum)
Layer-2 Solutions
Layer‑2 Scaling Solutions
Optimistic Rollup
Zero‑Knowledge Rollup
Definitions
Ethereum
A decentralized, open‑source blockchain platform that enables smart contracts and dApps, transitioning from Proof‑of‑Work to Proof‑of‑Stake.
Ethereum Virtual Machine (EVM)
A deterministic, stack‑based runtime environment that executes Ethereum smart‑contract bytecode.
Proof‑of‑Stake (Ethereum)
A consensus mechanism where validators lock up ETH to propose and attest blocks, earning rewards or penalties based on behavior.
Validator (Ethereum)
An entity that stakes at least 32 ETH to participate in block proposal and attestation, securing the network.
Gas (Ethereum)
A unit measuring computational work for transactions, priced in Gwei, with limits and refunds to manage resource usage.
Merkle‑Patricia Trie
A hybrid data structure used by Ethereum to store state, enabling efficient cryptographic proofs and light‑client sync.
Layer‑2 Scaling Solutions
Protocols built atop Ethereum that inherit its security while increasing throughput and reducing transaction costs.
Optimistic Rollup
A Layer‑2 scaling technique that assumes transaction validity off‑chain and uses fraud proofs to resolve disputes.
Zero‑Knowledge Rollup
A Layer‑2 scaling method that batches transactions and validates them on‑chain using succinct cryptographic proofs.