Casper, Son of GHOST

To some extent, Casper is the son of GHOST, or Greedy Heaviest Observed Subtree. Introduced to the Ethereum ecosystem in 2013, the protocol combats centralization. Fast blockchain networks create stale blocks, also known as orphan blocks; Ethereum refers to them as “uncles” to distinguish them from parent and child blocks.

Uncle blocks verify as valid, but the network discards them as a longer chain becomes dominant. If only the fastest, most powerful miners always win by creating the longest chain, centralization would creep into the network. Consequently, Ethereum chooses to reward the creation of uncles so that more nodes than just the most powerful have a say in the building of the chain. For more detail on the GHOST protocol, see this explanation: What is the GHOST protocol for Ethereum?

Consensus Protocols that Go Bump in the Night

Blockchains document an immutable record of truth, so adding a new block with a minimum potential for shenanigans becomes paramount. Consensus protocols determine how the chain adds blocks. Proof of Work (PoW) and Proof of Stake (PoS) are the most common consensus protocols. In PoW, miners add blocks to a chain by solving a computational puzzle which wins a contest against other miners.

Miners with faster, more powerful hardware have an advantage. This erodes decentralization of the network and open security vulnerabilities to be exploited. PoS utilizes game theory concepts to create incentives for good behavior and minimize bad behavior. Rather than miners competing against each other, PoS provides validators who post a deposit (a stake) for authority to propose blocks to add. If the validator misbehaves, punishment ensues and his deposit gets slashed.

PoW consumes a large amount of electricity in practice. Also, miners want to buy the most powerful hardware possible to maximize their chance of winning the contest. PoS implementations reduce or potentially eliminate restrictive hardware and energy costs.

The Shift from the Graveyard

The Casper protocol is a PoS algorithm for Ethereum. A validator deposits a stake into a smart contract. He then runs a node to participate in the consensus algorithm to propose new blocks to the chain. This keeps the network running. Casper the Friendly Finality Gadget (CFFG) finalizes the blocks to the chain. Validators receive rewards for behaving correctly, but the system slashes deposits of a validator acts badly.

Casper provides accountability by detecting violations, knowing which validators violated the rules, and punishing those violators. It also provides a safe process for new validators to enter the system and existing validators to leave the system. Security defenses are integral to Casper.

Casper exists as an independent module and lives on top of a proposal mechanism. For Ethereum, the current underlying proposal mechanism is PoW. The first iteration of Casper will sit on top of Ethereum’s existing PoW consensus mechanism. This will make it a hybrid PoW/PoS system. The underlying PoW mechanism lends itself to upgrad to something else in the future. Some form of round-robin approach may replace the PoW component.

What Was That Creaking Sound?

From a security perspective, it is also true that as a modular overlay, if attackers compromise or corrupt the block proposal mechanism underneath it, then Casper is powerless. As long as Casper continues to receive valid and reasonable inputs from the proposal mechanism, it would continue to function as normal.
The security of PoS is based on game theoretical concepts of rewards and punishments.

As such, security derives from the size of the deposits validators entrust to the system. Risk equals reward. If a dishonest validator sees an opportunity to steal 5 ether, but it will cost him 100 ether out of his deposit, honest behavior ensues. Conversely, if a dishonest validator sees an opportunity to steal 100 ether, but will only 5 ether slashes out of his deposit, he will likely just see it as the cost of doing business.

The Rattling of Chains

As a network mechanism, Casper must ensure the integrity of the blockchain and must always be in operation.

“Accountable safety” and “plausible liveness” define two fundamental properties of Casper. Accountable safety prevents two conflicting checkpoints from being finalized unless at least 1/3 of validators violate the rules. Plausible liveness guarantees that it will always be possible to finalize a new checkpoint without any validator violating any rules if at least 2/3 of validators follow the protocol.

In standard PoW designs, the longest chain is always definitive. Casper is more complex and edge cases exist where simply going with the longest chain would be harmful. Consequently, Casper implements more complex logic that looks at root nodes of the tree of checkpoints and chooses the longest chain meeting that criteria.

Whistling Past the Blockchain Yard

Casper depends on game theory, and development of the protocol is heavily dependent on research and mathematics. It is a complex system of many details. On November 15, 2017, Vitalik Buterin and Virgil Griffith published technical details on the system in a paper entitled “Casper The Friendly Finality Gadget”, which can be found here: Casper The Friendly Finality Gadget

An undated and apparently earlier document utilizing the same title but containing very different content and authored solely by Vitalik Buterin resides on Vitalik’s own website. This document covers some of the other potential security exploits Casper would mitigate and can be found here: Casper The Friendly Finality Gadget

Do You Have Any Last Words?

The PoW consensus algorithm succeeded. Blocks insert into the chain, and users trust the resulting chain to be accurate. However, the process is slow, consumes a lot of electricity, and to be competitive miners need to invest in powerful hardware. Casper’s PoS approach utilizes game theory to alleviate these problems and ensure security.

Casper may encounter some bumps in the night, but with the flexibility of being a modular overlay mechanism, fixing problems and coding enhancements are simplified. At a minimum, Casper provides innovative thinking based on research and mathematics and will likely provide ideas for further innovation.