Introduction
In a centralized setup, a single entity has power over the system. In most cases, they can make changes as they please – there isn’t some complex governance system for reaching consensus amongst many administrators.
But in a decentralized setup, it’s a whole other story. Say we’re working with a distributed database – how do we reach an agreement on what entries get added?
Overcoming this challenge in an environment where strangers don’t trust each other was perhaps the most crucial development paving the way for blockchains. In this article, we’ll take a look at how consensus algorithms are vital to the functioning of cryptocurrencies and distributed ledgers.
Consensus algorithms and cryptocurrency
Satoshi Nakamoto, the creator of Bitcoin, proposed a Proof of Work system to coordinate participants. We’ll get into how PoW works shortly – for now, we’ll identify some of the common traits of the many consensus algorithms in existence.
Types of consensus algorithms
Proof of Work (PoW)
Looking at the output, you can’t possibly tell what information was fed into the function. They’re therefore useful for proving that you knew a piece of data before a certain time. You can give someone its hash, and when you later reveal the data, that person can run it through the function to make sure the output is the same.
With major blockchains, the bar is set incredibly high. To compete with other miners, you would need a warehouse full of special hashing hardware (ASICs) to be in with a chance of producing a valid block.
It’s trivial for the network to verify that you have indeed created the right block. Even if you’ve tried trillions of combinations to get the right hash, they just need to run your data through a function once. If your data produces a valid hash, it will be accepted, and you’ll get a reward. Otherwise, the network will reject it, and you’ll have wasted time and electricity for nothing.
Proof of Stake (PoS)
From there, you lock up your funds in a wallet (they can’t be moved while you’re staking). You’ll typically agree with other validators on what transactions will go into the next block. In a sense, you’re betting on the block that will be selected, and the protocol will choose one.
Generally, there aren’t freshly-created coins as part of the reward for validators. The blockchain’s native currency must thus be issued in some other way. This can be done either via an initial distribution (i.e., an ICO or IEO) or by having the protocol launch with PoW before later transitioning to PoS.
To date, pure Proof of Stake has only really been deployed in smaller cryptocurrencies. Therefore, it’s unclear if it can serve as a viable alternative to PoW. While it appears theoretically sound, it will be very different in practice.
Once PoS is rolled out on a network with a large amount of value, the system becomes a playing field of game theory and financial incentives. Anyone with the know-how to “hack” a PoS system would likely only do so if they could gain from it – therefore, the only way to find out if it’s feasible is on a live network.
Other consensus algorithms
Proof of Work and Proof of Stake are the most-discussed consensus algorithms. But there’s a wide variety of other ones, all with their own advantages and disadvantages. Check out the following articles:
- Delayed Proof of Work Explained
- Leased Proof of Stake Consensus Explained
- Proof of Authority Explained
- Proof of Burn Explained
- Delegated Proof of Stake Explained
- Hybrid PoW/PoS Consensus Explained
Closing thoughts
Mechanisms for achieving consensus are vital to the functioning of distributed systems. Many believe that the greatest innovation in Bitcoin was the use of Proof of Work to enable users to agree on a shared set of facts.
Consensus algorithms today underpin not only digital money systems, but blockchains allowing developers to run code across a distributed network. They’re now a cornerstone of blockchain technology and are critical to the long-term viability of the various networks in existence.
Of all of the consensus algorithms, Proof of Work remains the dominant offering. An alternative that’s more reliable and more secure has yet to be proposed. That said, there’s a tremendous amount of research and development into replacements for PoW, and we’re likely to see more of them surface in the coming years.