An Introduction to Consensus Algorithms
Proof of Effective Communication
Yona Takac, July 2018.
If there’s one thing the general public has reached consensus on it’s this, Distributed Ledger Technology (DLT) is confusing.
As a self-confessed tech-geek, I’m comfortable acknowledging that it took me a substantial amount of time to really figure out how DLT works and why it’s useful.
I remember when it really clicked for me. I was in the midst of a deep-dive into consensus algorithms as part of a blockchain comparison task assigned to me at work. I felt like I had finally solved the matrix.
Actually consensus algorithms and are not as confusing as people think but the literature intending to describe them is needlessly convoluted. In this article, I will provide a brief rundown of the foundational properties of a DLT (there is a lot of clear introductory literature on DLTs and blockchains) before proceeding to explore consensus algorithms in a way that I hope is relatively digestible.
The following topics will be covered in this article:
- What is DLT
- The Byzantine General’s Problem
- Proof of Work
- Proof of Stake
- Equality in Consensus Algorithms
What is DLT?
Distributed Ledger Technology is an umbrella term that includes Blockchains (Bitcoin, Ethereum), Directed Acyclic Graphs or DAGs (IOTA, Fantom), Hashgraph ( Hedera Hasgraph) and other technology stacks that enable the maintenance of a distributed database.
As mentioned above there is lots of good literature on the core properties of DLTs which is not the focus of this article. The following serves as a refresher of the high-level principles of DLT infrastructure, enabling us to move on and concentrate on the task at hand, exploring consensus mechanisms. The below are four components extracted (and repurposed) from an article written by some colleagues of mine from Yale and KIT universities that I believe neatly capture the main artefacts of a DLT.
1. DLTs are append-only (cannot be modified retrospectively) distributed databases particularly well suited to untrustworthy environments.
2. DLTs allows for the presence of Byzantine failures i.e resistance to crashed or unreachable nodes, network delays, malicious actors etc.
3. DLTs are inclusive networks where participants (nodes) store and update data that expands via transactions that are committed to each node’s local replication.
4. DLT’s use cryptographic mechanisms (such as hashing) to ensure that data that has been recorded to the distributed ledger typically cannot be removed or altered.
The Byzantine General’s Problem
One of the core properties of a DLT mentioned above is point 2 ‘resistance to Byzantine failures’, you may have also seen this described as ‘Byzantine fault tolerant’. Suffice to say it is a bit of a mouthful. This type of tech jargon intimidates mainstream audiences but if we unpack what it really means, it’s actually fairly intuitive.
The place to start is with the Byzantine Generals Problem which is a useful analogy for explaining the classic security quandary faced by distributed computer systems.
The Byzantine army encircles a city intended for capture. The area around the city is large and the army is organized into small camps that are each governed by a General. Because the camps are far apart communication between them is challenging. The Generals have to send out messengers who run between the camps sharing information. The army is trying to choose between two courses of action, attack or retreat. So long as the army acts in unison the outcome of either action will be successful. Problematically, there are Generals who are bad actors and even messengers who cannot be trusted to communicate accurately, there is also the possibility that messengers are captured along the way and the communication is never delivered. If success is determined by the camps performing the same action, how do you ensure unanimous participation?

In the case of the Byzantine General’s Problem, a few intuitive options spring to mind:
1. Economically incentivize participants to vote for the majority action.
2. Punish bad actors who vote against the majority action.
What other ideas can you think of?
The Byzantine General’s Problem serves as a analogy for the issues faced by distributed systems that seek to make unanimous or majority decisions in a broad network of individual actors who cannot be trusted.
With this story in mind, we can consider the possible security and runtime complications that may be present in a distributed computing system like the Bitcoin network. Indeed, the imperative in the bitcoin network is not to defeat an army but to maintain an accurate and efficient ledger of transactions in a totally inclusive ecosystem of unknown participants.
There are different rules that govern different DLTs. In the bitcoin network for example, if a majority (51%) of network participants agree on the accuracy of a block then consensus is reached and the block is cryptographically added to the blockchain.
The most notable consensus mechanism is Proof of Work (PoW) which is the incumbent algorithm used to secure the Bitcoin and Ethereum networks.
Proof of Work
Proof of Work (PoW) is the most well-known and thoroughly tested of the consensus protocols and is the consensus algorithm used to secure the bitcoin network. In PoW systems, all participating network nodes, known as miners, expend time (on average 10 mins per block on the Bitcoin network) and computing power (that is expensive to produce) in competition to solve a cryptographic puzzle. The miner that solves the puzzle first, presents the next block to the network for verification, and if successful, earns a reward as compensation. Interestingly, the verification process is actually computationally fast and inexpensive whilst the puzzle-solving process used to select the miner eligible to present the next block is highly taxing (by design).
In a PoW system, the probability of mining a block is directly proportional to the quantity of computational power contributed by a miner. Because miners have contributed CapEx (mining rig) and OpEx (electricity and real estate costs) into validating transaction blocks, we have most likely sufficiently incentivised them to broadcast the truth.
This is because a miner can only be successful in earning a reward if he allocates his resources to mining the correct chain and presenting the correct block to the network, therefore he is economically incentivized to broadcast the truth. Further, there is a financial disincentive to mining an incorrect block or ‘malicious fork’ because it would simply be a wasted resource as no reward would be earned. Indeed, increased participation generally leads to greater security and reduced risk of parties colluding to achieve more than 51% of the total hashing power.
A common criticism level against PoW consensus is that it is inefficient and costly. The computational energy spent by miners in competition to solve a cryptographic puzzle every time a new block is validated, adds no intrinsic value to the network (beyond selecting which miner will validate the next block) and has no positive externalities. In fact that is largely the point, the expenditure of a costly resource is necessary to create a deterrent against voting for a malicious action.
PoW systems also favor large mining companies whose economy of scale and location based electricity price advantages prevent smaller participants from competing effectively. As a result, the Bitcoin network has become highly centralized with more than 2/3rds of the worlds mining power emerging from China, and a significant portion of the total hashing power in the hands of a few large companies. Centralization increases the risk of a failure in the bitcoin network, if a few large mining companies collude to achieve 51% of the networks hashing power then they could potentially rewrite the history of the Bitcoin ledger as they see fit.
The above description is a little bit of a simplification of the PoW model and there is an incredible amount to learn from this awesome, legacy consensus mechanism that has propelled DLTs into existence. However, because of some of the disadvantages explored above (and others not mentioned), members of the blockchain community believe there may be alternative consensus mechanisms that are superior to PoW. Most notably, Proof of Stake (PoS).
Proof of Stake
Proof of Stake (PoS) emerged as a potential solution to the efficiency, security and scaling issues persistent in the Bitcoin and Ethereum PoW-based models. PoS proposes that the resource used to determine the validator of a block should be the blockchain’s native cryptocurrency rather than computational power like in a PoW network. Simplistically, the idea is that if an individual possesses native coins in a chain (a stake in the network), they have an interest in maintaining the accuracy of the ledger and we can trust them to broadcast the truth. The validator of a new block is chosen deterministically based on the quantity of native coins held by a participant. A block reward and transaction fees are subsequently awarded to the validator of a block if he presents the correct block to the network.
There are some appealing properties of PoS systems when compared with PoW:
- Energy efficient — no highly energy taxing competition to solve cryptographic puzzles to determine miner.
- No technology arms race to build the most efficient mining rig. Staking nodes can be run on consumer grade software or a cheap VPS.
- Reduced risk of 51% attack — Obtaining more than 51% of the network requires immense capital (controlling 51% of the circulating token supply).
- Greater decentralization due to reduced economies of scale benefits by large mining companies.
Equality in Consensus Algorithms
A routine criticism levelled against PoS systems is that they create scenarios of inequality where the rich get richer. Consider that a validator is chosen proportionally based on the number of coins/tickets he possesses, more tokens, means more validations, means more block rewards. However, this argument fails to address the inequity of the incumbent PoW system. In fact, one could argue that PoW mining is far less egalitarian given the economies of scale, location-based energy price benefits and other factors that favour large mining companies. The cost of 1 unit of energy for an individual miner is more than the cost of 1 unit of energy for a large mining company, whereas 1 coin = 1 coin regardless of other factors in PoS system.
Today, there are more than 29+ Consensus algorithms that have been designed/hypothesised to validate transactions on DLTs. PoW and PoS engines are still by far the most prevalent but as the technology matures we will learn which algorithms stand the test of time.
Fusion
The blockchain project I’m currently working for, Fusion, currently uses our own custom built consensus algorithm based on PoS. The returns for staking (at time of writing) on the Fusion network are greater than 30% per annum. Like any foray into digital currencies, there are some complexities and risks involved involved in participating in a cryptocurrency network but it has the potential to be both rewarding and educational. If you want to learn more about how to set up a Fusion staking node check out the following article Part 2 of the ‘How to set up a Fusion Node guide’ where we explore Fusion’s unique approach to Proof of Stake.
If you want to chat more in general, hit me up on Linkedin.
