Consensus Mechanisms
Consensus is the process of getting distributed nodes to agree on a single history. It solves two problems: Sybil Resistance (Who can vote?) and Chain Selection (Which history is true?).
Problem 1: Sybil Resistance
If voting was "one IP address = one vote", an attacker could spin up 1,000 servers to control the network. We need to make voting expensive.
Proof of Work (PoW)
"One CPU = One Vote". You prove you are not a Sybil attacker by burning real-world energy.
- Scarcity: Hardware & Energy
- Penalty: Wasted electricity cost
Proof of Stake (PoS)
"One Dollar = One Vote". You prove you are not a Sybil attacker by locking up capital (ETH).
- Scarcity: Capital (Tokens)
- Penalty: Slashing (Burning 32 ETH)
Problem 2: Fork Choice Rules
If two valid blocks are produced at the same time, the network splits (forks). Nodes need a mathematical rule to decide which path to follow.
Longest Chain (Nakamoto Consensus)
Used by Bitcoin. The chain with the most cumulative difficulty (Proof of Work) is the truth. Security is probabilistic: after 6 blocks, it is statistically impossible for an attacker to rewrite history without 51% of global energy.
GHOST (Heaviest Subtree)
Used by Ethereum. Instead of just length, it counts "votes" (attestations) from validators on various branches. This is faster and more secure against certain attacks. Modern PoS adds a "Finality Gadget" (Gasper), making blocks Final (irreversible) after ~15 minutes.
The Security Asymmetry
Why PoS is more secure (The "Spawn Camp" Defense)
In Proof of Work, if an attacker buys 51% of mining hardware, they can attack the chain forever. The only defense is to change the hashing algorithm (bricking all hardware, including honest miners).
In Proof of Stake, the protocol fights back automatically.
If an attacker tries to revert Finalized blocks, the protocol detects the contradictory votes and Slashes (burns) their entire stake. The attacker loses billions of dollars instantly. To attack again, they must buy new coins (pumping the price) and burn them again. The defender (the chain) creates immense financial asymmetry.
Frequently Asked Questions
Why can't we just vote on the state?▼
Because on the internet, nobody knows if you are one person or one million scripts. Without a scarce resource (Energy or Capital) to weigh the votes, Sybil attackers would trivially control 99% of the voices.
What happens to my coins during a Fork?▼
They exist on both chains. If Ethereum splits into ETH-A and ETH-B, you technically own coins on both networks. However, usually only one chain retains economic value (the one stablecoins and exchanges support), rendering the other worthless.
Is a 51% attack realistic?▼
On major networks like Bitcoin or Ethereum? No, the cost would be hundreds of billions of dollars. On small, low-hashrate chains? Yes, it happens frequently (e.g., Ethereum Classic has been attacked multiple times).