As Ethereum gets ready to release the Metropolis hard fork in the next few months, there is still a great deal of talk about Casper and the move to a Proof of Stake (POS) from a Proof of Work (POW) mining protocol. An interesting adaption of the GHOST (Greedy Heaviest-Observed Sub-Tree) protocol, Casper is the current proposal by developers.
This update is poised to make significant changes to the cost and speed with which users can transact on the Ethereum network. This is also particularly important as the Bitcoin blockchain is showing signs of strain and is still embroiled in internal divisions.
Proof of Stake Mining?
Proof of Stake is fundamentally different from Proof of Work (PoW) where the creator of a new block is chosen in a deterministic way based on his wealth or “stake”. This is different from the PoW algorithm where a network participant or “miner” will have to work on a complicated mathematical problem that requires resources to solve.
With POW mining, when a miner is able to solve a block problem they are rewarded a certain amount of coins for solving the block. However, with POS there is no reward for solving a block and the miners will only get transaction fees.
Given that there is no rush by the miners to solve PoW computational problems (which get harder and harder) PoS transactions can be much more cost effective and efficient.
The basics of the PoS algorithm are easy enough to understand, however the Casper PoS protocol is slightly more complex than that.
Security Deposit Based Authentication
In the case of the Casper PoS protocol, the “stake” is termed the “security deposit”. Network participants or “nodes” will have to place this security deposit in order to serve the consensus. This is called “bonding” and those nodes that have already given over a security deposit are bonded validators.
The whole idea behind the security deposit is that the miners are kept honest. If there is anything that is found to be invalid by the network then they will lose their deposit. This allows there to be a cost of behaving badly.
Consensus Gambling Games
The other idea behind the Casper protocol is to make the bonded validators “bet” on how the consensus in the network will turn out. Moreover, the consensus process expects all of the validators to bet on how they think all of the other participants will be betting their deposits.
If they bet in the correct direction then they earn the deposit back together with all of the transaction fees. If on the other hand they are unable to agree on the consensus of the protocol then they will re earn less of their deposit. The goal of this is that through numerous rounds of betting, the bets will eventually converge.
Moreover, the Casper POS protocol will punish those nodes that change their bets in a dramatic fashion. For example, those that bet with a high probability on one block and then do an even higher probability bet on the next. This is done to make sure that the nodes are only betting with the most probability on the blocks that they view to be closest to the consensus.
Combatting Node Censorship
Of course, when it comes to consensus protocols, there is always the risk that a group of the nodes will try to maximise their profits to the detriment of other nodes. In order to avoid this the Casper PoS protocol relies on self-interest of the validated nodes as given by game theory economics.
The reward for all of the participants is greater when 100% of all of the consensus nodes agree. This will punish those nodes who are not creating blocks in a protocol-prescribed order. Casper is able to identify blocks that are created in this manner and will withhold the transaction fees and deposits from the validators.
More specifically, the reward or revenue that the bonded validators earn is a linear function in the number of validators who are participating in this consensus game.
Possible Impact on Transactions Per Second
As many have touted, the move to the Casper POS protocol is likely to greatly improve the speed of the transactions. The nature of Casper’s blockchain allows for block times to be much lower than are traditionally the case with PoW algorithms.
This is because the validators will not be paid a reward for solving a block but will only earn transaction fees. As such, they are incentivised to increase the Gas limit on the blocks. However, these validators who can handle increased server loads will need to still take into account the other validators who may not be able to keep up.
As we mentioned above, when the slower validators fall out of sync the individual reward to the miners of clearing blocks is reduced. Hence the validators will only increase the block size limit in controlled manner.
With POW mining, the miners will usually purchase much more hardware in order to give them an edge in the calculations. When it comes to POS like the Casper framework, the servers will just need to handle more transactions. They will then have an incentive to invest in more processing power.
Transactions speeds are also slightly faster as POS allows for the use of light-client software. Unlike with POW, there is no need to download block headers to validate and secure transactions. The validators on the network have taken a lot of the consensus overhead involved.
Impact of System Crashes & Splits
The Casper protocol is still able to work even if the whole network crashes and most nodes go offline. All that is needed is one bonded validator to still be online making bets and producing blocks on their own. Obviously more participants increase rewards but an active validator is still incentivised to produce blocks for a lower reward than for nothing at all.
The Casper POS protocol also allows for a recovery from network partitions or splits. If there was ever a split in the network, Casper will execute those transactions that received bets on the partition that had the highest level of participation. Once there is a reconnection, the validators will return and finalize the blocks on the partition with more validator participation.
Theory vs. Practice
As of now, the Casper POS protocol is still a theoretical construct and is yet to be rolled out by the Ethereum foundation. When the foundation finally releases the Metropolis hard fork, they are laying some of the ground work for the eventual move to a POS algorithm.
Although there is no doubt that POS mining will be more cost effective and faster, there are many that have the view that it is not necessarily as safe as POW. This is because for a nefarious actor to attack a PoW protocol they will have to invest a considerable amount of money. By some calculations the amount that would be needed is more than they would be able to steal.
POS, on the other hand is merely an algorithm and as such needs to be 100% bulletproof if it is to succeed. This is because unless there are considerably penalties to attack the network, a POS attack would be cheaper and more rewarding if it succeeded.
The Casper protocol aims to bridge that gap and create significant costs for any of the validators to attack the network. Moreover, a POS protocol such as Casper will mean that the infamous 51% attack could not occur. If a bad actor was trying to buy up 51% of the coins then it would push up the price. According to Vitalik Buterin
Economic finality is accomplished in Casper by requiring validators to submit deposits to participate, and taking away their deposits if the protocol determines that they acted in some way that violates some set of rules (‘slashing conditions’)