What Is a Consensus Mechanism?
A consensus mechanism is the programming and process used in blockchain systems to achieve distributed agreement about the ledger's state or the state of a data set. Cryptocurrencies, blockchains, and distributed ledgers benefit from their use because consensus mechanisms replace much slower and sometimes inaccurate or untrustworthy human verifiers and auditors.
Key Takeaways
- A consensus mechanism is any method used to achieve agreement, trust, and security across a decentralized computer network.
- In the context of blockchains and cryptocurrencies, proof-of-work (PoW) and proof-of-stake (PoS) are two of the most prevalent consensus mechanisms.
- Consensus mechanisms play an essential part in securing information by using automated group verification.
History of Consensus Mechanisms
When computers and networks began gaining popularity in the 1980s and 90s, shared databases were created so that multiple users could access the information they stored. Most had a centralized database with permissions that users accessed from different workstations. This setup evolved into centralized networks with administrators who granted user rights and maintained the integrity of the data.
Some of these shared databases developed into programs that distributed storage and processing power across a network of storage devices in different locations. One of the most significant issues that needed addressing was that of preventing data tampering and unauthorized access, whether it was malicious or not. A method to automate distributed database management was required to ensure data was not changed.
This need led to the creation of distributed autonomous consensus, where programs on a network agreed on a database's state using cryptographic techniques. Agreement was designed to be reached using encryption algorithms to create long strings of alphanumeric numbers—called a hash—which were then verified by programs running on the network. A hash only changes if the information input into the hashing algorithm is changed, so the programs were designed to compare hashes to ensure they matched.
When each program running on the network created a matching alphanumeric string, the data was said to be agreed upon by consensus of the network. Thus, consensus mechanisms were made, with credit generally given to Satoshi Nakamoto, the anonymous Bitcoin creator. However, many people worked on consensus mechanisms for years before Nakamoto released the whitepaper that made Bitcoin famous.
Data and computer scientists such as Moni Naor, Cynthia Dwork, Adam Beck, Nick Szabo, and many others worked on and contributed to developing networked consensus mechanisms.
Types of Consensus Mechanisms
There are different kinds of consensus mechanisms, each of which works on different principles.
Proof of work (PoW) is a common consensus mechanism used by the most popular cryptocurrency networks, such as Bitcoin and Litecoin. It requires a participant node to prove that the work done and submitted by them was valid and a large network of programs to verify it. However, the Bitcoin consensus mechanism requires high energy consumption and long processing times.
Proof of stake (PoS) is another common consensus mechanism that evolved as a low-cost, low-energy-consuming alternative to PoW. It involves allocating responsibility in proposing new blocks to a participant node in proportion to the number of virtual currency tokens held. The rest of the network then verifies the block and adds it to the blockchain if consensus is reached.
However, this approach has the drawback that it incentivizes hoarding instead of spending.
Proof of History (PoH) was developed by the Solana Project. It is similar to Proof of Elapsed Time (PoET), which encodes the passage of time cryptographically to achieve consensus without expending many resources.
While PoW and PoS are by far the most prevalent in the blockchain space, there are other consensus algorithms. Proof of Capacity (PoC) allows contributing nodes to share storage space. The more hard disk space a node has, the more rights it is granted for maintaining the public ledger. Proof of Activity (PoA), used on the Decred blockchain, is a hybrid that makes use of aspects of both PoW and PoS. Proof of Burn (PoB) requires transactors to send small amounts of cryptocurrency to inaccessible wallet addresses, in effect "burning" them out of existence.
The Future of Consensus Mechanisms
Researchers have been experimenting with consensus mechanisms since they became popular to try and find ways to scale blockchains securely while keeping them decentralized. To this end, there are several consensus mechanisms in use, most of which fail to provide enhancements to security, scalability, and decentralization all at the same time. Rather, one of these factors is generally sacrificed to improve one or two of the others—even on the blockchains that claim to have "solved" this trilemma.
AI/ML Enabled Consensus
To address this lingering "blockchain trilemma" issue, some researchers are proposing artificial intelligence/machine learning (AI/ML) enabled blockchains and consensus mechanisms. There are myriad proposed methods for implementing AI/ML into blockchains—some use clusters of mobile nodes and AI/ML to manage the nodes, while others discuss using existing consensus mechanisms to train AI/ML-enabled consensus algorithms.
Goals Of Consensus Developments
Many of these are being developed to address three issues: first, to create fair reward models; second, to reduce their environmental impact; and third, to increase their speed without sacrificing security, decentralization, and scalability.
Where Is This Headed?
If developers have their say (which they likely will because they're the ones creating this technology), the current state of cryptocurrencies and blockchains is not what it will eventually be—but what it all will turn into is another unknown.
Similar to all technological developments, Bitcoin and other existing blockchain systems will likely become outdated as advances are made—researchers are already proposing quantum state-based consensus protocols in addition to AI-enhanced ones. The next obvious step is AI-enhanced quantum state-based consensus blockchains and cryptocurrencies.
What Is the Most Popular Consensus Mechanism?
Proof of work and proof of stake seem to be the most used in cryptocurrencies. Other mechanisms might work better for enterprises, businesses, or personal uses.
What Is an Example of a Consensus Algorithm?
Based on the common definitions of consensus mechanisms and algorithms, proof of work is an example of a consensus algorithm. However, algorithms and mechanisms differ in that mechanisms usually carry out the processes that algorithms describe. In reality, on blockchains, consensus algorithms tell consensus mechanisms how to achieve consensus.
What Is the Mechanism of Consensus?
A consensus mechanism is a system of nodes programmed to agree that a blockchain state or data set is the correct one.
The Bottom Line
Consensus mechanisms have become an essential aspect of distributed ledgers, databases, and blockchains because much of the world is becoming more digital. Ownership of physical assets is being tokenized on ledgers and blockchains, people without access to financial services have access through blockchains, and businesses need data security more than ever.
Consensus mechanisms verify data inputs and outputs, which translates to automatically auditing the digital transactions that are common today—without human oversight or intervention. They create an environment where you don't need to trust that the other party in a transaction is honest because these programs ensure the information is unalterable and secure.
The comments, opinions, and analyses expressed on Investopedia are for informational purposes only. Read our warranty and liability disclaimerfor more info.