Proof of Stake replaces energy‑intensive mining with economic stake. Validators lock up native tokens (their stake) and take turns proposing and validating blocks. If they act honestly, they earn rewards; if they cheat or go offline, they are slashed (lose part of their stake) or penalized.
Intuition: In PoS, influence comes from capital at risk, not hardware. Security hinges on aligning incentives so that attacking the chain is more expensive than defending it.
Stake & Validator Set
Users deposit tokens into a staking contract or protocol module; the largest and most reliable depositors become validators (directly or via delegation).
Proposer Selection
One validator is selected for each slot/height to propose a block. Selection uses verifiable randomness (e.g., VRF), RANDAO mixes, or round‑robin weighted by stake.
Attestations / Votes
The rest of the validator set signs votes (justified & finalized checkpoints in BFT‑style PoS, or attestations per slot in chain‑based PoS).
Finality Gadget
BFT rules finalize blocks when supermajority (typically ≥2⁄3 by stake) attests to a checkpoint. Examples: Tendermint Finality, Casper FFG, HotStuff variants.
Slashing & Penalties
Double‑signing or surround votes are punishable by slashing (loss of stake) and ejection. Inactivity yields smaller penalties.
Fork‑choice Rule
When competing chains exist, clients pick the head using a rule like LMD‑GHOST (weight by latest votes) or the BFT commit rule when finalized blocks exist.
Family | Examples | Proposer Selection | Finality | Notes |
---|---|---|---|---|
BFT‑style PoS | Tendermint, HotStuff, Cosmos SDK chains | Round‑robin / weighted by stake; small validator set | Instant once 2⁄3 votes; deterministic | Great UX; requires online supermajority; smaller sets preferred |
Chain‑based PoS + Finality Gadget | Ethereum (Casper FFG + LMD‑GHOST) | Pseudo‑random per slot (RANDAO/VRF) | Economic finality after epochs | Highly scalable validator count; fork‑choice guides head |
Delegated PoS (DPoS) | EOS, TRON | Elected block producers | BFT‑like among producers | High throughput; political governance; centralization risk |
Below is a didactic mini‑protocol (not production‑ready) to illustrate the moving parts.
pubkey
, stake
, status
(active, exited, slashed), last_attested_epoch
.parent_hash
, proposer
, slot
, body
, and attestations
.# pseudo_code: pick proposer for a slot from active validators weighted by stake
from secrets import randbelow
def choose_proposer(validators, epoch_seed, slot):
# Hash(seed||slot||pubkey) to get per-slot pseudo‑random scores; pick max weighted by stake
best = None
best_score = -1
for v in validators:
if v.status != 'active':
continue
score = H(epoch_seed, slot, v.pubkey) / max(1, v.stake)
if score > best_score:
best, best_score = v, score
return best
Real systems use VRFs (Verifiable Random Functions) or mixed RANDAO/random beacons so everyone can verify the draw without bias.
# pseudo_code: validators sign head vote for their committee/slot
def make_attestation(validator, slot, head_hash):
msg = domain_sep + slot.to_bytes(8,'big') + bytes.fromhex(head_hash)
sig = sign(validator.sk, msg)
return {"v": validator.pubkey, "slot": slot, "hash": head_hash, "sig": sig}
# aggregation omitted for brevity; BLS aggregation lets thousands of votes compress into a few signatures
# pseudo_code: mark finality when a supermajority link is observed
def maybe_finalize(epoch_votes):
# epoch_votes: mapping (source, target) → stake_weight
for (src, tgt), weight in epoch_votes.items():
if weight >= supermajority_threshold():
finalize(src)
justify(tgt)
Penalties burn a % of stake and eject the validator.
Use quotes around labels in Mermaid when including parentheses to avoid parser hiccups.
Is PoS vulnerable to the rich getting richer?
Rewards are stake‑proportional, but design choices (delegation caps, progressive penalties, protocol‑level diversification) can mitigate runaway centralization. Liquid staking diversity also helps.
Can an attacker bribe validators to rewrite history?
Economic finality and slashing make successful bribery campaigns very costly; weak‑subjectivity checkpoints prevent old‑key long‑range rewrites.
What happens if ≥ 1/3 goes offline?
Immediate finality may halt, but inactivity penalties gradually restore liveness by reducing offline stake below the supermajority threshold.
This article is conceptual and educational. For production staking, follow your chain’s official validator guides and security hardening practices.