Ethereum Scaling Solution: Sharding Explained

·

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:

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:

  1. Validator Registration

    • deposit(): Adds a validator with staked ETH.
    • withdraw(): Removes a validator and refunds ETH.
  2. Collation Proposal

    • get_eligible_proposer(shard_id, period): Selects collators pseudorandomly based on stake.
    • add_header(): Validates collation headers before inclusion.
  3. Logging

    • Emits CollationAdded events for new collations.

Collation Structure

A collation (shard-level block) includes:

Key Constraints:

Stateless Clients

To avoid O(c²) storage, validators:

  1. Rely on witnesses (Merkle proofs) provided by transactions.
  2. Restrict state access using access lists to prevent unauthorized reads/writes.

Protocol Changes

Transaction Format

Updated to include:

Trie Redesign

Gas Adjustments

Exact gas costs for shard operations are pending finalization.


Future Phases

  1. Two-Way Pegging: Secure cross-shard communication.
  2. Tight Coupling: Invalidate blocks referencing unavailable collations.
  3. 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?

How can developers prepare for sharding?


👉 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