What are Consensus Algorithms?

What is a Consensus Algorithm?

Consensus algorithms are mechanisms that allow users or machines to coordinate in a distributed environment. It must ensure that all members of a system can agree on a single source of truth, even if some of the members fail. THEby the way, the system must be fault tolerant.

In a centralized configuration, a single entity has power over the system. In most cases, she can make any changes she wants—there isn't a complex governance system for gaining consensus among multiple administrators.

In a decentralized setting, it's quite different. Let's say we're working with a distributed database — how do we agree on which entries are added?

Overcoming this challenge in an environment where strangers don't trust each other was perhaps the most important development that paved the way for block chains. In this article, we will see how consensus algorithms are vital to the functioning of Cryptocurrencies and distributed ledgers.

Consensus Algorithms and Cryptocurrencies

In Cryptocurrencies, user balances are recorded in a database — the block chain (Blockchain). It is essential that all users (nodes/nodes) maintain an identical copy of the database. Otherwise, there would be conflicting information, jeopardizing the whole purpose of a Cryptocurrency network.

Consensus algorithms are mechanisms that allow users or machines to coordinate in a distributed environment. It must ensure that all members of a system can agree on a single source of truth, even if some of the members fail. In fact, the system must be fault tolerant.

Encryption of public key ensures that users cannot spend other people's coins. But it still requires a single source of truth that network participants trust in order to be able to determine whether the funds have already been spent or not.

Satoshi Nakamoto, the creator of Bitcoin, proposed a Proof of Work system to coordinate the participants. We will identify some of the common features of the various consensus algorithms that exist.

First, we require users who want to add blocks (let's call them validators) to provide a membership.

A stake is a type of value that the validator must provide, which discourages them from acting dishonestly. If they cheat, they will lose their share value. Stake examples include computing power, Cryptocurrencies, or even reputation.

Why would they risk their own resources? Also, there is a reward available. Typically, the reward is the protocol's native digital currency and is made up of fees paid by other users, newly generated digital currency units, or both. The last item needed is transparency.

We need to be able to detect when a user is cheating. Ideally, block production should be expensive, but validation by any user should be cheap. This ensures that validators are constantly checked by regular users.

Types of Consensus Algorithms

Proof of Work (PoW)

Proof of Work (Proof of Work – PoW) is the godfather of consensus algorithms in blockchain technology. It was first run on Bitcoin (BTC), but the concept has been around for some time. In Proof of Work, validators (known as miners) have the data they want to add, until they produce a specific valid solution.

A hash is an apparently random sequence of letters and numbers created when you submit data through a function. hash. However, if you submit the same data again, you will always get the same output. But if you change just one detail, your resulting hash will be completely different.

By looking at the output, you cannot tell what information was entered into the function. Therefore, it is possible to prove that you were aware of data or information before a certain point in time. You can give someone a hash, and when you reveal the data later, that person can submit it through the function to confirm that the output will be the same.

In Proof of Work, the protocol sets out conditions on what makes a block valid. For example, there might be a condition that only a block whose hash starts with 00 will be valid. The only way for the miner to create a block that matches this condition is to try multiple entries. They can tweak parameters in their data to produce a different result each time, until they get the right hash.

In the main block chains, the difficulty level is incredibly high. To compete with other miners, you would need a shed full of specialized hashing hardware (ASICs) to stand a chance of producing a valid block.

When you're mining, your interest is in the cost of the machines and the electricity needed to run them. You ASICs (application-specific integrated circuits) are purpose-built, so they have no other use than Cryptocurrency mining. Your only way to recoup your initial investment is mining, which provides a significant reward if you successfully add a new block to the block chain.

Ascertaining whether you have actually created a valid block is a simple process for networking. Even if you've tried trillions of combinations to get the right hash, they only need to send their data through the function once. If your data produces a valid hash, it will be accepted and you will receive a reward. Otherwise, the network will reject the hash and you will have wasted electricity and time.

Proof of Stake (PoS)

Proof of Stake (PoS) was proposed in the early days of Bitcoin as an alternative to Proof of Work. In a PoS system, there are no miners concepts, there is no specialized hardware, and there is no need for large energy consumption. An ordinary computer will suffice. Well actually, that's not all. It still takes some effort.

Consensus algorithms are mechanisms that allow users or machines to coordinate in a distributed environment. It must ensure that all members of a system can agree on a single source of truth, even if some of the members fail. In fact, the system must be fault tolerant.

 

In PoS, you don't provide an external resource (such as electricity or hardware), but an internal resource — crypto currency. Rules vary depending on the protocol, but generally you need to maintain a minimum amount of funds to qualify for staking.

From there, you lock your funds in a wallet (they cannot be moved while you are staking). Normally, there is a consensus among validators about which transactions will be inserted in the next block. In a sense, you place a bet on which block will be selected. The protocol will choose one of the candidate blocks.

If your block is selected, you will receive a proportion of the transaction fees depending on the value of your participation. The more funds you have blocked, the more rewards you will receive. But if you try to cheat by proposing invalid transactions, you will lose part (or all) of your holding value. So we have a PoW-like mechanism — acting honestly is more profitable than acting dishonestly.

Generally, no new digital currency is created as a reward for validators. Therefore, the native currency of the block chain must be issued in another way. This can be done through an initial deployment (ie an ICO or IEO) or by launching the protocol as PoW and then transitioning to the PoS system.

Until now, pure proof of participation has only really been implemented in smaller Cryptocurrencies. Still, it's not clear whether it can serve as a viable alternative to PoW. While it sounds in theory it seems correct, in practice it is very different.

Once PoS is deployed in a network with large amounts of value, the system becomes a playing field of game theory and financial incentives. Anyone with the know-how to “hack” into a PoS system probably wouldn't do it if they couldn't profit from it — so the only way to find out if it's a viable system is to evaluate a working network in practice.

We'll soon see PoS being tested on a massive scale — Casper will be deployed as part of a series of updates to the Ethereum network (collectively known as Ethereum 2.0).

Other Consensus Algorithms

Proof of Work and Proof of Stake are the most widely discussed consensus algorithms. But there are a wide variety of others, all with their own pros and cons.

Conclusion

Mechanisms for reaching consensus are vital to the operation of distributed systems. Many believe Bitcoin's biggest innovation was the use of Proof of Work to allow users to agree on a shared set of facts.

Today, consensus algorithms underpin not just digital money systems but block chains, allowing developers to run code over a distributed network. They now represent the cornerstone of t.echnology chains and are critical to the long-term viability of the various existing networks.

Of all the consensus algorithms, the Proof of Work remains dominant. A more reliable and secure alternative has yet to be proposed. There is a lot of research related to the development of replacements for PoW and we will likely see more proposals in the coming years.

5 / 5 - (5 votes)

Related Posts

error: