Nerd For Tech
Published in

Nerd For Tech

Impact of availability

Blockchain algorithms. Part 4. Proof of Stake

This algorithm was first proposed by the user QuantumMechanic on bitcointalk.org in 2011 as an alternative to the Proof-of-Work used in Bitcoin. PoS is also called forging.

Forging is the creation of new blocks in the blockchain in various cryptocurrencies based on proof of ownership with the ability to receive rewards in the form of new units and commissions.

The first coin that was partially implemented on a proof-of-stake algorithm is Peercoin. To be more precise, a hybrid version was used in PPC: initially, the principle of mining using the Proof-of-Work algorithm was used, and after all the coins were mined, the transition to Proof-of-Stake took place.

The first “clean” coins that worked on PoS from the very beginning were NXT and Blackcoin.

How Proof of Stake works

The PoS algorithm uses a pseudo-random process to select a node to validate the next block based on a combination of factors, which may include stake (stake) age, randomization (random node selection), and node status.

The principle of PoS operation is as follows: a certain number of coins on the accounts of participants who participate in forging are “frozen” as a kind of guarantee of the node’s honesty.

The coins are in a “frozen” state until a block is generated by one node, and the other participants confirm the correctness of the masternode’s actions. This “freeze” is also a precautionary measure that helps prevent attacks on the network, avoid “double spending” of coins and exclude the possibility of validation of fake transactions by nodes.

PoS cryptocurrencies often start with a pre-sale of coins or run on a Proof of Work algorithm and then switch to Proof of Stake.
In the case when the system is based on Proof of Work, more and more cryptocurrency is created as a reward for miners, the PoS system usually uses a commission as a reward.

Users wishing to participate in the forging process are required to secure a certain number of coins in the network, their share. The stake size affects the likelihood that the node will be chosen by the next validator to forge the next block, the larger the stake (stake), the greater the chances. To ensure that this process does not support only the richest nodes in the network, more unique methods are added to the selection process.

Nuances

Two of the more well-known methods are called ‘Random Block Selection’ and ‘Coin Age Selection’.

With the method of random selection of the block validator, they are determined by searching for the nodes with the lowest hash value and the largest fraction. Since information about user shares is publicly available, other nodes can predict who will be the next forger.

The method for determining the “life” of a coin indicates the nodes based on how long their tokens have been in the stake. The age of coins is determined by multiplying the number of days by the number of coins that were in the share. The age of the coins is reset to zero as soon as a node forges the next block and it needs to wait a certain amount of time before being able to create another one, this prevents the dominance of large share nodes in the blockchain.

When a node forges the next block, it checks if the transactions in the block are valid, then signs the block and adds it to the blockchain. As a reward, the node receives a block transaction fee.

If a node wants to stop being a forger, its share, along with earned rewards, will be available after a certain period of time, which gives the network the opportunity to confirm if there are any fraudulent blocks added to the blockchain by this node.

Unlike Proof-of-Work, in Proof-of-Stake, the determining factor is the number of coins on the account of a node (node). Those. the more coins are stored in one wallet, the more chances you have to generate a block and receive a portion of new coins. The node that “wins the fight” is called the masternode.

The PoS principle is somewhat similar to the game of roulette: the more bets you make (in our case, you have coins), the higher the chances of winning (receiving a reward in the form of cryptocurrency).

Algorithm security

In the event that a fraudulent transaction is noticed by the network, the forging node will lose part of its share and rights to participate in the role of a forger in the future. Thus, if the share is greater than the reward, then the validator will lose more coins than it will receive in the event of a fraudulent attempt.

In order to effectively monitor the network and confirm fraudulent transactions, a node needs to have a controlling stake in the network, also known as a 51% attack. Depending on the price of the cryptocurrency, this can be quite impractical, as in order to gain control over the network, 51% of the coins of the total circulation will need to be purchased.

There are 2 key advantages of the Proof of Stake algorithm: low power consumption and high security. The deployment of nodes does not require special capacity, therefore it is available to a wide range of users.

This, along with the randomization process, also makes the network more decentralized as the pool is no longer needed to mine blocks. And since there is less need to release many new coins for reward, this helps the price of a particular coin to stay more stable.

Advantages and disadvantages of PoS

  1. Energy efficiency — unlike the traditional Proof-of-Work, the Proof-of-Stake algorithm does not require huge energy resources — electricity is spent only on confirming the transactions themselves
  2. Low resource requirements for equipment — all that is needed to participate in forging is a computer (regular PC or laptop), stable Internet and an installed client program
  3. Low fees — unlike bitcoin and other coins that work on PoW and in the commission of which, in addition to processing transactions by miners, payment of electricity bills are also included, transactions of coins on PoS are cheaper due to the lack of energy consumption
  4. Greater decentralization — In order to create a stable masternode and actually have complete power over the process of confirming transactions, you will need to have just a huge amount of coins. However, there is also a downside — in theory, “whales” can buy out most of the coins, consolidate and seize power over the forging of a particular coin.
  5. High resistance to equipment breakdown — since forging does not require expensive and complicated equipment, it is very easy to replace it in the event of a breakdown of the device
  6. Low probability of carrying out an attack 51% — to make this type of attack, the forger must have more than half of all coins. Firstly, it is very expensive, and, secondly, he himself will suffer from the attack in the first place, since the value of these coins after the attack will plummet.
  1. The possibility of a double-spend attack is a double spend attack. The fact is that in PoS, blocks can be mined at any height. Therefore, in order to carry out an attack, it is necessary to mine two blocks in parallel — one with a payment that will go to the recipient, and the second with a transaction that will be returned to the miner. If the miner finds both of these blocks, then he will confirm the first, and the money will go to the recipient, and the second will enter the network for confirmation by other participants, the money will be returned to the miner, and the network will continue from this block.
  2. Impossibility of coin circulation — in order to participate in forging, you need to have a certain number of coins on your account and not withdraw them, i.e. it will not be possible to make purchases, exchange coins on the exchange, or carry out any other operations
  3. A sufficiently high entry threshold — in order to participate in forging, a node must have a certain amount of coins (for example, for Dash, you need to have at least 1000 DASH)
  4. Small profit — in this case, low commissions become not an advantage, but a disadvantage, since with forging by it you will be able to earn as much as on mining

Keep for updates.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store