Introduction to Proof of Stake (PoS)
Proof of Stake (PoS) is a decentralized consensus mechanism that coordinates validator nodes to:
- Collect transactions
- Package blocks
- Validate blocks
- Maintain blockchain security
Key requirements for validators:
- 32 ETH stake locked in a smart contract
- Dishonest behavior results in slashed ETH (e.g., proposing multiple blocks)
Ethereum Client Architecture
Node Client Components
Validators require three specialized clients:
- Execution Client: Processes transactions
- Consensus Client: Manages block validation
- Validator Client: Participates in consensus
Communication Protocol
Nodes use gRPC for efficient inter-client communication
Block Proposer Selection Process
Randomized Validator Selection
- Each slot (12-second interval) randomly selects one validator
- Uses RANDAO algorithm for unpredictability
- Selection probability weighted by effective ETH balance (max 32 ETH)
// Simplified selection logic
func selectProposer(validators []Validator, seed uint64) int {
randSeed := mixRANDAO(seed)
return randSeed % len(validators)
}Anti-Manipulation Measures
- Validator choices fixed two epochs in advance
- Single proposer per slot enforced
- Double-block proposals are slashable offenses
Transaction Processing Pipeline
4-Step Validation Process
Transaction Signing
- Users sign via wallets with gas parameters
- EIP-1559 modified gas fee dynamics
Initial Validation
- Balance and signature verification
- Intrinsic gas calculation
function validateTx(Tx memory tx) returns (bool) {
require(tx.sender.balance >= tx.value);
require(validSignature(tx));
return true;
}Mempool Distribution
- Nodes broadcast valid transactions
- Local caching for block inclusion
Block Proposal & Execution
- Proposer packages transactions
- State updates via execution client
- Beacon block broadcast via consensus client
Block Finalization Process
Epoch-Based Confirmation
- Slot: 12-second block interval
- Epoch: 32 slots (6.4 minutes)
- Checkpoint: First slot of each epoch
Two-Phase Validation
- Justification: Requires 2/3 staked ETH votes
- Finalization: Subsequent justified block upgrades status
def check_finalization(block):
if block.justified and has_child(block):
block.finalized = TrueFork Resolution with LMD-GHOST
Gasper's fork-choice algorithm:
- Selects heaviest subtree (most attestations)
- Considers only latest validator messages
- Follows greedy heaviest chain rule from genesis
👉 Advanced consensus mechanisms
Validator Incentives Structure
Base Reward Calculation
base_reward = effective_balance * (64 / (4 * √total_stake))Reward Components
| Component | Weight | Description |
|---|---|---|
| Source Vote | 14 | Voting for checkpoint pairs |
| Target Vote | 26 | Timely justified checkpoint votes |
| Head Vote | 14 | Correct block head votes |
| Sync Committee | 2 | Participation reward |
| Proposer Bonus | 8 | Block proposal incentive |
Additional Incentives
- Fast Attestation: Rewards decrease linearly with delay (1/delay)
- Slashing Evidence: Proposers earn 1/512 of slashed validators' stake
Slashing Conditions
Three-Tier Penalty System
Minor Penalties:
- Offline validators lose equivalent attestation rewards
Slashing:
- 1 ETH minimum + 1/32 stake burned
- 36-day exit period with correlation penalty
Inactivity Leak:
- Activates after 4 unfinalized epochs
- Reduces inactive validators' stake below 1/3 threshold
PoS vs PoSA Comparison
| Feature | PoS | PoSA |
|---|---|---|
| Validator Selection | Decentralized | Pre-approved set |
| Finality Time | ~12.8 minutes | 6-9 seconds |
| Consensus Threshold | 2/3 total stake | 2/3 validators |
| Security Model | Economic | Trust + Economic |
| Block Time | 12 seconds | 3 seconds |
FAQ Section
Q: How does Ethereum prevent validator centralization in PoS?
A: Through:
- Minimum 32 ETH requirement
- Algorithmic randomness in selection
- Progressive slashing for misbehavior
Q: What happens during network partitions?
A: The inactivity leak mechanism gradually reduces offline validators' influence until the active majority can finalize blocks.
Q: Can validators change their staked amount?
A: Yes, but effective balance caps at 32 ETH for reward calculation purposes.
Q: How does RANDAO ensure fair proposer selection?
A: By mixing validator-provided hashes with epoch-dependent seeds, making future selections unpredictable.
Q: What's the difference between justification and finalization?
A: Justification requires one attestation quorum, while finalization needs two consecutive justified checkpoints.