Note

If you are new to the blockchain technology, taking our Introduction to Blockchain Technology self-paced course is highly recommended. Also, for a comprehensive coverage of blockchain development in Ethereum or mastering Solidity programming, taking our below self paced courses is highly recommended:

Recap

In our previous article (How Sharding and Gasper work in Ethereum), we covered how Sharding and Gasper work in Ethereum

In this article, we learn how the Proof-of-Stack consensus is used in Ethereum.

PoS consensus in Ethereum

As we discussed our previous article, Ethereum Architecture and Ecosystem, Ethereum is shifting from a PoW-based consensus mechanism to PoS-based consensus mechanism, which will be implemented as part of the Casper work stream. However, there are two separate approaches proposed, Casper FFG and Casper CBC. Both will facilitate an Ethereum move to PoS, but the design philosophies behind both approaches are quite different.

Casper FFG, also known as Casper the friendly finality gadget, is a hybrid PoW and PoS consensus mechanism proposed by Vitalik. Just like the current implementation, it leverages a Stash-based PoW mechanism to create new blocks. On top of the PoW-based chains, it leverages a pool of PoS validators to check the finality of the blocks periodically, typically every 50 or 100 blocks, called one epoch.

Validators stake their ethers on the network. They get rewarded with new ether if they successfully check the finality, or get penalized otherwise. As depicted here, once one epoch of blocks is created, a validator will be selected out of a validator pool and will start assessing the finality of all blocks in the current epoch on the blockchain:

Ethereum blockchain development

 

One of issues with PoS consensus, at least theoretically, is that nothing is at stake. The doubt about PoS is that the stake alone won’t deter the bad behavior. For example, in the case of a potential temporary fork, validators could potentially build on both sides of the fork, and make the temporary fork forever, since they will collect a transaction fee no matter if they win or lose. This also makes the finality issue even worse.

Casper CBC proposed by Vlad Zamfir, also called the Friendly GHOST Correct-by- Construction is a protocol designed to address the finality and nothing-at-stake issue. The theory behind this is that validators can make a decision about which path to build new blocks on, based on the messages they’ve seen from other nodes:

  • The message includes the sender or the validator, the blocks where it arrives, and the justifications.
  • It can provide knowledge regarding how other validators reach a decision on the latest blocks.
  • If two messages are sent by the same validator with no knowledge links between them, it is considered as invalid, and the validator will be penalized with the stake.

 

Both Casper FFG and Casper CBC are active work streams in the Ethereum community. The final PoS implementation in Casper may depend on how each one works out. Casper FFG probably is the one to give you a taste of the PoS consensus mechanism in Ethereum, and CBC will give us a pure PoS implementation with a finality safety guarantee. One of the planned phases in the Ethereum 2.0 roadmap, the PoS beacon chain with sharding, will implement the PoS consensus mechanism on the beacon chain as an overlay to the Ethereum main chain and leverage Casper FFG for block finality.

 

Next Article

In our next article (A roadmap for Implementing Ethereum 2.0), we discuss the roadmap for implementing version 2 of Ethereum.

This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.

Resources

Free Webinars on Blockchain

Here is the list of our free webinars that are highly recommended:

 

Free Courses

Here is the list of our 10 free self-paced courses that are highly recommended:

 

Self-Paced Blockchain Courses

If you like to learn more about Hyperledger Fabric, Hyperledger Sawtooth, Ethereum or Corda, taking the following self-paced classes is highly recommended:

  1. Intro to Blockchain Technology
  2. Blockchain Management in Hyperledger for System Admins
  3. Hyperledger Fabric for Developers
  4. Intro to Blockchain Cybersecurity
  5. Learn Solidity Programming by Examples
  6. Introduction to Ethereum Blockchain Development
  7. Learn Blockchain Dev with Corda R3
  8. Intro to Hyperledger Sawtooth for System Admins

 

Live Blockchain Courses

If you want to master Hyperledger Fabric, Ethereum or Corda, taking the following live classes is highly recommended:

 

Articles and Tutorials on Blockchain Technology

If you like to learn more about blockchain technology and how it works, reading the following articles is highly recommended:

 

Articles and Tutorials on Ethereum and Solidity

If you like to learn more about blockchain development in Ethereum with Solidity, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Hyperledger Family

If you like to learn more about blockchain development with Hyperledger, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on R3 Corda

If you like to learn more about blockchain development on Corda , reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Other Blockchain Platforms

If you like to learn more about blockchain development in other platforms, reading the following articles and tutorials is highly recommended: