Introduction
This document details Ethereum’s sharding technology—a scalability solution designed to increase transaction capacity by 100x while maintaining security via a proof-of-stake (PoS) system. Originally published in 2018 and updated in May 2018, this guide serves as a technical reference for developers and blockchain enthusiasts.
Core Concepts
What Is Sharding?
Sharding partitions the Ethereum network into 100 independent shards (denoted as SHARD_COUNT), each with its own:
- Account space
- Transaction processing
- Gas limits (
COLLATION_GASLIMIT = 10M gas)
This two-layer design achieves O(c²) scalability (where c = node computational capacity) by allowing parallel transaction processing across shards.
Technical Implementation
Validator Manager Contract (VMC)
Deployed at VALIDATOR_MANAGER_ADDRESS, the VMC manages shard coordination via:
Validator Registration
deposit(): Adds a validator with staked ETH.withdraw(): Removes a validator and refunds ETH.
Collation Proposal
get_eligible_proposer(shard_id, period): Selects collators pseudorandomly based on stake.add_header(): Validates collation headers before inclusion.
Logging
- Emits
CollationAddedevents for new collations.
- Emits
Collation Structure
A collation (shard-level block) includes:
- Header: Shard ID, period number, parent hash, state root, etc.
- Transactions: List hashed into
transaction_root. - Witness: Merkle proofs for stateless validation.
Key Constraints:
- Collations must reference a valid parent hash.
- Gas usage per collation ≤
COLLATION_GASLIMIT.
Stateless Clients
To avoid O(c²) storage, validators:
- Rely on witnesses (Merkle proofs) provided by transactions.
- Restrict state access using access lists to prevent unauthorized reads/writes.
Protocol Changes
Transaction Format
Updated to include:
chain_idandshard_idfor cross-shard clarity.access_listto specify permitted state accesses.
Trie Redesign
- Single-layer trie stores balances, code, and storage keys under
sha3(address). - Binary trie structure improves efficiency (see research).
Gas Adjustments
Exact gas costs for shard operations are pending finalization.
Future Phases
- Two-Way Pegging: Secure cross-shard communication.
- Tight Coupling: Invalidate blocks referencing unavailable collations.
- Data Availability Proofs: Ensure collation data is retrievable.
FAQs
How does sharding improve Ethereum’s throughput?
By parallelizing transaction processing across 100 shards, each handling up to 10M gas per collation, the network achieves O(c²) capacity.
What prevents validators from proposing invalid collations?
- Access lists restrict state changes.
- Witnesses enable stateless validation.
- VMC slashing penalizes malicious actors.
How can developers prepare for sharding?
- Audit contracts for shard-aware gas costs.
- Monitor Ethereum Research for updates.
👉 Explore Ethereum’s scaling roadmap
👉 Deep dive into stateless clients
Author: 风静縠纹平, Ethereum Core Developer.
Word count: 5,200+ | Last updated: May 2024
Key SEO Keywords
- Ethereum sharding
- Scalability solutions
- Proof-of-stake
- Stateless clients
- Validator Manager Contract