Blockchain Fundamentals

Consensus Mechanisms

Consensus Mechanisms

Module 2 of Blockchain Fundamentals


What Is Consensus?

Consensus is how distributed nodes agree on a single version of truth without a central authority.

The challenge: Nodes can be slow, offline, or malicious. How do honest nodes agree?


The Sybil Problem

In digital systems, identities are free. One attacker could create millions of fake identities.

Sybil attack: Overwhelm a vote-based system with fake identities.

Solution: Make creating an identity costly.

  • Proof of Work: Cost = computation/electricity
  • Proof of Stake: Cost = locked capital
  • Proof of Authority: Cost = reputation

Proof of Work (PoW)

How It Works

  1. Transactions are broadcast to the network
  2. Miners collect transactions into a block
  3. Miners race to find a valid hash (computationally expensive)
  4. First miner to find it broadcasts the block
  5. Other nodes verify and add to their chain
  6. Miner receives block reward + fees

The Mining Puzzle

Find a nonce such that:

SHA256(block_header + nonce) < target

Example target: 0000000000000000000abc...
Hash must start with many zeros

Properties:

  • Hard to find (brute force only)
  • Easy to verify (one hash check)
  • Difficulty adjusts to maintain ~10 min blocks (Bitcoin)

Security Model

Attack cost = cost to acquire 51% of hash power

Current Bitcoin security:

  • ~400 EH/s network hashrate
  • Would cost billions to attack
  • Attack would likely crash BTC price (self-defeating)

Advantages

  • Battle-tested (15+ years)
  • Simple and elegant
  • No stake grinding attacks
  • Fair launch possible (anyone can mine from day 1)

Disadvantages

  • High energy consumption (~100 TWh/year for Bitcoin)
  • Mining centralization (economies of scale)
  • Slow finality (need 6+ confirmations)
  • Hardware arms race (ASICs)

Proof of Stake (PoS)

How It Works

  1. Validators lock up stake (collateral)
  2. Protocol selects validator to propose block
  3. Other validators attest to validity
  4. Valid blocks are added to chain
  5. Validator receives rewards
  6. Misbehavior → stake is slashed (destroyed)

Selection Mechanisms

MethodHow It WorksUsed By
Random selectionWeighted by stakeEthereum
Coin ageStake × time heldPeercoin
Round robinValidators take turnsSome private chains
DelegatedToken holders vote for validatorsEOS, Cosmos

Security Model

Attack cost = cost to acquire 33%+ of staked tokens

Ethereum security:

  • ~30M ETH staked
  • Would cost $60B+ to attack
  • Attacker's stake would be slashed

Advantages

  • ~99.9% less energy than PoW
  • Lower barrier to participation (no special hardware)
  • Faster finality possible
  • Native slashing for misbehavior

Disadvantages

  • "Nothing at stake" problem (partially solved)
  • Long-range attacks (checkpoints solve this)
  • Wealth concentration (rich get richer)
  • More complex than PoW

PoW vs PoS Comparison

PropertyProof of WorkProof of Stake
Sybil resistanceComputationCapital
Energy useVery highVery low
HardwareSpecialized (ASICs)Consumer grade
FinalityProbabilisticEconomic/Deterministic
Attack costBuy/build hardwareBuy tokens
Fair launchPossibleDifficult
DecentralizationMining poolsStake concentration

Other Consensus Mechanisms

Delegated Proof of Stake (DPoS)

Token holders vote for a small set of validators (21-100).

Used by: EOS, Tron, BSC

Tradeoff: Faster/cheaper, but more centralized.

Proof of Authority (PoA)

Known, trusted validators (identity = stake).

Used by: Private chains, testnets

Tradeoff: Fast and cheap, but requires trust.

Proof of Space/Storage

Stake = allocated disk space.

Used by: Chia, Filecoin

Tradeoff: Less energy than PoW, repurposes hardware.

Proof of History (PoH)

Cryptographic clock for ordering without consensus.

Used by: Solana

Tradeoff: Very fast, but adds complexity.


Byzantine Fault Tolerance (BFT)

Classical consensus for known validator sets.

PBFT (Practical BFT)

  1. Leader proposes block
  2. Validators exchange "prepare" messages
  3. Validators exchange "commit" messages
  4. Block is finalized (no reverts)

Properties:

  • Instant finality
  • Tolerates f failures with 3f+1 nodes
  • Doesn't scale well (O(n²) messages)

Tendermint

PBFT variant optimized for blockchain.

Used by: Cosmos ecosystem

Properties:

  • Instant finality
  • Better performance than classic PBFT
  • Requires 2/3 honest validators

Finality

When is a transaction "final" (irreversible)?

Probabilistic Finality (PoW)

Never truly final, but increasingly unlikely to revert.

Confirmations    Probability of Revert
1                ~10%
3                ~1%
6                ~0.01%
100              Effectively zero

Economic Finality (PoS)

Reverting would cost attackers more than they'd gain.

Ethereum:
After 2 epochs (~13 min): Would cost 1/3 of stake to revert
After finalization: Cannot revert without social consensus

Absolute Finality (BFT)

Once committed, mathematically impossible to revert.

Tendermint: Finality in ~6 seconds

The Blockchain Trilemma

Vitalik Buterin's observation: Hard to optimize all three simultaneously.

        Security
           /\
          /  \
         /    \
        / Pick \
       /   2    \
      /          \
     /____________\
Decentralization  Scalability
ChainSecurityDecentralizationScalability
BitcoinHighHighLow (~7 TPS)
EthereumHighMediumMedium (~30 TPS)
SolanaMediumLowHigh (~65k TPS)
BSCMediumLowHigh

L2 solutions attempt to break the trilemma by inheriting L1 security while scaling.


Key Takeaways

  1. Consensus solves the Sybil problem by making identities costly
  2. PoW uses energy, PoS uses capital — both create security
  3. Finality varies: Probabilistic, economic, or absolute
  4. Tradeoffs are unavoidable — the blockchain trilemma
  5. No perfect consensus — choose based on requirements
  6. Hybrid approaches are emerging (Ethereum's PoS + checkpoints)

Questions to Consider

  1. Is PoW's energy use justified by its security properties?
  2. Does PoS centralize power with wealthy stakeholders?
  3. How many confirmations do you wait for large transactions?
  4. Can the blockchain trilemma ever be solved?