Class-29
Class 29 – Ethereum 2.O Explainer, Phases, PoS & Serenity
Class Slides: Class 29.1
This lecture focuses on understanding the lifecycle of validators in Ethereum 2.0, requirements for becoming a validator, validator statuses, and practical implementation through Solidity smart contracts for the deposit and validator systems.
Key Topics Covered:
1. Validators in Ethereum 2.0
Validators replace miners in Ethereum 2.0’s Proof of Stake mechanism.
To become a validator, one must have a computer, stable internet connection, and deposit 32 ETH into the Ethereum 1.0 deposit contract.
Validators propose new blocks, participate in committees by signing attestations, aggregate attestations, and maintain communication with a trusted beacon node.
2. Validator Lifecycle and Statuses
The validator’s status moves through different stages:
Deposited: When 32 ETH is deposited, the validator is registered but not yet active.
Activation Queue: After 1 epoch, validators become eligible for activation based on network rules.
Activated: Validators start performing duties like proposing and attesting blocks and earning rewards.
Slashed: Validators misbehaving (e.g., double voting) are slashed and forced to exit.
Exited: Validators can exit voluntarily, by slashing, or due to insufficient funds. After exiting, withdrawal of funds happens after a delay.
3. Deposit Contract (Solidity Implementation)
The deposit contract allows users to simulate depositing ETH:
Requires a minimum of 1 ETH for simulation purposes.
Tracks user deposits through a mapping structure.
Allows users to deposit and withdraw ETH (in simulation; actual ETH2 staking does not allow withdrawal until protocol withdrawal conditions are met).
Includes functionality for the contract owner to destroy the contract if necessary.
4. Validator Contract (Solidity Implementation)
The validator contract simulates registering and deregistering validators:
Users must stake exactly 32 ETH to register as a validator.
Validators can deregister and withdraw their staked ETH.
The contract includes functionality to check if an address is currently an active validator.
Events are emitted when a validator registers or deregisters for transparency.
This lecture detailed the technical requirements and process of becoming an Ethereum 2.0 validator, the phases a validator goes through, and provided practical smart contract simulations of the deposit and validator registration systems. Understanding these mechanics is critical for grasping how Ethereum’s Proof of Stake infrastructure operates securely and efficiently.
