Consensus mechanisms are the rules that determine the parameters for participation in a program or institution; this is necessary in order to maintain agreement on the state of the system. Consensus mechanisms are particularly important for decentralized networks; such as cryptocurrencies, that rely on blockchain platforms. To achieve agreement on both a single data value, as well as a single state of the network, consensus is necessary.
In order for a system that values decentralized authority to be reliable, there must be a means of achieving agreement among the distributed processes and multi-agent systems. A blockchain could not be maintained if every programmer set their own rules. While a centralized system typically has an individual authority, a decentralized system does not.
However, it is paramount to the success of a decentralized platform for all of the networks to understand and agree with the parameters of the program. In order for the system to have value as a currency and validity as a program, the participating nodes must collectively agree to the consensus rules of the blockchain. So, consensus mechanisms are essential to maintaining the accuracy of the records on any decentralized network.
Crypto and Consensus
Unlike a centralized authority, a decentralized consensus is much more democratic in its structure. Cryptocurrencies like Bitcoin or Ethereum use decentralized networks. Decentralized systems can be more democratic because they require a consensus amongst the multitude of networks. Therefore, no one network has the ability to suddenly change all the rules.
Consensus mechanisms can be changed, but that also requires a consensus. To learn more about forks, read more about Bitcoin Forks here on the blog.
There are several consensus measures in place for decentralized blockchain public ledgers; the most common are proof-of-work and proof-of-stake. But let’s back up a bit and refresh some basic concepts about cryptocurrency.
Blockchains are public ledgers designed to maintain information accurately and permanently. Therefore, it behooves the system to have methods that incentivizes self-checks and peer review. This is particularly true of cryptocurrencies, which depend solely on decentralized networks.
Public ledgers like Bitcoin and Ethereum are maintained by the network participants, this is referred to as mining.
Read more about Bitcoin mining here.
The public ledgers of blockchains operate by relying on multiple networks. The individual nodes have the responsibility to confirm or deny the validity of the information that someone is trying to add to the immutable blockchain. Self-regulating systems work by involving hundreds of thousands of participants to work on verification and authentication of transactions occurring on the blockchain. The same goes for the process of mining blocks on a given chain.
Conversely, institutionalized authorities such as governments or hospitals use centralized systems. Such institutions have sole authority to maintain and change their database. Record maintenance is performed by an internal authority. Siloed information is one of the many problems with centralized systems.
The result of a centralized system is that access to information limited. Moreover, the insulated design of centralized authority is much more prone to error and attack. This is primarily because there are only a few people charged with record maintenance, and individuals make mistakes.
On the other hand, with a larger peer-reviewed system that relies on a strict programming code, error is significantly reduced, if not eliminated altogether.
The challenge of a decentralized authority is that it requires security mechanisms to ensure that all the transactions occurring on the network are genuine. It also needs all participants to come to an agreement on the status of the ledger. This is the mandate of a consensus mechanism. Essentially a consensus mandate is a set of rules which decides on the validity of contributions by the various participants of the blockchain.
As I mentioned earlier, there are different kinds of consensus mechanism algorithms which work on different principles. Now I’ll go into a bit more detail as to what kind of consensus algorithms are used to maintain the public ledgers of cryptocurrencies.
Proof of work or PoW
The most popular cryptocurrency networks require proof of work as a consensus algorithm; like Bitcoin and Litecoin. PoW means that all participant nodes must prove that the work they have done, that is the effort to mine new coins and approve transactions, qualifies them the right to add new transactions to the blockchain. While PoW is currently the most popular consensus model, it also consumes a large amount of energy and in general, requires longer processing time.
Proof of Stake or PoS
Proof of stake (PoS) is another common consensus algorithm that evolved as a low-cost, low-energy alternative to PoW algorithm.
PoS allocates responsibility for maintaining the public ledger at a proportional rate to the number of currency tokens held by that node. One criticism of this consensus mechanism is that it promotes “crypto-coin saving”, rather than spending.
Read more on PoW and PoS here on our blog.
Proof of Capacity or PoC
Another consensus algorithm is Proof of Capacity. PoC allows contributing nodes on the blockchain network to share memory space. As a result, the more memory or hard disk space a node has, the more their rights to maintaining the public ledger are proportionally greater.
Proof and New Blocks
So that new blocks are successfully added to the blockchain, a consensus is necessary. Here I discuss proof and mining blocks in terms of Bitcoin’s consensus mechanisms specifically. While consensus is not identical for all blockchains, Bitcoin’s blockchain and consensus are basically the gold standard for cryptocurrencies. As such, all other currencies have built on this same model. This means that in order for a node to participate in Bitcoin mining it must be a full node. When we are talking about Bitcoin, the proof that a miner must produce is the hash of a block. This cannot be any alphanumeric sequence; the “proof” hash must be within the limits of a certain value. That is, the hash cannot be greater than a specified value from the block header.
For instance, if the maximum possible hash value is: 2256 − 1. A miner can then prove that they tried up to two combinations by producing a hash value that is less than 2255.
Consensus is also related to the difficulty of solving for a hash, or rather, producing proof-of-work. New blocks can only be added to the blockchain if their hash is at least as challenging as a difficulty value set by the most current consensus protocol. In some sense, the protocol does change, because the program adjusts itself so that the difficulty of solving for a hash is consistent. This is because there is no benefit to the system or to consensus, to make mining Bitcoin too computationally easy. A new block is mined about every 10 minutes for this reason. It takes about an hour for full confirmation on the Bitcoin blockchain.
Read more about nodes here on the blog.
In many ways consensus mechanisms are very simple; they ensure consensus. However, in the reality of mining and adding blocks to a blockchain, there is a lot more computational energy that goes into the process.
The brilliance of a Bitcoin’s blockchain is that it is designed to incentivize good behavior. That means it is easier to play by the rules than to make up your own.