Mining More Detailed. 5. PoS Algorithm And How It Differs from PoW
In the previous articles devoted to mining, we have provided a detailed explanation of the PoW mining approach. PoW has become the first implemented and examined protocol. Nevertheless, alternative solutions contain plenty of interesting details as well. Let’s consider the Proof of Stake concept more properly.
PoS general properties
As it was mentioned before, the probability to find a new block using PoS depends on the amount of cryptocurrency provided by a full node. However, the whole process is much more complicated than it might seem first.
First of all, we should pay attention to roles given to full nodes in the system. Using PoW provides no functional differences among miners. Each full node is a fully-fledged member of the network that aims to find a correct hash function value as quickly as possible. PoS is somewhat different. Even if a node is full — that is, it contains a full-fledged blockchain — in some cases it may not have the right to decide on the block closure.
This may happen if the protocol must choose several varificators among all full nodes. To become a varificator, a node must send a special transaction that preserves some amount of cryptocurrency as a deposit, or bail. After the bail is fixed, the node is considered as a potential verificator and can participate in the next block selection.
The process of nodes assignment depends on the details of a specific PoS solution. As a rule, one random verificator or a group of verificators is selected. In the first case, the key parameter is time. It is quite limited for the block approval. In the second case, the key parameter is a bail value. It defines the “weight” of verificator while deciding on the block closure.
Two levels of PoS
Sometimes, a two-level node system is used. First-level nodes mine new blocks, while second-level nodes approve them. Their roles might be randomly changed. There is also a mixed solution — key blocks are mined through PoW, while intermediate blocks are forged through PoS.
The second important detail is the possibility to use one bail to approve several blocks. This kind of spam allows an abuser to try to approve an incorrect block hoping that it will be added to blockchain sooner or later.
The Casper solution proposed by Vitalik Buterin is an example of a PoS protocol project. This approach assumes both a reward for a blockchain service and penalties. Miners close blocks to get a reward and to support the blockchain convergence. Thus, the Casper solution pushes miners to place stakes on “correct” blocks sequences if there are more than one of them. Some chains may appear in the wake of a blockchain fork and cause unwanted consequences.
However, it is still possible to bet on several chains simultaneously. But in case of failure, the stake will be dropped. Thus, developers additionally motivate miners to rapidly find and close correct blocks.
Advantages of PoS over PoW are obvious.
The first one is the rapid decrease of energy consumption. Indeed, Ethereum requires only 2.4 gHz calculating device, 4 Gb of memory, and some free space on a hard drive for the wallet. Of course, a full node has to have more room to download the full blockchain, but still there is no need for huge mining rigs.
The second advantage is the ability to apply a random selection, which decreases the risk of potential centralization. With the help of the gaming theory, the process of reward distribution among nodes may also be improved.
Unfortunately, PoS has its own flaws. As any other solutions, it may be subjected to majority attacks or unwanted forks if some vulnerabilities are found. Nevertheless, Proof of Stake seems to be stable enough, and its advantages are really impressive.