03 consensus

03 — Mecanismos de Consenso

Como blockchains atingem acordo distribuído sobre ordem de transações. Sem consenso, sem blockchain.


1. Taxonomia

Família Exemplos Característica
*roofofWork (PoW)* Bitcoin, ETC, Litecoin, Monero, Dogecoin Custo energético; Nakamoto-style
*roofofStake (PoS)* Ethereum 2.0, Solana, Cardano, Avalanche, Polkadot, Cosmos Custo capital; pode ser BFT ou chain
*yzantine Fault Tolerant (BFT)* Tendermint, HotStuff (Aptos, Sui, Diem), Algorand BA*, IBFT Finality determinística; comunicação alta
*roofofAuthority (PoA)* BSC (parcial), Polygon PoS (parcial), private chains Validators conhecidos, low decentralization
*AG-based* Hashgraph, Avalanche (Snowman), IOTA, Conflux Não-linear; potencial alta TPS
*roofofHistory (PoH)* Solana VDF sequential; ordering pre-consensus
*roofofSpace / ProofofSpacetime* Chia, Filecoin, Spacemesh Storage como recurso
*roofofBurn* Counterparty (legacy), Slimcoin Sacrifício de tokens
*roofofCoverage* Helium Wireless coverage demonstration
*ybrid* Decred (PoW + PoS), Filecoin (PoSt + EC) Combinações

2. ProofofWork (PoW)

Originado em *ashcash*(Adam Back, 1997). Aplicado a blockchain por Satoshi (2008).

Mecânica

Bloco header tem campo *once* Miner varia nonce até: $\(H(\text{header}) < \text{target}\)$

Target = 2^256 / difficulty. Difficulty ajusta a cada 2016 blocos (Bitcoin) para manter ~10 min/bloco.

Cadeia mais pesada (Nakamoto consensus)

Nó escolhe chain com mais *rabalho acumulado*(não comprimento). Reorgs possíveis até finality probabilística (6 confirmações ≈ ~99.99% safe).

Algoritmos

Algoritmo Chain Característica
*HA-256d* Bitcoin ASIC-dominated
*crypt* Litecoin Memory-hard (em teoria; ASICs eventualmente)
*thash* Ethereum 1.0 (pre-Merge), ETC Memoryhard, GPUfriendly até 2022
*andomX* Monero CPUfriendly, ASICresistant
*HeavyHash* Kaspa Custom
*lake2b* Sia (Siacoin)
*ryptoNight* Monero (legacy)
*quihash* Zcash (legacy, ZIP208 preHalo) Memory-hard
*rogPoW* proposed for ETH (rejected) GPU-tuned
*11* Dash 11 hash functions chain

Pros / Cons

*ros*

  • Battle-tested (Bitcoin 15+ anos).
  • Sybil resistance via real-world cost (energia).
  • Simples conceitualmente.
  • Não exige social trust (just hashes).

*ons*

  • Consumo energético massivo (~150 TWh/ano Bitcoin global, ~Argentina).
  • Mining centralization (China + EUA + Cazaquistão dominam; pools concentram).
  • Reorg risk de small chains.
  • Slow finality (~60 min Bitcoin probabilística).

Estado em 2026

Bitcoin: ~700 EHs hashrate. Halving #4 em 2024 (3.125 BTCblock). Próximo halving 2028.

Ethereum: completou *he Merge*em set/2022; PoW desativado. Ethereum Classic continua PoW.


3. ProofofStake (PoS)

Stake (tokens) como collateral. Validators selecionados proportional ao stake. Misbehaving = slash (lose stake).

Variantes

Chainbased PoS (Nakamotostyle PoS)

Validator selecionado por algorithm (VRF, randomness) constructs block. Chain selection like PoW mas weighted by stake.

Exemplos: Peercoin (2012, primeiro), Cardano (Ouroboros).

Committeebased / BFTPoS

Subset de validators (committee) runs BFT consensus em cada slot. Determinístico finality.

Exemplos: Cosmos (Tendermint), Algorand (BA*), Ethereum 2.0 (Casper FFG + LMD-GHOST).

DPoS (Delegated PoS)

Token holders *ote*para um set pequeno de delegates (21 EOS, 100 Tron). Faster but lower decentralization.

Exemplos: EOS (legacy), Tron, BSC (parcial), Steem.

Ethereum 2.0 (post-Merge)

  • *alidators* 32 ETH stake per validator slot. Atualmente ~1M validators ativos.
  • *eacon Chain* PoS chain consensus.
  • *lot* 12 segundos. Validator chosen via RANDAO to propose block.
  • *poch* 32 slots (~6.4 min). Attestations finalizam epochs.
  • *asper FFG (Friendly Finality Gadget)* 2 epochs sem desafio → finality.
  • *MD-GHOST* fork choice within finalized chain.
  • *lashing* surround vote / double vote → forfeit ETH (1-100% based on severity + correlation).

Slashing conditions

  • *ouble signing* assinar dois blocos no mesmo slot.
  • *urround vote* attestation conflicting with prior.
  • *nactivity leak* < 2/3 online → progressive penalty para offline (forces finality recovery).

MEV no PoS

*roposerBuilder Separation (PBS)* validator (proposer) *ão*constrói bloco; recebe préconstruído de *uilder*que outbid em mev-boost auction.

*lashbots mevboost* software que separa builder de proposer. ~90% dos blocos Ethereum usam mevboost. Builders dominantes: Beaverbuild, rsync, Titan.

*nclusion lists*(EIP-7547, em discussão): proposer pode forçar inclusão de certas txs.

Pros / Cons

*ros*

  • Energia ~99.9% menor que PoW.
  • Faster finality (em BFT-PoS, segundos).
  • Slashing punir bad actors.
  • Economic security explicit (\(1B+ staked = \)1B+ cost to attack).

*ons*

  • Nothingatstake (theoretical; mitigado por slashing).
  • Wealth concentration → power concentration.
  • Initial distribution problem ("rich get richer").
  • Long-range attack: validator com stake antigo pode forjar history (requires weak subjectivity).
  • Liquid staking centraliza (Lido controla 30%+ do staking ETH 2026).

4. Tendermint / Cosmos

*ae Kwon, Ethan Buchman 2014–2016* Tendermint BFT + Cosmos SDK.

Tendermint consensus

Round-based BFT:

  1. *ropose* leader sends block.
  2. *revote* validators vote.
  3. *recommit* validators commit if 2/3+ prevoted.
  4. *ommit* block finalized if 2/3+ precommitted.

Each round ~2-7s. *nstant finality*após commit.

Requires \(n \geq 3f + 1\) for \(f\) Byzantine.

Cosmos SDK

Framework Go para construir blockchains app-specific. Adoção: Osmosis, Injective, Akash, Kava, Stargaze, Sei, Celestia.

IBC (Inter-Blockchain Communication)

Protocol para transfer + messaging entre Cosmos chains. Padronizado, native. Vê 11-bridges-interop.md.


5. HotStuff (Aptos, Sui, Diem legacy)

*aofan Yin et al. 2018 (Facebook Diem research)* Refinement de PBFT com:

  • *inear communication* \(O(n)\) msgs por round (vs \(O(n^2)\) PBFT).
  • *esponsiveness* progress at network speed, not timeout-driven.
  • *hain quorum certificates (QCs)* pipeline 3 rounds.

Adoção:

  • *ptos*(DiemBFT v4 = HotStuff variant).
  • *ui*(Narwhal + Bullshark — DAG + HotStuff).
  • *onad*(parallel EVM + HotStuff-style).
  • *iem*(descontinuado 2022).

6. Algorand

*ilvio Micali 2017*(Turing Award 2012). BFT-PoS com VRF.

Mechanics

  1. Block proposer chosen via *RF*(verifiable random function): each validator computes; only winners ( top of probabilistic threshold) propose.
  2. *ommittee*also chosen via VRF.
  3. *A★*(Byzantine Agreement star): VRF-based committee runs Byzantine agreement.

Properties

  • *ure PoS* stake é só ingresso (no slashing in original; added later).
  • *inality* instant (committee approves block).
  • *ork-free* VRF + BA★ guarantees single chain.

Adoption

ASA (Algorand Standard Assets), Folks Finance, Algofi (defunct). USDC native em Algorand. Adoção institucional > retail.


7. Avalanche

*min Gün Sirer et al. 2018* Family of consensus protocols.

Avalanche / Snowman

Repeated *ub-sampled voting*

  1. Validator queries random \(k\) peers.
  2. Asks "what's the head?".
  3. If \(\alpha\) of \(k\) agree → adopt.
  4. Repeat \(\beta\) times → confident finalization.

Probabilistic finality em ~1s.

Three chains

  • *-chain (Avalanche Native)* UTXO + Avalanche consensus.
  • *chain (Contract)* EVMcompatible, Snowman.
  • *-chain (Platform)* validator management + subnet coordination.

Subnets

Custom blockchain spawn (now "L1s" rebranding 2024). Permissioned ou public.


8. Cardano

*harles Hoskinson (Ethereum cofounder)* IOHK. Launch 2017.

Ouroboros

ProofofStake research-led family of protocols (Praos, Genesis, Hydra).

  • *lots* 1 second.
  • *poch* 432k slots (5 dias).
  • *lot leader* chosen via VRF, weight-proportional to stake.
  • *oin age* not used (vs older PoS designs).

eUTXO model

Extended UTXO: outputs can carry *atum*+ *cript*(validator). Plutus = Haskell-based smart contract platform.

Stake pools

Delegate stake (ADA) to a pool. Pool operator runs node. Rewards distributed proportional. Saturation point (~70M ADA per pool) discourages concentration.

Tempo histórico

Academic research foco: papers publicados antes de código (IOHK + Univ Edinburgh + Lancaster + Tokyo). Marca "evidence-based" mas critica de slow shipping (smart contracts só em set/2021).


9. Polkadot

*avin Wood*(Ethereum cofounder). Launch 2020.

Architecture

  • *elay Chain* PoS, BFT (GRANDPA finality + BABE block production).
  • *arachains* independent chains plugged into relay; share security.
  • *uctions* leases for parachain slots (1-2 years).
  • *rowdloans* locked DOT lent to parachains.

Crypto

  • *ABE* block production via VRF, Ed25519.
  • *RANDPA* finality gadget. Asynchronous safety + dynamic availability.

Parachains notáveis

Moonbeam (EVM), Acala (DeFi), Astar, Phala, Kusama (canary), Centrifuge.

Polkadot 2.0 (2024+)

Shift from auctions to *gile coretime*— flexible compute purchase. JAM (Join-Accumulate Machine) — modular execution model.


10. Solana

*natoly Yakovenko + Eric Williams 2017–2020*

ProofofHistory (PoH)

*ot consensus mechanism* it's pre-consensus *rdering*

Sequential VDF: validator runs \(H(H(H(\dots)))\) producing chain de timestamps verifiable. Allows validators to agree on order without communication.

T0: hash0
T1: hash1 = SHA256(hash0)
T2: hash2 = SHA256(hash1 || tx_at_T2)
...

Tower BFT

PBFT variant using PoH timestamps. Slot leader rotates per ~400ms slot.

Pros / Cons

*ros*

  • Throughput: ~3000-5000 TPS sustained, peaks 65k.
  • Latency: ~400ms block, ~1.5s finality (32 slots TLF).
  • Low fees: ~US$0.0001/tx.
  • Parallel execution (Sealevel).

*ons*

  • Validator HW expensive (high decentralization cost; ~3000 validators).
  • Stability: outages históricas (set2021 16h, jan2022, jun2022, fev2023, etc.).
  • Single client (Solana Labs) — *iredancer (Jump Trading)*client em testnet 2024, mainnet 2025.

Sealevel

Parallel execution: txs declaram read/write accounts; conflicts detectados; non-conflicting paralelizados.


11. DAGs

*irected Acyclic Graph*ao invés de chain linear.

Hashgraph (Hedera)

Mance Harmon + Leemon Baird 2016. Gossip about gossip + virtual voting. Patenteado (closed-source até 2018, open desde então). Permissioned (Hedera Council).

IOTA Tangle

Tx pré-anexa 2 outros txs. PoW per tx. *oordinator*required for security until 2.0. Adoption: mostly IoT pilots.

Conflux

TreeGraph hybrid. Inclusive blocks (unclestyle mas weighted properly).

Avalanche Snowman

Strictly speaking chain not DAG, but Avalanche Xchain (DAGbased).

Aleph Zero

DAG + AlephBFT. Sub-second finality. Privacy via ZK in roadmap.


12. ProofofSpace / PoSt

Chia

*ram Cohen (BitTorrent inventor) 2017*

  • *lotting* precompute large files (proofs of space) on disk.
  • *arming* scan plots for valid proofs at each challenge.
  • *DF* Wesolowski VDF para timing entre blocks (Time Lord).

Tagline: "green Bitcoin" (mas plotting causa lots of SSD writes).

Filecoin

*rotocol Labs (Juan Benet) 2020*

  • *roofofReplication (PoRep)* prove armazenamento único de file.
  • *roofofSpacetime (PoSt)* prove continuous storage over time.
  • *xpected Consensus (EC)* leader election weighted by storage power + VRF.

Spacemesh

PoSt + PoET (ProofofElapsedTime, Intel SGXbased originally, depois software). Smesher = home miner. Launched 2023.


13. ProofofAuthority

Validators são *amed, trusted entities* Sem mining, sem stake significant.

Exemplos

  • *OA Network*(legacy).
  • *eChain*Authority Masternodes.
  • *Dai (Gnosis Chain)*PoA → POSDAO.
  • *NB Chain (BSC)* 21 validators initially Binance-selected; agora algumas elections.
  • *olygon PoS* 100 validators, primary Polygon Labs.

Pros / Cons

*ros* Fast, cheap, predictable. *ons* Centralized — atacante regulatório só precisa pressionar validators.

Common pattern: launch PoA → migrate to PoS or hybrid over time.


14. Hybrid e exotics

Decred

PoW (Blake256) + PoS (stakeholders vote on PoW blocks). Treasury governance builtin.

Filecoin

PoSt + EC (above).

Helium

ProofofCoverage. Mineradores demonstram wireless coverage. Tornou-se Solana token 2023.

Internet Computer (ICP)

Dfinity. Threshold signatures + chainkey cryptography. Subnetbased scalability. Reverse-gas (developer pays).

Ethereum Casper FFG + LMD-GHOST

Casper FFG = finality gadget; LMDGHOST = fork choice; CasperFFGontop finalizes.


15. Finalidade

Tipo Exemplos Tempo
*robabilística* Bitcoin (6 confirms ≈ 99.99%) ~60 min
*ventual deterministic* Ethereum (Casper FFG após 2 epochs) ~13 min
*nstant (BFT)* Tendermint, HotStuff, Algorand 1-3 s
*ub-second* Solana (single slot), Aleph Zero < 1 s
*ffchain instant + onchain settle* Rollups, state channels depends on L1

16. Comparação prática

Chain Consensus Finality TPS sustained Validators Decentralization rating (informal)
Bitcoin PoW SHA-256 ~60 min (6 confirm) 7 N/A (~15k full nodes; ~10 pool dominant) high
Ethereum (post-Merge) PoS Casper FFG + LMD-GHOST 12-15 min (2 epochs) 15 (L1) ~1M validators / ~3000 nodes high
Solana PoH + Tower BFT ~1.5 s 3000+ ~3000 medium
Avalanche C-chain Snowman ~1-2 s ~1000 ~1300 medium
Cardano Ouroboros Praos epoch (5 dias for full settlement) ~250 ~3000 stake pools high
Polkadot GRANDPA + BABE 12-18 s ~1500 ~300 medium
Cosmos Hub Tendermint ~6 s ~10000 175 medium
Sui Narwhal + Bullshark ~3 s ~5000 ~120 medium-low
Aptos DiemBFT v4 (HotStuff) ~3 s ~5000 ~120 medium-low
TON Catchain (BFT-PoS) ~5 s ~100k claimed ~400 medium
Hedera Hashgraph ~3 s 10000 39 (Council) low (permissioned)
BSC PoSA (PoS + Authority) ~3 s 100-200 21 low
Polygon PoS PoSA ~3 s 100-200 100 low-medium

(Stats ~mai/2026, sujeitos a mudança.)


17. Selecionar consensus para um caso de uso

Use case Consensus apropriado
Monetary settlement layer global PoW (Bitcoin) ou robust PoS (Ethereum)
Smart contracts high-throughput Solana (PoH+TowerBFT) ou Sui (DAG+HotStuff)
App-specific chain Cosmos SDK (Tendermint) ou Substrate (BABE+GRANDPA)
Private enterprise consortium Hyperledger (PBFT/Raft) ou R3 Corda
IoT / micro-payments DAG (Hashgraph, IOTA) ou L2 (Lightning)
Compliance-required (KYC mandatory) Permissioned PoA ou regulated Layer 2
Long-term immutable archival PoW Bitcoin (battle-tested)

18. Referência cruzada

  • Chains detalhadas: 04-l1-bitcoin.md, 05-l1-ethereum.md, 06-l1-alt.md.
  • L2 / rollups (built atop): 07-l2-scaling.md.
  • Cryptographic primitives (VRF, VDF, signatures): ../cryptography/.
  • MEV: 12-tokenomics.md §MEV.
  • Slashing incidents: 14-incidentes.md.

Source: ../home/koder/dev/koder/meta/docs/blockchain/compendium/03-consensus.md