Introduction
Ethereum sharding represents a groundbreaking approach to blockchain scalability, addressing the limitations of traditional blockchains where transaction capacity is constrained by individual node capabilities (O(c)). This document explores Ethereum's quadratic sharding solution—a two-layer architecture designed to achieve O(c²) system-wide capacity without requiring hard forks.
Key Components of Sharding
1. Validator Manager Contract (VMC)
- Functionality: Maintains the sharding system on the main chain.
Core Functions:
deposit(): Adds validators proportional to staked ETH.get_eligible_proposer(): Selects collators pseudorandomly for each shard/period.add_header(): Processes new collation headers under strict conditions.
2. Collation Structure
Header Fields:
shard_id,parent_hash,transaction_root,state_root,receipt_root.
Validity Criteria:
- Gas usage ≤
COLLATION_GASLIMIT(10M gas). - Parent collation must be accepted.
- Proposer address must match VMC’s eligibility check.
- Gas usage ≤
3. Stateless Clients
- Witness Data: Merkle proofs enabling transaction validation without full state storage.
- Access Lists: Transactions specify accessible accounts/storage to prevent unauthorized access attempts.
# Example Vyper pseudocode for VMC’s `get_eligible_proposer`:
@public
def get_eligible_proposer(shard_id: uint256, period: uint256) -> address:
seed: bytes32 = blockhash(period * PERIOD_LENGTH - 1)
return self.validators[hash(seed + shard_id) % len(self.validators)].addrProtocol Enhancements
1. Transaction Format
- New Fields:
chain_id,shard_id,access_list,witness. - Security: Access lists restrict state access to predefined accounts/storage.
2. Two-Layer Trie Redesign
Storage Model: Single-layer trie consolidating balances, code, and storage keys.
- Balance:
sha3(X) ++ 0x00 - Code:
sha3(X) ++ 0x01 - Storage:
sha3(X) ++ 0x02 ++ K
- Balance:
3. Gas Economics
- Dynamic Pricing: Adjustments for witness data processing and cross-shard operations (TBD).
4. Future Phases
| Phase | Focus |
|---|---|
| 2 | Two-way pegging (inter-shard asset transfers) |
| 3 | Tight coupling (block validity tied to collation availability) |
| 4 | Data availability proofs |
FAQ Section
Q1: How does sharding improve Ethereum’s throughput?
By parallelizing transaction processing across 100 independent shards, each handling O(c) gas, the network achieves O(c²) aggregate capacity.
Q2: What prevents collators from including invalid transactions?
Stateless clients require senders to provide witnesses (Merkle proofs) for all accessed state, enabling validation without full shard state.
Q3: How are collators selected?
VMC pseudorandomly assigns eligible proposers per shard/period based on staked ETH, verified via get_eligible_proposer().
👉 Explore Ethereum’s official sharding roadmap