What is proof of stake, and how does it work?
The proof of stake system is a consensus protocol that came as a response to the shortcomings of proof of work. It is attracting a lot of attention as of late, with Ethereum switching its consensus protocol from proof of work to proof of stake. Proof of stake is nothing more than an alternative way to verify transactions on a blockchain.
How does it all work?
Proof of work and proof of stake works very differently, even though they are trying to do the same thing. The proof of work system has its users validate transactions and create new blocks by solving a “puzzle,” which requires some computational power. On the other hand, a proof of stake consensus algorithm requires the user to show ownership of their funds to validate transactions.
When it comes to proof of stake system, the creator of a new block is picked in a pseudo-random way. The block creator has more chance depending on the size of their “stake.” In the proof of stake system, blocks considered forged or minted rather than mined. Nodes who validate transactions and create new blocks with this system are not miners, but rather forgers.
To validate transactions and create blocks, a forger must stake their funds. Their holdings are being held in an escrow account, which acts as collateral for any potential fraud attempts. If a forger tries to validate a fraudulent transaction, they lose both their staked holdings and their rights to participate in the process. This way, the proof of stake protocol incentivizes forgers to validate only non-fraudulent transactions.
An important thing to note is that most proof of stake projects already created and distributed their digital currency units already. When this is the case, the forgers receive transaction fees instead of new cryptocurrency as rewards. This is considered true only if the cryptocurrency cannot inflate itself by minting more and more coins.
Block selection methods
Proof of stake consensus algorithm needs a way to select future forgers. There are two main ways to do so:
Selecting a user randomly
Selecting a user based on their coin age.
Selecting a forger only by the size of their account balance would go against the whole premise of cryptocurrencies, and is a bad idea. That way, people with more funds would get richer, while the ones with fewer funds on their account would be hindered and have less control over block creation. To counter this problem, these two methods have come up as the most popular and reasonable.
Randomized block selection
The randomized block selection method is just what it sounds. The method seeks a user that offers the lowest hash value regarding the size of its stake. As all stake sizes are public, each node can predict (with high probability) whether they will be selected to forge the next block.
Coin age-based selection
This system is a bit different than the randomized block selection one. It selects the next forger based on the ‘coin age’ of the node’s stake. Coin age is a multiplier of the number of days the funds have been staked and the number of coins that are being staked. Coins must be staked for 30 days before they can compete for block creation. Users with larger stakes have an advantage, but so do users who have staked for a longer time. Once a user forges a block, their coin age is reset to zero. After a node forges a block, they must wait at least 30 days before creating another block. This mechanism promotes decentralized forging while maintaining a power balance between large stake forgers and lower stake forgers.
Advantages of proof of stake
Proof of stake is a much more environmentally friendly and efficient consensus algorithm than the proof of work method. The electricity and hardware costs are much lower due to how the method is made.
Unlike proof of work system where a 51% attack is performed by obtaining the majority of hash rate, proof of stake attackers would be required to obtain 51% of the cryptocurrency to perform the attack. Even though performing a 51% attack is possible, forgers with the majority of funds would not risk their money to perform such an attack. If the cryptocurrency price drops due to the attack, their holding value would also drop.
Proof of stake is a consensus algorithm that is created as an answer to the disadvantages of proof of work. It offers a unique way of validating transactions and creating blocks, and it is gaining popularity. With that being said, the Proof of Stake algorithm is not better than Proof of Work on all fronts, and each project should consider both methods before picking the one they like.