Proof Of Stake Consensus

Adelene
Comprehend
Published in
7 min readAug 8, 2021

How does Proof of Stake works? Why is it so popular nowadays?

Like Proof of Work consensus, Proof of Stake (PoS) aims to solve the double-spending problem and confirms transactions in the blockchain. Double spending occurs when the same digital money was used twice. Our traditional financial system has the Automated Clearing House (ACH) network that confirms transactions. For a cryptocurrency that is decentralized, this is a problem to solve.

The proof of stake mechanism requires users to hold a certain number of cryptocurrencies to validate transactions. Instead of consuming computer power to validate blocks, proof of stake uses existing coin holders. In PoS, there are no miners. Blocks are “minted”, as users that validate transactions add blocks to the blockchain.

PoS validators receive the network fee as a reward for their work.

How does PoS work?

Validating transaction based on the cryptocurrencies they hold seems awfully similar to our traditional financial system. In ACH, the central bank is the “validator”. In PoS, anyone with a certain amount of crypto can become a validator. For instance, in Ethereum 2.0, you need to hold a minimum of 32 Ether (ETH) to become a validator.

The verification method is also called “attesting”. Validators verify the block by signing it off as “this transaction looks about right”.

What if the transaction isn’t right?

Validators “stake” their crypto holdings, think of it as a “lock-up” to ensure valid transactions. If the transaction is verified and correct, the stakes get rewarded by the network fees. If the transaction is not “right”, validators lose a portion of the holdings they have.

In PoW, miners get rewarded for their effort. In PoS, validators get rewarded by placing their assets “on risk”.

Imagine transactions being stuck because multiple validators disconnected from the network. Cryptocurrencies that use PoS have mechanisms that incentivize good validator behavior. In the event that validators go “offline”, they lose a portion of their holdings. By going offline they cannot validate blocks. The blockchain network deems the stake: “failing to validate” transaction.

Why does holding more coins means more verification?

Each validator is chosen randomly to create blocks. The higher the number of coins the validators have, the more blocks they can verify. In other words, the more coins you have more verification you can “attest” to.

Let’s compare this to a real-life scenario. If multiple needs to borrow multiple loans in a fixed amount of $10. If the lender has a pool of funds worth $10,000 he can afford to lend to more users. Compare this to someone who just has $1000, he can’t afford to lend more than what he has!

Same with PoS. The more cryptocurrency a validator has, the higher its capacity to validate transactions.

Remember that if a transaction fails, the validator loses a portion of its holdings. The more a validator stakes their cryptocurrency, the more transaction will go through them at a time. Since they would have sufficient funds to ensure a certain amount of transaction goes through.

Proof of Stake Algorithm

Okay. We kind of get the theory behind PoS, but how does the algorithm work?

steps in proof of stake algorithm
Photo by Debby Urken on Unsplash

Steps in PoS consensus

Transaction request occurs. The algorithm puts the request in a pool.

All nodes bet to become validators for these transactions. The network chooses validators based on their preferred randomization protocol.

The validator verifies the block, giving it a “looks good” sign. However, it would be a bad mechanism if the network just relies on one validator’s “ok” sign. Network arranges other validators to validate the verification.
Example: In Ethereum 2.0, the transaction needs to be verified by at least 128 randomly chosen validators to attest the transaction!

If the transaction is successfully verified and gone through. Then, the validators receive the network fee as a reward for their work. If the transaction fails to verify with other node’s approval, validators lose their stake.

Repeat the process again to verify the block.

How does the network choose validators?

These are 2 popular randomization protocols used by blockchain networks to choose validators:

  • Randomized Block Selection
  • Coin Age Selection

Why have a randomization protocol in place?

We have concluded that the more coins a validator have, the more transaction it can validate. However, if the most transaction goes through the top holdings validator, then the same user base controls most of the network transactions.

This destroys the decentralized nature of blockchain. To ensure the integrity and decentralization nature of blockchain, we can’t simply choose validators based on the number of coins they stake.

Randomized Block Selection

Randomized block selection selects the next validator based on the combination of the lowest hash value and the highest stake. The validator node that has the best combination of these 2 factors becomes the next likely validator.

Coin Age Selection

Coin Age system selects the next validator based on how “old” the coin has been staked. It calculates the number of days the unique cryptocurrency coin has been “locked up” and the number of coins being staked.

Usually, coins need to be held for a minimum of 30 days to compete with other validators. The older the coins have been staked, the more likely it is to be chosen as the next validator for blocks.

Once the validator has forged a block, their Coin Age resets to zero. They would have to wait 30 days again to sign another block. Preventing very old and large stakes from controlling most of the network’s transactions. The longer you didn’t verify a block, the more likely you will get assigned to verify a block!

Coin Age Selection mechanism is one of the good systems for decentralization staking. The pioneer for this is Peercoin, a proof of stake cryptocurrency.

Why Proof of Stake over Proof of Work?

PoS was created to resolve issues with PoW.

Electricity Consumption

Proof of Work (PoW) — mining, requires lots of computational power. This raises sustainability and energy consumption concerns for the blockchain industry. This report shows that Bitcoin mining consumes more electricity than a country — Argentina.

In contrast, PoS only require a minimum amount of cryptocurrencies to participate in verifying transactions. Users can choose to stake with a staking pool if they don’t have enough coins to qualify as a validator. PoS consensus only uses computer power to upload blocks as they are added in the blockchain, it consumes significantly less electricity.

Decentralization

Bitcoin’s mining algorithm favors AISC machines. This incentivizes organizations to purchase thousands of mining hardware. In PoW, countries that have low electricity bills can afford to mine more. Both of these combinations make China a very profitable geographic location to mine cryptocurrencies.

This is a problem, evident when China crackdown on Bitcoin mining. The whole network lost significant computational power. Transactions in the network get approved slower.

In PoS, randomization protocol such as Coin Age Selection can decentralize the validator selection. Although the algorithm favors high-stakes, it has measurements in place to not solely favor high coin validators.

51% Attack Resistant

51% attack is where a single person or organization controls more than 50% of the transactions in the blockchain. It would allow them to manipulate blocks, allowing them to alter transaction details to their own private benefit.

A prominent example of a 51% attack is on Shift and Krypton. This article, explains in detail why smaller mining-based cryptocurrencies are prone to 51% attacks.

In PoS, a single person or organization would need to hold over 51% of the cryptocurrency. Cryptocurrencies that use PoS mitigate this problem by only allocating a certain percentage of their coins available to the open market.

Furthermore, the bad actor would need to have a significant financial ability to purchase 51% of the total supply of the cryptocurrency. If they decide to do this, the cryptocurrency they buy would raise in price due to the purchasing volume. They would lose their money by executing their 51% attack on the network. PoS mechanism significantly discourages 51% attack.

Conclusion

PoS is alike our traditional financial system. Instead of the central government-approved financial institutions as guarantors, we have independent validators. If they make a mistake in validating transactions, they lose their holdings. In return for their work, they get rewarded with more coins.

Proof of stake is increasingly popular. It solves major problems faced by the PoW mechanism. Low consumption of energy paints PoS in a favorable light in the mainstream media. Validators can stake their holdings and earn recurring income. A much more attractive option than investing in expensive mining equipment and calculating electricity cost compared to mining profits.

PoS is still in its early stage compared to PoW. There are concerns that PoS is less secure than PoW. Furthermore, most people want to participate in validating process to gain interest rates for their cryptocurrencies. Prompting them to join staking pools, which have their own risk associated with it.

We have just touched upon the surface of PoS. There are a lot of variants that innovate themselves from the regular PoS algorithm. Here are some of the variants of PoS consensus:

  • Proof of Authority (PoA)
  • Delegated Proof of Stake (DPoS)
  • Leased Proof of Stake
  • Masternode Proof of Stake
  • Zerocoin Staking

Each of these variants deserves a deeper look. Which is beyond the scope of this article.

Repurposed content. Originally published at https://comprehend.substack.com on August 8, 2021.

--

--

Adelene
Comprehend

Crypto enthusiast. Privacy and security advocate. Obsessed about productivity, self-development, and finance. Learn about crypto on comprehend.substack.com