Skip to main content

Blockchain Consensus Mechanisms: Who Decides What Gets Written in the Ledger?

Let's dive into the "engine room" of blockchain and explore how this decentralized world determines "who can record" and "how to record" using a set of ingenious rules.


1.2 Consensus Mechanism: Who Decides What Gets Written in the Ledger?

A consensus mechanism is a mathematical-economic protocol that ensures all nodes reach agreement on the same ledger. It allows anyone to write, but prevents unauthorized tampering.

Previously, we learned that blockchain is a distributed public ledger. This immediately raises a core question: if thousands of people can write to the ledger at once, how do we decide whom to trust? How do we ensure the final version of the ledger is unified and reliable?

This is the challenge that the "consensus mechanism" is designed to address.


Why is Consensus Needed?​

  1. Managing the Chaos of "Multiple Writers" Blockchain is an open system where, in theory, any computer (node) connected to the network can submit a transaction. Without a unified rule to decide who has the right to package transactions in the next "block" and whose record is authoritative, the entire ledger would descend into chaos, splitting into countless contradictory versions. The consensus mechanism ensures that, at any given time, the entire network can agree on which "version of history" is the only true history.

  2. Preventing "Double-Spending" This is the primary challenge digital currency systems must overcome. Without consensus, a malicious user (like Alice) could send her only 1 Bitcoin to both Bob and Carol simultaneously. In Alice's "little ledger," both transactions appear legitimate. The consensus mechanism quickly confirms one of these transactions (e.g., the one sent to Bob) on the chain and immediately declares the other (sent to Carol) invalid, ensuring each digital asset cannot be spent twice, thus maintaining the system's scarcity and integrity.

  3. Achieving "Trustless" Security Traditional finance relies on the credibility of banks and the coercive power of law to resolve disputes. In a decentralized network composed of global strangers, we cannot rely on these. Blockchain's genius lies in its use of open and transparent algorithms and economic incentives that allow all participants to collaborate effectively and check each other, even without mutual trust. Participants find that following the rules is more profitable than causing disruption, thereby spontaneously maintaining the system's security.


The Three Major Schools of Consensus​

To achieve these goals, engineers have designed a variety of consensus mechanisms, each with its strengths and weaknesses, akin to different schools in martial arts.

  • Proof of Work (PoW) This is the most classic mechanism, also adopted by Bitcoin. Think of it as a global "arithmetic competition." All nodes that want to record (known as "miners") need to perform hash calculations to solve a very difficult math problem. Whoever finds the correct answer first wins the right to record the next block and receives a batch of newly issued Bitcoins and all transaction fees in that block as a reward.

    • Advantages: Tested over more than a decade, very mature and secure. Low entry barrier; anyone with computing power can join without needing to hold tokens in advance.
    • Disadvantages: Miners need to consume enormous electrical energy to win the competition, which has been heavily criticized. Additionally, because the competition takes time, its transaction processing speed (throughput) is relatively low.
    • Examples: Bitcoin, Litecoin, early Ethereum.
  • Proof of Stake (PoS) This is the preferred solution for most mainstream public chains today. It no longer competes on computing power but on "financial power" and "reputation." Nodes that want to participate in recording (known as "validators") must first stake a certain amount of tokens as a "deposit." The system selects the next block recorder based on the amount staked (sometimes with added randomness). If selected but attempting to act maliciously (e.g., packaging an invalid transaction), the staked tokens will be confiscated by the system (a process called "Slashing"), which is a high cost.

    • Advantages: Extremely low energy consumption (over 99.9% lower than PoW), fast transaction confirmation, and more direct and precise economic penalties for malicious actors.
    • Disadvantages: May lead to a "rich get richer" effect. The penalty mechanism design needs to be very cautious to prevent collateral damage and systemic risks.
    • Examples: Ethereum (after The Merge), Solana, Avalanche.
  • Byzantine Fault Tolerance Family (BFT / DPoS / HotStuff, etc.) This type of consensus mechanism is more like a "committee decision" system. It usually operates among a limited number of "super nodes" or "delegates." These nodes achieve absolute majority agreement on the order and validity of a transaction through several rounds of efficient message passing and voting, often within seconds or milliseconds.

    • Advantages: Extremely fast transaction confirmation (second-level finality), very high throughput, especially suitable for high-performance enterprise applications or as a sharding solution for large public chains.
    • Disadvantages: The number of nodes is usually limited (dozens to hundreds), so the degree of decentralization is relatively low. The governance structure can also be more complex.
    • Examples: Cosmos (Tendermint), Aptos, Sui.

Incentives and Penalties: The Economics of Sustaining Consensus​

The reason consensus mechanisms can operate stably is due to a precise economic game design:

  • Positive Incentives (Carrot): Generously reward nodes that honestly record and maintain network security through block rewards (newly issued tokens) and transaction fees. This incentivizes people to invest computing power or stake tokens, becoming guardians of the network.
  • Negative Incentives (Stick): Deter potential malicious actors by making the cost of attacks extremely high. In PoW, attackers need to invest astronomical electricity and hardware costs; in PoS, they face the risk of having their stake slashed.
  • Game Equilibrium: In a well-designed consensus protocol, any rational participant will find that honestly following the rules and earning stable rewards yields far greater expected returns than launching an attack. This "following the rules is more profitable" scenario leads the entire system to a dynamic game equilibrium, tending towards stability and security.

The Trade-off Between Security and Performance​

When choosing a consensus mechanism, project teams need to make trade-offs in the famous "blockchain trilemma," where security, performance/scalability, and decentralization are often difficult to achieve simultaneously.

  • Security: Measured by indicators such as total network hash rate (PoW), total staked amount (PoS), and the number of active validators.
  • Performance: Measured by indicators such as transactions per second (TPS), block interval, and time to finality.
  • Decentralization: Determined by factors such as the threshold for running a node, hardware requirements, geographical distribution of nodes, and governance structure.

There is no "one-size-fits-all" best solution. Bitcoin has chosen extreme security and decentralization at the expense of performance. Some new public chains, while ensuring a certain level of security, sacrifice some decentralization to achieve extremely high performance. Designers must find the most suitable balance point based on their application scenarios and target users.


🤔 Reader Exercises​

  1. Open Ethereum's block explorer Etherscan.io, find the latest block. Who is the "Proposer" of this block? In which "Slot" was this block created? Think about how Ethereum's PoS mechanism might select this one from thousands of validators to record.
  2. Visit Bitcoin.org or other data websites to find the historical hash rate curve of the entire Bitcoin network. Observe the fluctuations in hash rate and feel how "security" in the PoW world is closely related to the global computing power invested.

📚 Further Reading​

  • "Bitcoin-NG: A Scalable Blockchain Protocol" - A classic paper discussing how to improve PoW chain performance.
  • Vitalik Buterin — Proof of Stake Finality Blog Series - In-depth articles by the founder of Ethereum on PoS finality, advantages, disadvantages, and design philosophy.
  • "A Survey on BFT Consensus for Blockchains" — ACM Computing Surveys - A comprehensive review of various BFT consensus algorithms in academia.

After understanding who records, in the next section (1.3), we will focus on the ledger itself, introducing "Block Structure: How Data is Packaged and Linked?", taking you deeper into the ingenious design of block bodies and Merkle trees.