Proof-of-Stake

In this book, we have presented two consensus algorithms: Proof-of-Work, and Proof-of-Elapsed Time:

As we learned, consensus algorithms need to be suitable for the ecosystem they support. And there is a big difference between what is suitable for an open permission-less public blockchain, such as Bitcoin and Ethereum, and a private permissioned blockchain framework such as Hyperledger. The difference stems from the need for trust in the system, or lack thereof. Different levels of trust call for different consensus algorithms. Therefore Proof-of-Work is suitable for Bitcoin and Ethereum, but Proof-of-Elapsed Time is not. On the other hand, Proof-of-Elapsed Time is a great solution for the Hyperledger framework for permissioned blockchains.

An alternative to Proof-of-Work for public blockchains could be Proof-of-Stake. In fact, Ethereum's vision since inception has been to move to Proof-of-Stake, and this is expected to be implemented with the Casper upgrade.

Proof-of-Stake leverages a game theory principle of staking resources in order to mine new blocks, and this logic is similar to Proof-of-Work. The main difference is that while in Proof-of-Work miner's stake external resources, such as electricity and computer hardware, in Proof-of-Stake they pledge internal resources represented by their stake in the network's native cryptoasset. Thus, in the case of Ethereum, mining nodes would need to stake their Ether cryptocurrency in order to validate new transaction blocks. If they don't follow the rules of the protocol, miners would lose their security deposit of cryptoassets. This form of collateral should provide sufficiently strong incentives for miners to act with integrity.

The potential benefits of Proof-of-Stake versus Proof-of-Work are many. It doesn't consume enormous amounts of electricity, and therefore it is much more sustainable and environmentally friendly. It also should provide a higher transaction throughput as network consensus can be reached faster, perhaps almost immediately.

Proof-of-Stake and Proof-of-Work can also be combined in hybrid consensus algorithms. For example, the Proof-of-Work hash puzzle can be made easier for miners with larger stake in the native cryptoasset or who have been holding their stake for longer.

Actually, a hybrid consensus system is the way Ethereum pushes forward its roadmap towards transition to Proof-of-Stake. In stage 1 of the Ethereum Casper upgrade, all of the Proof-of-Work mechanics continue to exist, but additional Proof-of-Stake mechanics are added. In this implementation, 1 out of every 100 blocks is a checkpoint validated with Proof-of-Stake consensus. Participants who wish to be Proof-of-Stake validators can deposit their Ether cryptocurrency at a special smart contract address: a Casper contract. This address will provide them with a special validation code, which is a kind of a cryptographic key. The idea is similar to the keys used to sign and send transactions that we discussed in Chapter 5, Five Forces of Bitcoin – #2 Cryptography.

With this special code, validating nodes can sign and send messages, with which they vote and participate in the Proof-of-Stake consensus process. For a new transaction block to be approved for inclusion in the blockchain, at least two-thirds of the active validator pool has to commit to it. If a situation arises in which two incompatible blocks with conflicting sets of transactions are mined at the same time, the miners responsible for that lose their deposits, which represents a huge incentive to act in good faith. The cost of attacking the Proof-of-Stake consensus mechanism could potentially be even higher than buying a lot of expensive computer hardware for mining and engaging in repeated attacks on a Proof-of-Work consensus system. In Proof-of-Stake, validators also get mining rewards in the form of transaction fees. This effectively delivers a stable yield on the stake they have deposited. It is similar to the interest rate people get from a bond or a bank deposit. This return on investment (or ROI) is also similar to the way Proof-of-Work miners get block rewards when they mine new blocks, to compensate them for their investment in physical hardware and electricity. For a detailed description of this process, please check out Chapter 6, Five Forces of Bitcoin – #3 Consensus Algorithm.

As Vitalik Buterin, the founder of Ethereum, put it:

"Proof-of-Stake can be thought of as a kind of virtual mining, whereas in Proof-of-Work, users can spend real-world dollars to buy real computers which expend electricity and produce blocks at a rate roughly proportional to the cost expended, in Proof-of-Stake, users spend real-world dollars to buy virtual coins inside the system, and then use an in-protocol mechanism to convert the virtual coins into virtual computers, which are simulated by the protocol to produce blocks at a rate roughly proportional to the cost expanded, replicating the exact same effect but without the electricity consumption."

Most new projects trying to build next generation blockchains use some variation of the Proof-of-Stake consensus mechanism.

The potential challenges for Proof-of-Stake come from the fact that it is a newer and largely untested protocol on a massive scale. After all, Proof-of-Work is a much more established and battle-tested consensus mechanism. This is evident from the 10-year history of Bitcoin. That's why the majority of alternative public blockchains, or alt-coins, use it at present. Whether it is sustainable to support a future global transaction network at the scale of the internet, based only on Proof-of-Work, is another question. Perhaps Proof-of-Stake will be more suitable for that. Or even more likely, we'll have many different consensus algorithms in use, each suitable for a different context: