Consensus algorithms are required for distributed ledger technology (DLT) to function. They are used to check which data sent to the public ledger should be kept as valid and which should be ignored.
If the network in question is both "untrusted" and "unauthorized", any computer can join the network and, once in it, can send data to be written to the registry.
In such a system, the only rules that can be imposed are those of the platform protocol itself. If the protocol is followed, other nodes will accept the input, if the protocol is not followed, these inputs can be ignored.
It is this definition of the reliability of the input data that underlies the consensus algorithm. The most famous of these is Proof of Work, the consensus algorithm used by Bitcoin. Since Proof of Work is quite wasteful of power, a number of others have been proposed and are in various stages of development, including Proof of Stake, Delegated Proof of Stake, Proof of Burn, Voting, Virtual Voting and Proof of Stapsed Time, among others. They all work to achieve the same result: a distributed agreement among a network of equals.
Therefore, one of the biggest challenges in distributed networks is how to achieve this reliability, despite the fact that it is impossible to know which individual users can be trusted. To do this, the consensus algorithm must be resistant to both untrusted and malicious actors trying to take over the network, even if these actors make up a significant part of the network. How can a group of uncoordinated participants come to an agreement on a strategy to avoid failure if they know that some, even many, users will be unreliable and have no way to trust each other?
This problem, also known as the Byzantine generals problem, was first posed in 1982:
Imagine that there is a group of generals who together strive to capture a hostile city.
The generals are uncoordinated and geographically dispersed - communication is limited so that each general does not know what the others are doing.
Each general must vote to either attack or retreat, but communication is difficult because everyone can vote for different options, and messengers delivering teams can deliver incorrect information, information out of order, or not deliver completely.
To capture a city, all generals must attack at the same time. To do this, the generals need to come to some kind of consensus to allow them to simultaneously attack despite these problems.
This example is directly applicable to distributed systems. Any decentralized distributed system must solve the problem that a disparate group of geographically dispersed users who do not know (or do not trust) each other must work together to reach an agreement without giving in to malicious or untrustworthy participants that threaten the network.
Solving this problem was a major breakthrough in computer science because it allowed for a means of building trust based on not trusting anyone individually, but building trust collectively. This deceptively simple achievement spawned a new industry, paved the way for thousands of competing projects, and sparked interest and participation on a global scale.
Proof of Work (PoW) is the original blockchain consensus algorithm that is used in projects like Bitcoin and Ethereum. It is a mechanism that allows users of the blockchain network to reach an agreed-upon “truth”. Proof of work is essentially the answer to a complex mathematical problem. It takes a lot of work to create (hence the name), but it's easy to verify by others.
Bitcoin was the first blockchain to implement PoW (known as Hashcash) as a consensus algorithm. Bitcoin miners run a computer program that gives each miner an equal chance, proportional to their computing power, of finding a solution for the next block. They compete to find the answer (known as a hash) to the given PoW parameters for that block. This hash is a 64 character long response and is based on block inputs such as the transactions it contains.
Miners look up this hash by combining this input with a random number, known as a nonce, until someone comes up with the correct answer. This solution is then passed on to other miners and verified by them. Once confirmed, it is added to the block chain by other miners, who then use this new block as input for the hash needed for the next correct block. This chain forms the canonical ledger of all transactions since the creation of Bitcoin.
As a result, PoW solves the problem of the Byzantine generals as it reaches a majority agreement without any central authority despite the presence of unknown/potentially unreliable parties and despite the fact that the network is not instantaneous. It allows distributed and inconsistent Generals to come to an agreement:
1.The generals agree that the first plan received by all the generals will be accepted as the plan.
2.The general solves the PoW problem by creating a block that is broadcast on the network for all generals to receive it.
3.After receiving this block, each general checks and works on a solution to the next PoW problem, including the previous solution in it, so that their plan complements the previous solution.
4.Every time a general solves a PoW problem, a block is generated and the chain starts growing. Over time, any general working on a different solution will switch to the longest chain. This is what most generals contribute to, and therefore he has the greatest chance of success.
5.Since the generals roughly know how long it takes to solve a PoW solution, after a certain amount of time they will know if enough other generals are working in the same chain.
Through this process, generals can come to a consensus on when to attack, can assess their chances of success, and can prevent multiple different attack signals from being sent out at the same time.
PoW also prevents attackers such as a traitor general from sabotaging the network by spoofing historical messages. Bitcoin, for example, stores the hash signature of the previous block in each new block. Therefore, any change to an earlier block will require changes to all subsequent blocks. This would require excessive processing power and therefore the registry is protected from modification.
Although PoW is an integral part of modern blockchain technology, critics point to a number of problems with its implementation. The two most pressing concerns relate to the possibility of centralization and the waste that it generates.
The rise in interest in bitcoin and its price has led to more users mining it, which in turn has led to an increase in the amount of computing power required. Bitcoin mining is currently a multi-billion dollar industry and while all users still have an equal chance of mining bitcoins in proportion to their computing power, the advent of industrial scale bitcoin mining operations means that the average person has very little chance of successfully mining. Bitcoin. As the mining cartels continue to grow in size, the network becomes more centralized - the cartels control most of the hash power and can mine more bitcoins. This, in turn, means they can afford to scale up operations and take on a greater share of the computing power.
Also, as a result of the rise of bitcoin and other networks, and the associated increase in computing power, PoW now requires huge power consumption. Bitcoin alone currently absorbs nearly all of Switzerland's electricity demand. This is environmentally damaging and potentially unsustainable if mining difficulty continues to rise without accompanying technological improvements.
Critics also point to a waste of computing power, which, in fact, is only used to protect the network - the calculations are not relevant to other areas. This energy and financial burden is the cost of securing the network.
This resource inefficiency is one of the problems advocates of other consensus algorithms such as Proof of Stake cite as the reason for switching from PoW.
Proof of Stake (PoS) is an alternative consensus algorithm for Proof of Work (PoW). Unlike PoW, where new transactions are confirmed through mining on powerful computers, PoS sees users pledge (or "stake") their existing assets to validate new transactions. Instead of expensive mining hardware, users need nothing more than a standard computer, internet connection, and asset storage.
The PoS system works by prompting users to lock their funds in the form of an escrow. As soon as the funds are locked, the user (hereinafter referred to as the validator) can start validating new blocks of transactions. The network algorithm then selects a validator to process the next block through a quasi-random process. The more funds you stake, the more likely you are to be selected to validate a block and therefore receive a corresponding reward. It can take into account other factors, such as the length of time a validator's funds are staked, randomizing the process. A dishonest validator is punished with the loss of their funds.
First implemented by PeerCoin and Nxt in 2012 and 2013 respectively, PoS aims to build on some of the perceived weaknesses of PoW and is growing in popularity with Ethereum (currently the second largest DLT by market capitalization) with the goal of a full transition from PoW to PoS in the near future. future.
Like PoW, PoS solves the problem of Byzantine generals, albeit in different ways. This makes it possible for distributed and inconsistent Generals to come to an agreement, despite the fact that communication does not occur instantly and with potentially conflicting signals are sent:
-Generals become validators by depositing their assets.
-A preset algorithm chooses a general to be the validator for the next block that the general creates.
-Another general is subsequently chosen to become a validator and link/build to the previous block to form a growing chain. As a result, it becomes clear in which chain most of the generals are involved.
-The generals know how quickly each block is created according to the PoS consensus algorithm, and therefore after a certain period of time they will be able to know if enough other generals are working on the same chain to be able to make a successful attack.
This solves the problem of Byzantine generals in a more efficient and environmentally friendly way, eliminating the high energy and hardware costs associated with PoW. So it also removes the economies of scale that the biggest PoW miners profit from. PoS gives all users an equal chance, proportional to their holdings, to receive a reward. Since PoS allows small stakes to have the same participation rights as the largest ones, this should lead to a more decentralized network.
In addition, PoS connects validators to the network, incentivizing them. While miners can mine bitcoins and get rid of them immediately or switch to mining something more profitable, PoS ensures that validators lock up their funds for a set period of time to use the network. In addition, dishonest actions jeopardize their bet. This further integrates the validator into the network they secure.
Critics have raised several concerns about PoS.
First, while PoS is theoretically more democratic (because it gives all users an equal opportunity to participate and avoids the economies of scale problems that PoW suffers from), it will suffer from the same problem - decentralized networks tend towards centralization. The biggest holders will get the most rewards and therefore grow up, creating a vicious circle in which the big ones get bigger and the small ones get increasingly blurry.
As these large interests accumulate, they are more likely to collude rather than compete. This can lead these owners to make changes that benefit them rather than the needs of others. Since your funds are "locked" in staking, it is likely that only a minority of network users will participate in staking and thus receive rewards, this accumulation of power can be obvious. This lack of participation also means that a 51% attack on the network requires the attacker to own 51% of the bet, not the entire supply.
Proponents argue that in the event of an attack, the network could be forked and the amount wagered by the attacker would be wiped out. The idea is that, unlike PoW (where an attacker simply needs to buy enough mining equipment to take over the network and after the attack he can redirect said equipment to another PoW system), with PoS the attacker will have to buy 51% of the total the amount of supplied resources. every attack. However, this is largely dependent on the attacker, who does not have the resources or determination to make these sacrifices, and that the extensive network can survive the loss of confidence that an attack will bring.
Many PoS networks also require validators to own a minimum (usually significant) amount of an asset in order to be able to stake. Since most users don't have enough of them, staking pools will appear as well as mining pools before them, leading to further centralization.
PoS is also potentially vulnerable to the "nothing at stake" problem, where validators have nothing to lose by voting for multiple forks of the network. Thanks to this, the validator will receive shares in two chains. The value retained by forks of Bitcoin and Ethereum, Bitcoin Cash and Ethereum Classic highlights the motivation for doing so. While a miner in a PoW system like Bitcoin can only allocate 100% of their resources to one network at a time, PoS allows validators to easily validate both chains.
PoS remains in its relative infancy, but design teams have already started trying to improve it by combining the good parts of PoS (energy efficiency, user networking) with other means of reaching consensus.
Delegated Proof of Stake (DPoS) takes its name from Proof of Stake (PoS) but differs both in concept and implementation. It is used by projects such as Lisk and the upcoming EOS and is intended to provide faster and cheaper transactions as well as increased scalability.
Instead of allowing all network users to validate transactions, DPoS allows token holders to vote (in proportion to their holdings) to select a small number of users to validate future blocks. By reducing the number of validators and meeting minimum performance requirements, DPoS speeds up the network.
PoW or PoS is limited in part by the network latency associated with having a large number of nodes distributed around the world. As the number of transactions per second required by the network increases, so does the amount of information that must be kept in sync across the entire network. DPoS reduces this problem by concentrating network consensus on only a few well-resourced and well-connected nodes. This allows more and more blocks to be created, greatly speeding up transaction times and overall network throughput.
The Chosen Ones are known by a number of terms depending on the network, including "delegates", "witnesses" or "producers", but take on the same responsibilities as miners and validators from PoW/PoS. Delegates must maintain the node 24/7 (in some DPoS implementations they must also stake a number of tokens, as in PoS), aggregate transactions across the network into blocks, and subsequently validate/broadcast them to the rest of the network.
This continuous real-time voting to elect delegates brings several new aspects to consensus algorithms: it gives all token holders the ability to influence what happens on the network; it also creates a need for delegate reputation. If you don't have a good reputation, you're unlikely to get elected, as users will tend to choose those who act in the interests of the network. Finally, it removes the competitive aspect of PoW/PoS and instead allows delegates to collaborate with each other to create new blocks. This eliminates some of the wastage in creating PoW/PoS blocks where failed work is simply discarded.
DPoS solves the problem of Byzantine generals in the following way:
1. Generals vote to elect trusted delegates. These votes are weighted in proportion to the number of holdings of each general in the platform currency. In this example, let's say there are nine generals who elect three generals as delegates.
2. The DPoS algorithm randomly selects one of the three delegates to create the next block, which is created by the chosen delegate and then verified by the other two delegates.
3. A new block is created every three seconds, and none of the three delegates can create a block unless it is their predetermined move. Each new block builds on the previous one and includes a link to it.
In order to remain as a delegate, maintain their reputation and their share (if applicable), delegates must create their blocks on time without missing their slot. As the chain continues to grow, all delegates confirm the majority chain, which means fake chains are hard to create - they won't have transactions from the legitimate chain.
4. DPoS is designed to avoid forks as delegates collaborate rather than compete. If there is disagreement between the 5. Generals, then the consensus automatically switches to the longest chain (in our example, if A and B both created different chains, then C will be the deciding factor, and whichever chain they choose will again become the majority chain. That is why the odd number of delegates - to avoid deadlock.
6. The rest of the generals see the chain approved by the majority and know that all delegates contribute to it. As a result, they may know that this is an agreed upon consensus and therefore an order to follow.
It is important to remember that the consensus algorithm simply reaches consensus - not necessarily the "correct" consensus. The DPoS chain can be hijacked by attackers. If we assume that A and B are malicious, the chain they created will become the majority chain. In this case, C will continue to create its own minority chain until an election is held to exclude A and B from this chain. After A and B are sent to fork C and honest actors are assigned, the three honest actors put together can quickly overtake the malicious fork in length. Incentives for honest delegate action go back to the rewards offered and the threat of being barred from these lucrative roles.
DPoS has a number of advantages. In addition to enabling more and faster transactions like Steemit and Bitshares capable of processing a couple of thousand transactions per second, this also allows for lower fees. No expensive mining equipment is required and there is no competition between manufacturers. It also avoids energy wastage when implementing PoW. Only a small number of delegates participate in the validation process, so minimal computing resources are required.
What's more, proponents argue that the ability to vote in real time means a malicious delegate can be removed immediately, keeping the network secure. They also argue that DPoS offers a democracy where all users have a say in how the network works and therefore can also vote on governance issues, unlike other implementations.
Not everything is so rosy.
The main problem with DPoS is the need to trust a small number of delegates. This not only means that users must trust a select few to act in the best interests of the network, but also that power is concentrated in a small number of delegates and thus increases centralization.
Because fewer delegates are tasked with securing the network and verifying transactions, the network is also potentially more vulnerable to a 51% attack. An attacker would only need 51%+ of the delegates, not much of the entire network. A small number of delegates also becomes a potential attack vector for other attacks such as DDoS, as opposed to PoW or PoS where thousands of full nodes operate worldwide.
The implementation also creates a two-level hierarchy, divided between the ruling set of delegates and the broader user base. Such a system requires active voter participation to keep delegates "honest", but voter apathy applies to both DLT systems and real world politics. This lack of voter participation also simplifies the wider control of the vote and therefore dictates who gets rewarded per block. These awards also mean that potential delegates are encouraged to bribe voters and collude with others in order to gain the delegate role.
As with PoS, this tendency for the biggest players to be best suited for the most rewards means that the network will tend towards a collusive oligarchy rather than competition. The largest participants will eventually become richer and strengthen their positions as delegates. As they get more rewards, they will have more tokens. The more tokens they have, the more votes they have. This means that they will then have a better chance of being elected, and the cycle repeats itself, consolidating the supply in the hands of an ever narrower minority.
One of the largest voting pools, Lisk, has 32 of the top 101 delegates. The other is 54 . The 101st ranked delegate currently has 26.3% approval, which means that any "independent" potential delegate would have to receive more than a quarter of the entire voting base to be eligible to be a delegate, which is virtually impossible.
These shortcomings are greatly exaggerated when you consider the rapid price increases that many DPoS systems have experienced recently. There are DPoS networks that have risen in price by 50-500 times since 2017, which creates a clear imbalance.
For example, at the end of 2016, Ark raised less than $1 million through its ICO for 93.75 million tokens. These 93.75 million tokens will now be worth around $300 million. This leads to the possibility that a small number of users control the network and will be very difficult to replace given the share of the network they jointly control and the cost of achieving parity. This is not necessarily a DPoS-related issue - some PoS projects suffer from the same problem - but it does make the initial distribution of tokens a more pressing issue and weakens numerous existing implementations.
DPoS allows for more and faster transactions, but it also creates a new set of potential problems. It compromises with centralization in order to increase speed, which is driven by the inherent limitations of the blockchain. It is for this reason that a number of teams have begun to move away from the blockchain and move on to other DLT implementations.
PoW and PoS systems are designed to allow network users to vote on the current state of the network. This matching of votes increases the time it takes for the network to reach consensus. To solve this problem, virtual voting platforms like Hedera's Hashgraph use a new consensus algorithm to achieve the same consensus but without the time delay caused by the voting process.
This can be achieved because all nodes know what their vote will be, as well as what other nodes' votes will be. The community can reach consensus on both timing and order without a formal vote, and as a result, the network can approve transactions in seconds and process large volumes (hundreds of thousands of transactions per second).
Virtual voting works by taking the gossip protocol (which allows nodes to communicate with other nodes) and modifying it so that it becomes the "gossip gossip" protocol. Thanks to this, information about "events" is transmitted, so that each node can create its own copy of the history book, ordered using a directed acyclic graph. Each event in a DAG is made up of transactions, a timestamp (which allows events to be ordered correctly) and a parent event (similar to how blocks refer to the previous block in the block chain). It is also signed by the node that created the event.
Nodes gossip by randomly choosing another node to relay their event history. The receiving node then adds any new information it has not yet seen to its DAG. They then sign any transactions they may intend to send to the network. This creates a common record of all communications between nodes, and thus all nodes not only have a record of all transactions, but also a ledger detailing how all nodes learned about these transactions. This means that the node does not need to tell the neighbor how they voted - they can check their local DAG and thus determine how they would have voted.
Instead of a transaction being sent for approval and a period of time that elapses while it is confirmed, this structure allows the transaction to propagate across the network via these gossip. After a certain number of nodes have seen it, the transaction is considered confirmed and a consensus is reached. Although not all participants will have an accurate version of the new events, they will receive the same set of data, constantly gossiping among themselves until everything matches.
Because all nodes have the same historical information - as long as they can determine that most of the network saw Event X occur at time X - they will all come to the same conclusion about what happened and what their own vote because as well as the vote of other nodes. This eliminates the need for a formal vote.
Once a consensus has been reached, it cannot be cancelled. All nodes in the network have a history record of the events that led to its adoption - reverting to this consensus would require editing all previous events as well, which is not possible.
Accordingly, virtual voting solves the problem of Byzantine generals as follows:
-Generals have the ability to gossip with each other (for the sake of preserving the example of medieval generals, let's say they have carrier pigeons capable of transmitting a very narrow set of messages one on one).
-Generals send their pigeons to random generals with details of other messages they have received from other generals. --They also send information about their intentions. Each of them records the time when each message was received.
-By sending and receiving this information, the generals create a picture of what the other generals think and the time when all the generals declared their intentions/shared information.
-Any attackers attempting to block the information being transmitted will find that other Generals can share it among themselves anyway, and hence the malicious General will be bypassed (as long as these malicious Generals are less than 1/3 of the total). If a malicious general does not come up with the same story of events as the other generals, they will know that the general is not honest or reliable.
-Thanks to this, the generals will come to a general agreement on the correct information, and therefore can simultaneously agree on whether or not to attack and when to do so - without the need for a formal vote on this.
As a result, virtual voting is faster than PoW or PoS. It also avoids energy wastage in PoW networks since there is no mining involved. The nodes do not compete with each other for block validation - instead, all nodes in the network generate all events simultaneously via the gossip protocol. Events are not discarded, and in the network, all nodes are constantly communicating with each other.
The nature of the virtual voting and gossip protocol also means that malicious nodes cannot stop the processing of a transaction as it is broadcast to nodes throughout the network. This also ensures that there is not a single node that is given responsibility for creating/validating an event - all nodes in the network are responsible for creating the timestamp at which the event occurs, allowing proper sequencing and therefore preventing double spending.
However, it is important to note that there is currently no implementation of virtual voting in the public ledger. It exists solely as a private distributed ledger, the implementation of which does not require the same requirements as public ledgers. Private registries are easier to scale because you can trust the actors in them and network conditions; public distributed registries are another proposition.
This transition from the private to the public leads, for example, to the need to prevent Sybil's attacks. This is where an attacker tries to take over the network by flooding it with nodes they control, and is the attack vector that both PoW and PoS are designed to defend against.
Current implementations of virtual voting can only get around this currently by emulating DPoS elements and designating trusted delegates as the only ones allowed to validate transactions. This concentrates power among a small number of users who must be trusted to act in the interests of the wider network. Therefore, this increases the likelihood of potential collusion and self-interest coming to the fore.
Current implementations of virtual voting also suffer from working in DAGs. While DAGs can process more transactions and faster than blockchains, they also suffer from scaling issues.
Unlike blockchains, where the global state is updated periodically, DAGs do not have block time - the state changes with each transaction. As bandwidth requirements increase, the transaction database becomes too large to be written by all nodes. To solve this problem, the DAG can be sharded: divided into several different mini-DAGs, each carrying a small set of transactions. This creates new problems:
A DAG can only protect against double spending if it has visibility into all transactions it no longer has, or if a central authority tells you what to trust.
Dividing the DAG into many smaller subsets means that an attacker needs to control a much smaller portion of the total network power (hashing, staking, or delegated votes) to be able to attack the network.
As with other implementations, decentralized security is traded for performance and there is no evidence yet that a successful transition can be made to a decentralized public ledger. While virtual voting can help with scaling up, it is still limited by the data structure currently being worked on and its own inherent limitations.