The power of cryptocurrency is not just security and decentralization. It is also due to what is called the consensus mechanism, which allows participants called nodes in a decentralized system to come to an agreement to validate the truth on a blockchain. The most popular is the consensus used in Bitcoin, called PoW (Proof-of-Work) which requires mining to create coins on the network. Although it has been tried, tested and proven true, it has issues with scalability and sustainability. Although mining is reliable, it can be energy intensive to participant nodes because it requires plenty of computing resources (hash rate) to solve cryptographic puzzles to add a block to the blockchain. That translates to larger electric bills and thus will not be ideal for payment systems that require mass volume transactions that need to be processed daily 24/7/365. It is also slow because in a blockchain, the data is sent to all nodes rather than just one server processing the transactions. It had its limitations called out by developers, thus leading to other consensus mechanisms that used more efficient algorithms that also increase the transaction velocity on the network.
This is why a new type of consensus mechanism was developed called PoS (Proof-of-Stake).
What is PoS?
This is not the same as Point-of-Sale, that is a totally different system for payments. Proof-of-Stake is a consensus mechanism algorithm that requires no mining to validate transactions and create blocks. Instead it requires to stake a certain amount of funds to become validators on the network. These funds are a % of the total coins that exist on the network.
Let f = fund staked as %, Ts = total supply of coins, Ta = total amount staked
f = (Ta / Ts) x 100
PoS and variations of it are being used in cryptocurrency like EOS, Tron, Tezos and soon it will be implemented on the Ethereum network.
When you are mining for blocks using PoW, like in Bitcoin, you must compete with other nodes called miners in order to validate blocks. This is done by trying to solve what is called the nonce which is a value (based on a difficulty target) that contains a hash of numbers. The value is either less than or equal to the nonce, and must be discovered by miners within an average time of 10 minutes. The miner who is able to compute the nonce first becomes the block validator who creates the blocks and in return receives Bitcoins as a reward.
On PoS, there is no need to compete with other nodes to solve a cryptographic puzzle. Instead, there are a set number of nodes called stakers who will help validate transactions. In some systems, like in a delegated PoS network, token holders can vote for block validators (called producers in EOS) who have staked a large investment into capital resources (e.g. data center, servers, etc.). The code than provides a time when block validators will create blocks and in return they will receive their reward in the cryptocurrency’s tokens.
If we have two staking nodes called f1 and f2:
If f1 = (Ta / Ts) x 100 > f2 = (Ta / Ts) x 100
This means f1 will be the block validator based on what was staked or weight of their % of coins.
Here is one example of PoS. According to Ethereum founder Vitalik Buterin from his blog:
The simplest formula for this (PoS) is:
SHA256(prevhash + address + timestamp) <= 2^256 * balance / diff
prevhash is the hash of the previous block
address is the address of the stake-miner
timestamp is the current Unix time in seconds
balance is the account balance of the stack-miner
diff is an adjustable global difficulty parameter
“If a given account satisfies this equation at any particular second, it may produce a valid block, giving that account some block reward.”
The idea behind PoS is to encourage honest participation among trustless participants using game theory. You cannot know for sure who is acting on good faith or who is the bad actor. Thus, the idea of putting your own funds as a stake to being a validator is what shows your willingness to help in the network. Otherwise, that participant will lose their staked funds if they become dishonest or try to attack the network. The consensus among all nodes can deny the participant’s block if they attempt to cheat. They either lose their stake or get rejected from the network and even blacklisted. It all comes down to the protocols of the digital governance on the network, something that is a feature of PoS systems.
Another thing to note is that PoS is also based on the weight or amount a node has put at stake. Therefore, the more funds you stake the better your chances are for becoming a block validator. The validators can be chosen by random selection or voted by the token holders as mentioned earlier. This process is much faster to resolve than the 10 minute block propagation time in Bitcoin’s PoW because it requires no mining to solve for the nonce. It can actually be more instantaneous since the selected block validator can process the transactions and create the block which then updates all nodes on the blockchain. Much faster than having all nodes try to validate the block at the same time by discovering a nonce. This allows for faster transactions speeds that are more suitable for micropayments and retail transactions i.e. buying a cup of coffee with cryptocurrency.
This consensus mechanism is also more energy efficient. Producing a block on the network doesn’t require expending a lot of electricity like in Bitcoin. This saves not just costs, but also time. This has been the main argument for PoS among its proponents.
Despite its more refined algorithm, there are also issues with PoS. The following will discuss some of the well known issues.
If you are to look at the algorithm, it favors wealth. Critics argue that in a PoS system, those with more at stake or resources available will surely always come out as the validators. This is not exactly fair, and can lead to a sort of network oligarchy which can control the blockchain. If this is the case, what have PoS developers done about such issue?
To make sure that things are fair, code was written to randomize block validator selection that is still based on the amount at stake. This means that anyone who is staking is likely to get selected based on how much they have staked. When the load of transactions is even greater to process, a node that has staked more will likely become the validator because their stake can prove that they have the resources available to create the block. Now the argument against this is that it still shows that it will be favorable only to those with higher incomes. They can even collude to become block validators based on their stakes and collect all the fees from transactions. This creates a barrier to entry that limits decentralization. This then can lead to centralization, which is what blockchains are not supposed to be.
Centralization is indeed counter to the ideology of a blockchain. In order to prevent only a few validators from ever gaining control of the network, different methods have been developed.
Here are some of those methods:
- Randomized Selection – This will ensure that validators who have validated before will not be the only validators. Instead the algorithm will randomly select a new validator each time. A validator who has validated before will get their chance again in the future. Some networks will actually allow for x number of validators only, while others can allow for unlimited numbers of potential validators.
- Elections – Other cryptocurrency use digital elections or delegated PoS (e.g. EOS and Tron) to determine who the block validators will be. In EOS they are called Block Producers, while in Tron they are Super Representatives. The network allows all token holders with voting rights to ‘freeze’ funds for candidates to become validators. In EOS 21 are elected while in Tron it is 27. This appears to be a smaller number of nodes, but the logic behind this is that although it is less decentralized, it helps to scale up processing for faster transaction processing. The network can then call for a new round of elections to select new validators to make sure that it is not too centralized.
- Time Allotment – In this scheme, anyone who has staked joins a queue to become a block validator. It will be a fixed amount, and so the system is not based on who has staked the most. The node will then wait for their turn to become a block validator. The problem with this type of scheme is if anyone can validate, how can we be sure they have the resources to do so? What if they are using only a low end PC or just their smartphone? Will that be enough compute power to create blocks? In this case, such a system can work for nanopayments or even non-compute intensive micropayments that use smaller block sizes. All the node needs to do is add the block after the consensus has determined it is valid. In return the node receives their fees.
- Validation By Delegation – In Tezos this is the PoS scheme, called Liquid PoS. In this system, a validator can delegate their validation rights to other validators on the network. This is done using a process called baking. The node called a baker has block producing rights based on their stake. This model is more or less a way of sharing the rewards. This is because by process of validation by delegation, the baker can delegate production to another baker without transferring their ownership of stake. Instead they keep the stake and get rewards which they then share with the delegated baker. This works well if the baker has a good reputation and integrity on the network.
The problem with centralization is that a rogue node can accumulate a majority of the cryptocurrency’s tokens. If they were to gain 51% of the coins and stake them on the network, that can lead to attacks. Now the question is, does that even make sense? It definitely requires a lot of investing into the cryptocurrency to have a majority hold on its coins. This is also called the 51% Attack and it can also be possible of PoW systems.
f = (Ta / Ts) x 100 = 51
In a post made on the Qtum blog:
“In PoS, after a rollback, the attacker address can be blacklisted and those coins simply ‘deleted’. This would make the remaining coins in the system go up in value and the attacker would have to repurchase the coins in an effort to relaunch the attack. This is especially risky for them if they were shorting the coins, as they no longer have access to them and have to pay back the lender.”
In this case it would make things more expensive to attack the network so it discourages bad actors. As of this writing (September 2019), there has never been a successful attack on a PoS blockchain that demonstrates this example.
Nothing At Stake
The Nothing At Stake theory is a problem that arises on the blockchain due to its distributed nature. This type of attack can delay and complicate transactions on the network. Staking is a process that adds value to the network. What is being staked is actually the % of coins that a user has of the total supply. It is thus in their best interest to make sure that the network is secured, otherwise they will lose their value. This incentivizes the node that stakes to behave honestly or else risk devaluing their network.
This problem can occur when there is a fork or series of forks on the network. A fork is another chain that forms from the main network during a contentious moment in which the network becomes split. One network supports one block while the other half refuses to go along with it. This also occurs when there are simultaneously two block validators trying to produce a block for the network. During a fork, a node can put their stake on both chains because they have nothing to lose from it. This type of behavior is not exactly approved by consensus.
The node can get away with it though. This is because the node will get their reward no matter which chain wins. This can lead to what is called a double spend. The node that has put a stake on both chains loses nothing because they will get their reward from the chain that wins. Now imagine if all nodes followed this lead. It makes two chains exist at once, which means there is really no main network. The node has nothing at stake because they don’t incur any costs to doing this.
This makes the network less secure and prone to more discrepancies. One of the chains can overtake the other, and any bad transaction on one chain is considered good on the other chain. Thus, a node has nothing to lose since the eventual chain that wins will reverse any bad transactions they had on the failed chain. The node collects fees no matter which chain they are on, and this can lead to many inconsistencies on the blockchain.
To address this issue, developers have come up with mechanisms that prevent or discourage this. To explain in simple terms, when the network detects a node attempting a nothing at stake attack, they will be reprimanded. The consequence is that the node will lose their stake, which is something to lose. This encourages honesty among the nodes because of the penalty of malicious intent to the network.
A great feature of PoS is to allow more participation among token holders and involve the community when it comes to consensus. However a cryptocurrency chooses to implement their PoS protocols, the thing to remember is that this is an alternative option to PoW. The benefits are clear, but there are also issues that need to be addressed. Some have tried to implement a hybrid PoS and PoW system to reap the benefits of both consensus mechanisms. Overall, these systems will eventually mature and develop over time, so there is plenty to observe once they have been in production.