Consensus, Casper and Cryptoeconomics in 15 minutes or less

Consensus

Most public blockchains rely on nodes known as miners to process transactions into blocks, a task for which they earn rewards. The economic incentives are such that miners from around the globe race to include the next block in the chain, often producing competing blocks due to either network latency delaying message broadcasting or the presence of faulty nodes. When this happens, the blockchain network must decide on which block to include in the chain using a mechanism known as the consensus protocol.

PoW

Bitcoin used Proof of Work (PoW) in 2009 and it remains to this day the protocol of choice for most public blockchains. To produce a new block, nodes must solve a cryptographic puzzle in a compute-intensive trial-and-error game known as mining that only rewards the successful block producer.

  • Incentivise honest miners with block rewards for securing the network;
  • Increase the network token supply or inflation control;
  • Discourage attackers who can maximise their investment and skills with honest mining;
Image for post
Image for post
Source: Bitcoin.com

PoW Weaknesses

Satoshi Nakamoto predicted that PoW’s competitive reward mechanism would lead to the arrival of application-specific integrated circuits (ASICs) to mining but didn’t consider that economies of scale would favour geographical and political centralisation, resulting in a handful of wealthy investors collecting the majority of the 656250 BTC issued in 2017, worth north of 4B Euros today.

Image for post
Image for post
Source: bitcoin.it
Image for post
Image for post
Source: Bitcoin whitepaper

Ethereum’s PoW

Ethereum’s Ethash is a GPU-friendly PoW algorithm designed for ASICs resistance by cunningly requiring more RAM than manufacturers where soldering on their integrated chips back in 2015, knowing that the costs of replacing hardware would be discouraging for a number of years. As it happens, that number was “3” since the free market graced us with Bitmain’s E3 recently, an arrival that surprised no one but likely disappointed NVIDIA who made $289M from GPU mining in Q1 this year.

PoS

Peercoin introduced Proof of Stake (PoS) in 2012 with a design that combined PoW with PoS for added security, but with a token issuance model based on the individual balances meaning that those with more wealth received more block rewards. In PoS, the block producer role rotates among a set of accounts whose substantial economic stakes in the network grant them the right to append blocks to the chain.

Image for post
Image for post
Source: Cosmos.network

PoS Weaknesses

PoS chains can be vulnerable to bribery attacks if the block reward issuance and distribution cause a “tragedy of the commons” problem. When validators feel their vote alone cannot alter an outcome, they may see a small bribery as a risk-free opportunity to maximise their investments.

Image for post
Image for post
Source: Ethereum Foundation

Casper

Casper is the name for a family of PoS consensus protocols developed by the Ethereum Foundation (EF), with the first release dubbed the Friendly Finality Gadget (FFG) arriving on the mainnet later this year.

Image for post
Image for post
Source: Ethereum Foundation
  • Explicit cryptoeconomic mechanism-design to disincentivise censorship and prevent economies of scale;
  • Account safety so that only misbehaving validators get penalised;
  • Plausible liveness mechanism based on a minimal synchronicity assumption that nodes come on-line at least once every three months to avoid having their deposits slashed, meaning that unless one-third of validators are actively attacking the blockchain, there are always enough voters available to keep the blockchain safe;

FFG

FFG is a PoW / PoS hybrid that improves the cryptoeconomic security, network decentralisation and on-chain scalability of Ethereum by retaining PoW’s block creation mechanics and adding the PoS functionality and configuration as a smart-contract, reducing friction between the many client implementations which should result in a smooth upgrade process.

Finality

When a checkpoint (cb) is appended to the chain, it’s not immediately finalised but only justified because we can only guarantee that it was voted in by two-thirds of the validator set. In order for the checkpoint to be finalised, it needs another epoch with a succeeding checkpoint (cb+1) to be appended to the chain because the validator set is randomised between the two elections and the second vote establishes the consensus view that checkpoint cb is definitely in the canonical chain.

Image for post
Image for post
Source: Ethereum Foundation

Slashing

Slashing conditions occur when a validator breaks one of the protocol rules and attempts to sign two conflicting checkpoints either by double-voting or by surround voting. Validators that stay offline for more than three weeks at a time will also face partial slashing, a measure that encourages keeping an updated view of the chain and penalises under-performers.

Impact on issuance

Casper will use a balance of 1.25M ETH to attract validators who, for their service, will be paid a fractional return proportional to the total deposited amount at stake. With an estimated 10M ETH at stake, the yield would be 5% per year for up to two years, a far more egalitarian distribution than is possible with PoW.

Image for post
Image for post
https://gist.github.com/djrtwo/bc864c0d0a275170183803814b207b9a
Image for post
Image for post
https://eips.ethereum.org/EIPS/eip-1011
Image for post
Image for post
The Validator Slashing Trilemma proposed by Jon Choi: Defense, Rewards, Low issuance. Can’t Have it all

Cryptoeconomic security

The scheduled block-reward reduction should see the network hashrate drop linearly with miners progressively leaving for more profitable PoW blockchains . As of June 2018, the mainnet’s hashrate sits at around 275 Th/s so an 80% reduction puts us back at July 2017 levels.

Image for post
Image for post
http://etherscan.io/charts
Image for post
Image for post
Based on https://gist.github.com/djrtwo/bc864c0d0a275170183803814b207b9a
  • The fork-choice rule now favours the chain with most finalised checkpoints over the one with highest accumulated hashrate, meaning that a minority of miners can keep the canonical chain safe during the attack;
  • Validators have deposits at stake so they will not finalise blocks on the attacker’s chain and risk having their Ether irreversibly slashed;
  • Miners don’t receive rewards for working on shorter forks;
Image for post
Image for post
Credit: Jon Choi

TFG Casper

FFG is only the first step in Ethereum’s transition to full PoS that will likely come from the Correct-by-Construction (CBC) branch of research led by Vlad Zamfir. The Friendly Binary Consensus and The Friendly GHOST (TFG) are two such protocols that, although still in an early phase of development, already show some promise and highlight CBC’s novel framework for achieving consensus.

  1. “filling in the blanks” — defining implementations of data structures that satisfy the types and definitions required by the proof;
Image for post
Image for post
Credit: Kames CG
  • Decentralisation: how many consensus-forming nodes can exist in the network;
  • Resource Overhead: how many blocks per second do consensus-forming nodes need to verify;

Bonus Content

Jon Choi’s presentation Cryptoeconomics in Casper

Thank you

Thank you for taking the time to read my article. If you enjoyed it and think there might be others who will like to read it too, please like, comment and share this article to help it reach a wider audience within your own network. I will reply to comments and questions posed here and maybe we can start some valuable discussions!

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store