Ethereum Architecture
Ethereum block structure, account model, transaction lifecycle, EIP process, Ethereum roadmap, and danksharding.
Overview
Ethereum extended Bitcoin's blockchain concept with a Turing-complete virtual machine and account-based state.
Ethereum Block Structure
Account Model
Ethereum uses an account-based model instead of UTXO.
Account Types
| Type | Address Prefix | Code | Purpose |
|---|---|---|---|
| EOA (Externally Owned) | 0x... | No code | User wallets |
| Contract | 0x... | Has code | Smart contracts |
| Beacon Validator | 0x... | Staking | Consensus participation |
Account State
{
"balance": "1000000000000000000",
"nonce": 42,
"storageRoot": "0x...",
"codeHash": "0x..."
}
State Trie
Transaction Lifecycle
Transaction Structure
{
"type": 2,
"chainId": 1,
"nonce": 42,
"to": "0x...",
"value": "1000000000000000000",
"data": "0x",
"gasLimit": 21000,
"maxPriorityFeePerGas": "2000000000",
"maxFeePerGas": "100000000000",
"accessList": [],
"v": 27,
"r": "0x...",
"s": "0x..."
}
EIP Process (Ethereum Improvement Proposals)
| Stage | Name | Description |
|---|---|---|
| Draft | Idea submitted | Initial proposal |
| Review | Community review | Discussion period |
| Last Call | Final review | 14-day period |
| Final | Accepted | Included in fork |
| Stagnant | Inactive | 6 months no updates |
| Withdrawn | Rejected | Author withdrew |
| Living | Active | Continuously updated |
Key EIPs
| EIP | Name | Year | Impact |
|---|---|---|---|
| EIP-20 | ERC-20 Token | 2015 | Token standard |
| EIP-721 | ERC-721 NFT | 2018 | NFT standard |
| EIP-1559 | Fee Market | 2021 | Base fee burn |
| EIP-2930 | Access Lists | 2021 | Gas optimization |
| EIP-3529 | Refund Reduction | 2021 | Reduced refunds |
| EIP-4337 | Account Abstraction | 2023 | Smart wallets |
| EIP-4844 | Proto-Danksharding | 2024 | L2 data blobs |
| EIP-7002 | Validator Exits | 2024 | Withdrawal requests |
Ethereum Roadmap
Danksharding (Proto-Danksharding)
EIP-4844 introduced blob transactions for L2 data availability.
Blob Transaction Structure
# Blob transaction (Type 3)
blob_tx = {
"type": 3,
"max_fee_per_blob_gas": 1000000000, # 1 Gwei
"blob_versioned_hashes": [
"0x01..." # KZG commitment hash
],
# Standard fields
"to": "0x...",
"value": 0,
"data": "0x...",
"gas_limit": 100000
}
# Each blob: 128 KB, ~400 KB per block (3-6 blobs)
# Blobs stored for ~18 days, then pruned
Sharding Progress
| Phase | Name | Status | Impact |
|---|---|---|---|
| Phase 0 | Beacon Chain | Done | PoS foundation |
| Phase 1 | Shard Chains | Replaced | Data shards (Danksharding) |
| Phase 1.5 | Merge | Done | Execution on PoS |
| Phase 2 | Full Sharding | Future | Full execution shards |
| Proto-Dank | EIP-4844 | Done | L2 data blobs |
Gas Mechanics
Gas Price Formula (Post-EIP-1559)
Base Fee Calculation
- If block is > 50% full: Base fee increases
- If block is < 50% full: Base fee decreases
- Max change per block: Âą12.5%
Trade-offs
PoS vs PoW (Ethereum)
| Metric | PoW (Before) | PoS (After) |
|---|---|---|
| Energy | ~100 TWh/year | ~0.01 TWh/year |
| Hardware | ASICs, GPUs | Consumer hardware |
| Decentralization | Mining pools | Staking pools |
| Finality | Probabilistic | Deterministic (~15 min) |
| Validator Cost | High | 32 ETH minimum |
L1 vs L2 Scaling
| Approach | TPS | Cost | Security |
|---|---|---|---|
| Ethereum L1 | ~15 | $1-50 | Full |
| Optimistic Rollups | ~2,000 | $0.01-0.10 | Inherited |
| ZK Rollups | ~10,000 | $0.001-0.01 | Cryptographic |
| Validium | ~9,000 | $0.001 | Weak |
Real-World Examples
Ethereum Gas Costs (2024)
| Operation | Gas Used | Cost (10 Gwei) | Cost (30 Gwei) |
|---|---|---|---|
| ETH Transfer | 21,000 | 1.26 | |
| ERC-20 Transfer | 65,000 | 3.90 | |
| Uniswap Swap | 150,000 | 9.00 | |
| NFT Mint | 100,000 | 6.00 | |
| Contract Deploy | 500,000 | 30.00 |
Network Statistics (2024)
| Metric | Value |
|---|---|
| Active Validators | ~900,000 |
| Total Staked | ~32M ETH |
| Avg Block Time | 12 seconds |
| TPS (L1) | ~15 |
| TPS (L2 aggregate) | ~5,000 |
| Daily Transactions | ~1.1M |
Interview Questions
-
Why did Ethereum move from UTXO to an account model?
- Answer: Account model enables simpler smart contract development, stateful execution, and easier gas accounting. It reduces the complexity of tracking unspent outputs.
-
How does EIP-1559 improve fee estimation?
- Answer: It provides a predictable base fee that adjusts algorithmically, users set max fee caps, and priority fees tip validators. This eliminates first-price auction inefficiency.
-
What is the purpose of blob transactions in Proto-Danksharding?
- Answer: Blobs provide cheap, temporary data availability for L2 rollups without burdening L1 execution. Data is pruned after ~18 days, keeping node requirements manageable.
Quiz Questions
-
What replaced the uncle mechanism after The Merge?
- A) Sharding
- B) Nothing (no uncles in PoS) â
- C) Checkpoints
- D) DAGs
-
How often does Ethereum's base fee adjust?
- A) Every transaction
- B) Every block â
- C) Every epoch
- D) Every day
-
What is the minimum stake to become an Ethereum validator?
- A) 1 ETH
- B) 16 ETH
- C) 32 ETH â
- D) 64 ETH
Practice
- Build a transaction simulator that estimates gas costs
- Implement a simple account state trie in Python
- Create a gas price tracker using Ethereum JSON-RPC
- Analyze the state growth of Ethereum over the last year