Power, speed, and a ghost named Casper

The two most popular blockchain platforms, Bitcoin and Ethereum, are slow and expensive. The latest estimate from digiconomist.net shows that the rate at which Bitcoin alone consumes electricity is equivalent to the amount required to power 6,012,845 US households, or to put that another way, the US State of Missouri.

Bitcoin and Ethereum currently use a method called Proof of Work (PoW) to determine who writes the next block to the blockchain. It’s a competition with a financial reward. Each block is a new race and the first past the post wins the prize. It’s fair to say that what started out resembling a small track meet is now like all the races in the world taking place at the same time, continuously.

In the early days of Bitcoin, independent Miners were competing against each other using standard equipment. As the value and liquidity of cryptocurrencies increased a whole industry sprang up. Hardware known as ASIC’s (Application Specific Integrated Circuits) became available for mining, and dedicated facilities sprang up in areas of the world with cheap electricity. Mining pools emerged that enabled Miners to combine their resources and share the spoils. In short, Crypto Mining became a big business.

The creation of Mining pools undermines PoW. The process was deliberately costly and time-consuming. It was intended to make the odds of the same person creating two concurrent blocks almost impossible. However, mining pools mean that there is a significant chance of the same pool generating multiple concurrent blocks. This is why there is justifiable concern over the fact that four mining pools control 59.2% of the bitcoin mining nodes and as a result have the potential to orchestrate a 51% attack.

PoW is not just expensive, it’s slow. When combined with Ethereum’s underlying architecture, it’s really slow. As networks like Ethereum become more popular and increasingly congested, the cost of getting your transaction processed in a reasonable time increases. The people willing to pay the most get preferential service — this conflicts with ethos of blockchain technology as being a tool for everyone. Don’t blame the Miners, this is a technology issue.

Blockchain platforms need to be faster, more scalable, and have predictable costs. In order to accomplish this, there need to be two fundamental changes. First, in order to increase performance, the underlying blockchain technology needs to be smart enough to understand that some transactions have dependencies and some don’t. If two people leave work at the same time in two cars and are heading to two different destinations they don’t need to follow each other on the freeway. Second, the way we determine who writes the next block cannot continue to depend on thousands of machines competing, wasting huge amounts of computing resource and energy.

Rather than run a competition with a random winner, an alternative approach is to identify people who have something to lose from the blockchain not being maintained accurately and to enable them to vote on which is the next block to be added the chain. This approach is called Proof of Stake (PoS) and right now it offers the most viable alternative to Proof of Work.

Individuals who participate in a PoS implementation are called Validators. In order to become a Validator an individual needs to put up a Stake in the form of cryptocurrency which is deposited in a Smart Contract. This Stake underlines their commitment to maintaining an accurate blockchain.

There are two basic PoS models: Chain based and BFT-Style. Chain-based is where a Validator is randomly selected to create a block. The block must point to the previous block on the longest chain. BFT-Style (Byzantine Fault Tolerance) is where validators are randomly assigned the right to validate and propose a block. A voting process takes place with each validator voting on which block should be the next to be written to the chain. Votes are weighted based on the size of a users’ Stake. The system selects the block with the most votes as the next block in the chain. Validators are then rewarded proportionally to their stake.

So, what’s Casper?

Casper* is the name given to a Project that has created two protocols that each define a specific implementation of Proof of Stake: Casper FFG (Friendly Finality Gadget) and Casper CBC (Correct by Construction). At some point in the future, it’s expected that they will come together to form one Casper protocol.

Casper FFG can best be described as a hybrid PoW/PoS consensus mechanism. This has been designed to act as a bridge for the Ethereum platform as it migrates from PoW to PoS.

Casper CBC uses the correct-by-construction (CBC) protocol. This means the solution has been modeled mathematically to ensure that all of the required functionality will be delivered and the correct behavior exhibited.

With Vitalik Buterin playing a key role in the design, Casper is currently closely associated with Ethereum. Newer blockchain platforms such as RChain are implementing their own version of the Casper protocol based on Casper CBC.

Proof of Stake is not perfect. Consider the scenario where we have a branch in the chain. With a PoW implementation the longest chain always wins, but with a simple implementation of Proof of Stake, a validator could place a Stake, often called a ‘Bet’, on blocks in both branches. This is called the “Nothing at Stake” problem as there is no penalty for betting on two outcomes. Casper forces a Validator to choose by punishing malicious behavior such as betting on two competing blocks.

Punishment takes the form of the ‘Bet’ being kept by the system. This is called Slashing and a comprehensive set of rules has been defined for Casper. It’s likely that implementations of Casper not running on Ethereum will define their own Slashing rules.

Challenges with Casper

For new platforms built on PoS, it brings an immediate reduction in energy consumption and huge potential for performance improvements over existing platforms. But it’s not without its challenges.

The most common issue raised with PoS is that weighted voting favors those with wealth. The more you can afford to risk the more you can potentially earn, and the greater say you have in which Block is written next.

The goal of Slashing is to penalize bad actors, but determining what is malicious and what is not is no simple task. With potential Slashing conditions including metrics such as “Number of blocks validated”, slower hardware could be penalized as pools of high-performance machines raise the productivity bar. Uptime can also be a factor.

Whereas new platforms like RChain can launch with a PoS model, Ethereum has Miners who are invested in the current process. The complexity of moving from PoW to PoS cannot be overstated. This is a fundamental change to how their platform works. Think of it like changing the engine on a $77B car in the middle of a race. It’s expected that Ethereum will launch Casper FFG soon, which will mean that PoW mining will continue but every 50th Block will be a PoS checkpoint. In the short term, this means no performance increase or reduction in energy consumption, but it does reduce the risk of a 51% attack. Being a Trailblazer comes at a cost**.

Finally, Casper will require validators to hold onto significant amounts of Cryptocurrency in order to have a Stake, which could affect the market price and liquidity of the associated cryptocurrency.

And finally, yes, Vitalik Buterin did name it Casper after the cartoon ghost.

* For completeness, GHOST (Greedy Heaviest Observed Subtree) is a chain selection method to ensure when there is a branch in the chain, all future mining is focused on the correct branch.

** As far as I know, Bitcoin has no plans to implement PoS.