Learning Objectives:
-
Understand Proof of Stake and its variants
-
Compare PoS with PoW
-
Explore alternative consensus mechanisms
1.6.1: Proof of Stake (PoS) Fundamentals
Definition:
Proof of Stake is a consensus mechanism where validators are chosen to create new blocks based on the amount of cryptocurrency they hold (stake) and are willing to “lock up” as collateral.
Key Concepts:
PoS Components: ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ Stake: Amount of cryptocurrency locked as collateral │ │ │ │ Validator Selection: Random selection weighted by stake │ │ │ │ Block Creation: Validator creates and proposes block │ │ │ │ Validation: Other validators verify block │ │ │ │ Slashing: Penalty for malicious behavior │ │ │ │ Rewards: Validators earn fees and new tokens │ │ │ └─────────────────────────────────────────────────────────────────────┘
Validator Selection Probability:
Probability of being selected as validator: P(i) = Stake(i) / Total_Stake Where: - Stake(i) = Amount staked by validator i - Total_Stake = Sum of all staked tokens Example: - Validator A: 1,000 ETH staked - Validator B: 500 ETH staked - Total Stake: 10,000 ETH P(A) = 1,000 / 10,000 = 10% P(B) = 500 / 10,000 = 5%
1.6.2: PoS Variants
1. Pure Proof of Stake (PoS)
Validators are selected based on stake alone.
2. Delegated Proof of Stake (DPoS)
Token holders vote for delegates (witnesses) who validate transactions.
DPoS Structure: ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ Token Holders │ │ │ │ │ │ Vote │ │ ▼ │ │ Delegates (Witnesses) - typically 21-101 active │ │ │ │ │ │ Validate transactions, create blocks │ │ │ │ │ ▼ │ │ Network │ │ │ │ Benefits: │ │ • Faster block times │ │ • Lower energy consumption │ │ • More predictable performance │ │ │ │ Risks: │ │ • Centralization risk │ │ • Collusion possible │ │ • Voter apathy │ │ │ └─────────────────────────────────────────────────────────────────────┘
3. Liquid Proof of Stake (LPoS)
Allows token holders to delegate stake to validators while maintaining liquidity.
4. Bonded Proof of Stake (BPoS)
Validators must bond (lock) tokens for a fixed period.
1.6.3: Ethereum’s Proof of Stake (Casper)
Casper FFG (Friendly Finality Gadget):
Casper FFG: ┌─────────────────────────────────────────────────────────────────────┐ │ │ │ Validators deposit 32 ETH to become validators │ │ │ │ Epochs: 32 slots (~6.4 minutes) │ │ │ │ Checkpoints: Blocks at epoch boundaries │ │ │ │ Finality: Validators vote on checkpoints │ │ • 2/3 votes = checkpoint finalized │ │ │ │ Slashing Conditions: │ │ 1. Double voting (vote for two different checkpoints) │ │ 2. Surround voting (vote that surrounds previous vote) │ │ │ └─────────────────────────────────────────────────────────────────────┘
Ethereum PoS Economics:
| Parameter | Value |
|---|---|
| Minimum Stake | 32 ETH |
| Total Stake | ~30M ETH (as of 2024) |
| Active Validators | ~900,000 |
| Annual Issuance | ~0.5-1% of total supply |
| Validator APR | ~3-5% |
| Slashing Penalty | Up to 100% stake |
1.6.4: Other Consensus Mechanisms
1. Proof of Authority (PoA)
Validators are pre-approved, trusted entities.
PoA Characteristics: - Validators are known and approved - Validator identity is at stake - Used in private/consortium blockchains - Fast block times (~5 seconds) - Very low energy consumption Examples: POA Network, VeChain, Binance Smart Chain (initial)
2. Proof of History (PoH)
Creates a historical record that proves events occurred at specific times.
PoH Mechanism: - Verifiable delay function (VDF) - Cryptographic timestamping - Events ordered by time - Used in Solana Benefits: - High throughput - Low latency - Scalable
3. Proof of Burn (PoB)
Validators burn (destroy) coins to gain mining rights.
PoB Mechanism: 1. Send coins to unspendable address (burn) 2. Burned coins counted as "stake" 3. Mining rights proportional to burned coins 4. No ongoing energy consumption
4. Proof of Capacity (PoC)
Uses storage space instead of computational power.
PoC Mechanism: 1. Pre-compute hashes (plotting) 2. Store in hard drives 3. Mining = retrieving plots 4. Energy efficient
5. Practical Byzantine Fault Tolerance (PBFT)
Classic distributed consensus for permissioned networks.
PBFT Algorithm: 1. Client sends request to primary node 2. Primary sends pre-prepare message 3. Replicas send prepare message 4. Replicas send commit message 5. Client receives reply Tolerates f faulty nodes where: Total Nodes ≥ 3f + 1
6. Avalanche Consensus
Uses repeated random sampling to achieve consensus.
Avalanche Process: 1. Node samples random peers 2. Asks about transaction 3. If majority agree, accept 4. Repeat until confidence threshold met 5. Transaction confirmed Properties: - Probabilistic finality - High throughput - Low latency
1.6.5: PoW vs PoS Comparison
| Feature | Proof of Work | Proof of Stake |
|---|---|---|
| Energy Usage | Very High | Very Low |
| Hardware Requirements | Specialized (ASICs) | Standard computers |
| Entry Barrier | High (hardware cost) | Low (stake required) |
| Security | Proven (15+ years) | Mathematically proven |
| Finality | Probabilistic | Deterministic |
| Scalability | Limited | Higher |
| Decentralization | Higher (in theory) | Lower (wealth concentration) |
| Attack Vector | 51% hash power | 51% stake |
| Attack Cost | High (energy) | High (capital) |
| Environmental Impact | High | Low |
1. PoS Security Analysis
Nothing at Stake Problem:
Problem: In PoW, miners cannot mine on multiple chains (energy cost). In PoS, validators can validate on multiple chains (free). Solution: Slashing - Penalty for validating on multiple chains - Loss of stake - Economic disincentive Slashing Conditions: 1. Double signing: Signing two different blocks at same height 2. Surround voting: Voting for conflicting checkpoints 3. Liveness attacks: Going offline Slashing Penalties: - 1% for minor violations - 100% for severe violations
Long-Range Attacks:
Problem: Attacker acquires old private keys ↓ Starts chain from genesis (with majority stake) ↓ Creates long history of blocks ↓ Network may be confused Solutions: 1. Weak subjectivity (social consensus) 2. Checkpointing (periodic finality) 3. Key rotation (periodic key changes)
2. Ethereum PoS Economics
Validator Economics:
Validator Revenue = Block_Reward + Transaction_Fees + MEV Block_Reward = Base_Reward × (1 + Extra_Reward) Base_Reward = (Total_Stake)^(-0.5) × 64 Extra_Reward: - Block proposals: ~1/32 chance per epoch - Attestations: ~1/32 chance per epoch - Sync committees: ~1/32 chance per epoch Operating Cost: - Hardware: $500-2000 initial - Electricity: $50-200/month - Internet: $50-100/month - Time: 10-20 hours/month Net Profit = Revenue - Operating Cost - Slashing_Risk
Validator Pools:
Validator Pool Benefits: 1. Lower entry barrier (less than 32 ETH) 2. Shared infrastructure costs 3. Professional management 4. Higher uptime 5. Reduced slashing risk Pool Types: 1. Centralized (staking providers) 2. Decentralized (liquid staking - Lido, Rocket Pool) 3. Delegated (token holders delegate to validators) Liquid Staking: - User deposits ETH - Receives stETH (staked ETH) - Earns rewards automatically - Can trade/use stETH in DeFi
3. PBFT Detailed Algorithm
PBFT Consensus Process: 1. Request Phase: Client sends request to primary (node 0) 2. Pre-Prepare Phase: Primary assigns sequence number Sends pre-prepare message to all replicas 3. Prepare Phase: Replicas verify request Send prepare message to all replicas Wait for 2f prepare messages 4. Commit Phase: Replicas send commit message Wait for 2f commit messages Execute request 5. Reply Phase: Replicas send reply to client Client waits for f+1 identical replies Message Complexity: O(n²) where n = number of nodes
4. Consensus Comparison Table
| Mechanism | Energy | Scalability | Decentralization | Finality | Examples |
|---|---|---|---|---|---|
| PoW | Very High | Low | High | Probabilistic | Bitcoin, Litecoin |
| PoS | Very Low | Medium | Medium | Deterministic | Ethereum, Cardano |
| DPoS | Very Low | High | Low | Deterministic | EOS, Tron |
| PoA | Very Low | High | Very Low | Deterministic | Private chains |
| PoH | Low | Very High | Medium | Deterministic | Solana |
| PBFT | Low | Medium | Very Low | Deterministic | Hyperledger |
| Avalanche | Low | Very High | High | Probabilistic | Avalanche |