Ethereum Blockchain: Data Structure of Blocks

·

Introduction to Ethereum's Data Storage

Ethereum's data storage can be categorized into three types:

  1. State Data: Stores account-related state information using StateDB. Each account is represented as a StateObject.
  2. Blockchain: The core data structure of Ethereum, similar to Bitcoin but with evolutionary improvements.
  3. Underlying Data: Stores all Ethereum data in a key-value format within LevelDB.

Key Components of Ethereum's Data Structure

State Data Storage (StateDB)

State data is stored as a Merkle Patricia Trie (MPT) in StateDB. MPT combines features of Merkle Trees and Patricia Tries for efficient key-value storage and verification.

MPT Characteristics:

MPT Node Types:

Blockchain Structure

Ethereum's blockchain shares two key similarities with Bitcoin:

  1. Parent Hash Linking: Blocks are chained via parent block hashes.
  2. Block Composition: Each block consists of a header and body.

Ethereum Block Header Fields

FieldDescriptionPoS 2.0 Status
ParentHashHash of the parent block.Retained
CoinBaseMiner's wallet address (reward recipient).Retained
UncleHashMerkle root hash of uncle blocks (PoW-only).Removed
RootMPT root hash of StateDB (stores all account data).Retained
TxHashMerkle root hash of transactions in the block.Retained
ReceiptHashMPT root hash of transaction receipts (includes gas costs and logs).Retained
BloomBloom filter for fast log search in receipts.Retained
DifficultyMining difficulty factor (PoW-only).Removed
NonceRandom value for PoW validation (PoW-only).Removed
MixHashFinal random value for PoW verification (PoW-only).Removed
NumberBlock number.Retained
TimeBlock creation timestamp.Retained
GasLimitMaximum gas allowed per block.Retained
GasUsedActual gas consumed by transactions in the block.Retained
extraDataCustom data (≤32 bytes) added by block creators.Retained

Transaction (Tx) Structure

Ethereum transactions include:

👉 Learn more about Ethereum gas mechanics


Fork Resolution: Bitcoin vs. Ethereum

Bitcoin's Approach (Longest Chain Rule)

Ethereum's Approach (Uncle Blocks)


FAQ Section

1. What is MPT in Ethereum?

MPT (Merkle Patricia Trie) is a hybrid data structure combining Merkle Trees and Patricia Tries for efficient state storage and verification.

2. Why were PoW fields removed in Ethereum 2.0?

Ethereum 2.0 transitions to Proof-of-Stake (PoS), eliminating PoW-specific fields like Difficulty, Nonce, and MixHash.

3. How does Ethereum handle transaction fees?

Fees are calculated as GasUsed × GasPrice and paid to miners/validators.

4. What’s the purpose of the Bloom filter?

It enables fast checks for transaction logs in receipts without full data scans.

5. Can uncle blocks appear in Ethereum 2.0?

No. Uncle blocks are exclusive to PoW and are deprecated in PoS.

👉 Explore Ethereum staking in PoS 2.0