Consensus is essential for agreeing on a shared state in a blockchain. It ensures that all network nodes are in sync and can collectively move the blockchain forward. Without consensus, nodes in a decentralized network cannot guarantee agreement on the state, leading to inconsistencies. Consensus aims to provide an objective view of the state despite each node having its subjective views. It enables communication, agreement, and the creation of new blocks.
Proof of Work (PoW) and Proof of Stake (PoS) are often used incorrectly to refer to blockchain consensus mechanisms. PoW is part of the broader Nakamoto consensus, which includes a chain selection algorithm. PoS specifies validator selection rules but lacks chain selection or finality mechanisms. PoS is commonly paired with Byzantine agreement algorithms.
Traditional PoS systems link block production to token holdings, which can lead to centralization and limited participation. To address this, nPoS allows on-chain pool formation, letting token holders vote with their stake for validators. Cere Network employs nPoS to select validators and nominators, maximizing chain security. Validators produce new blocks, and ensure finality, while nominators back selected validators with their stake and approve trusted candidates.
Pure Nakamoto consensus blockchains with PoW achieve probabilistic finality, estimating the probability that a block is final. Eventual consensus means all nodes eventually agree on a set of data, but it may take time. Finality gadgets like GRANDPA or Ethereum's Casper FFG provide provable finality, ensuring blocks cannot be reverted after Byzantine agreements. Provable finality provides irreversible consensus.
Cere Network adopts hybrid consensus combining GRANDPA and BABE protocols. This approach leverages the benefits of probabilistic finality (rapid block production) and provable finality (universal agreement on the canonical chain) while avoiding their drawbacks. By combining these mechanisms, Cere Network enables rapid block production without risking slower transaction processing or stalling during finality.
BABE (Blind Assignment for Blockchain Extension) determines the authors of new blocks. It assigns block production slots to validators based on stake and randomness. BABE execution happens in sequential non-overlapping epochs, each with a predefined number of slots. Validators participate in a lottery for each slot, becoming block producer candidates. The mechanism's randomness design may result in multiple validators being candidates for the same slot, potentially leading to inconsistent block time.
When multiple validators are block producer candidates in a slot, they all produce a block, and the fastest one wins. Both chains continue to build until finalization resolves forks.
If no validators qualify for block production in a slot, a secondary, round-robin style validator selection algorithm ensures the slot is never empty. Validators selected through this algorithm produce blocks, but their secondary blocks are ignored if the slot also has a primary block from a VRF-selected validator. Thus, no slots are ever skipped.
For more details on BABE, refer to the BABE paper.
GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement) ensures finality for the Cere Network Relay Chain. Validators use the GRANDPA protocol to finalize blocks through consecutive voting rounds. GRANDPA reaches agreements on chains, not blocks, accelerating finality even after network partitioning.