Skip to main content
The term ‘consensus mechanism’ is often used colloquially to refer to ‘proof-of-work’, ‘proof-of-stake’ or ‘proof-of-authority’ protocols. However, these are just components in consensus mechanisms that protect against Sybil attacks. Consensus mechanisms are the complete stack of ideas, protocols and incentives that enable a distributed set of nodes to agree on the state of a blockchain.

Prerequisites

To better understand this page, we recommend you first read our introduction to Parallax.

What is consensus?

By consensus, we mean that a general agreement has been reached. Consider a group of people going to the cinema. If there is no disagreement on a proposed choice of film, then a consensus is achieved. If there is disagreement, the group must have the means to decide which film to see. In extreme cases, the group will eventually split.

What is a consensus mechanism?

Consensus mechanisms (also known as consensus protocols or consensus algorithms) allow distributed systems (networks of computers) to work together and stay secure. For decades, these mechanisms have been used to establish consensus among database nodes, application servers, and other enterprise infrastructure. In recent years, new consensus protocols have been invented to allow cryptoeconomic systems, such as Parallax, to agree on the state of the network. A consensus mechanism in a cryptoeconomic system also helps prevent certain kinds of economic attacks. In theory, an attacker can compromise consensus by controlling 51% of the network. Consensus mechanisms are designed to make this “51% attack” unfeasible. Different mechanisms are engineered to solve this security problem differently.

Types of consensus mechanisms

Proof-of-work based

Like Bitcoin, Parallax uses a proof-of-work (PoW) based consensus protocol. Block creation Miners compete to create new blocks filled with processed transactions. The winner shares the new block with the rest of the network and earns some freshly minted Laxes. The race is won by the computer which is able to solve a math puzzle fastest. This produces the cryptographic link between the current block and the block that went before. Solving this puzzle is the work in “proof-of-work”. The canonical chain is then determined by a fork-choice rule that selects the set of blocks that have had the most work done to mine them. Security The network is kept secure by the fact that you’d need 51% of the network’s computing power to defraud the chain. This would require such huge investments in equipment and energy; you’re likely to spend more than you’d gain. More on proof-of-work

Proof-of-stake based

Ethereum now uses a proof-of-stake (PoS) based consensus protocol. Block creation Validators create blocks. One validator is randomly selected in each slot to be the block proposer. Their consensus client requests a bundle of transactions as an ‘execution payload’ from their paired execution client. They wrap this in consensus data to form a block, which they send to other nodes on the Ethereum network. This block production is rewarded in ETH. In rare cases when multiple possible blocks exist for a single slot, or nodes hear about blocks at different times, the fork choice algorithm picks the block that forms the chain with the greatest weight of attestations (where weight is the number of validators attesting scaled by their ETH balance). Security A proof-of-stake system is secure crypto-economically because an attacker attempting to take control of the chain must destroy a massive amount of ETH. A system of rewards incentivizes individual stakers to behave honestly, and penalties disincentivize stakers from acting maliciously. More on proof-of-stake

Sybil resistance & chain selection

Proof-of-work and proof-of-stake alone are not consensus protocols, but they are often referred to as such for simplicity. They are actually Sybil resistance mechanisms and block author selectors; they are a way to decide who is the author of the latest block. Another important component is the chain selection (aka fork choice) algorithm that enables nodes to pick one single correct block at the head of the chain in scenarios where multiple blocks exist in the same position. Sybil resistance measures how a protocol fares against a Sybil attack. Resistance to this type of attack is essential for a decentralized blockchain and enables miners to be rewarded equally based on resources put in. Proof-of-work protect against this by making users expend a lot of energy. These protections are an economic deterrent to Sybil attacks. A chain selection rule is used to decide which chain is the “correct” chain. Bitcoin uses the “longest chain” rule, which means that whichever blockchain is the longest will be the one the rest of the nodes accept as valid and work with. For proof-of-work chains, the longest chain is determined by the chain’s total cumulative proof-of-work difficulty. Parallax uses the exact same mechanism as Bitcoin.

Further reading

I