In this article I will cover the two different proposed protocols for the implementation of Proof of Stake in Ethereum,
Casper FFG (Friendly Finality Gadget) spear headed by Vitalic
Casper CGC (Correct by Construction) spear headed by Vlad Zamfir
Casper FFG as is a hybrid approach. It focuses more on a multi-step transition to introducing POS for the Ethereum network. The full paper can be accessed from the following link.
Casper FFT is a Byzantine fault tolerant (BFT) based proof of stake. A Byzantine system have been proven mathematically that as long as 2/3 of the participants are following the protocol honestly, then irrespective of the network stability a new block can be added to the blockchain.
In Casper FFG, blocks are still being mined with via POW (Proof of Work) however every 100th block there will be a POS check point where finality is being assessed by network validators.
What are validators and what is finality ?
In Proof of Stake miners are replaced by validators. The validator is staking money on the block that it thinks should be added to the chain. If the block gets appended, then they get a reward that is proportional to the bet that they placed on the block. If the validator acts in a malicious way and tries to validate the wrong block it will be punished by getting their stake slashed.
Finality is the process that on particular operation cannot be undone. In Casper FFT finality is provided by 2/3 of the validators making bets on the finalised blocks. As long as 2/3 of the validators are not malicious the system mathematically guarantees that the correct block is being added to the chain.
Casper FFG also introduces a new fork choice mechanism. Instead of choosing the longest chain. The protocol introduces the concept to follow the chain containing the justified checkpoint of the greatest height.
As we see from the diagram above. The correct chain is r->b1->b2->b3.
This section of the article is a simplification of the explainer page written by Vitalik on Casper CBC and his keynote at the Blockchain Connect Conference. The following are the slides for the presentation.
As with Casper FFG he have the concept of validators. A validator has to follow a fork choice rule that define which blocks form part of the correct chain. All the other validators reinforce the dominance of the correct chain and as with Casper FFG we have the concept of finality. Once blocks are finalized, they cannot be reverted. This is guaranteed as long as 3/4 of the validators follow the fork choice rule and don’t misbehave.
The fork choice rule is LMD Ghost which is based on the Ghost protocol.
In this fork choice rule instead of trying to find the longest chain, we inspect the tree of blocks from the genesis block and go up in the hierarchy of the tree and at every step we a have decision based on the support each block has.
So let’s assume that we have five validators A,B,C,D,E. Each validator has created a block at different time intervals.
In the blockchain we have a fork of two paths. A-B-D or A-B-C-E. To determine the correct path what we are interested in is the last block being created as this determines the support of the blocks by the validator. (Marked in blue)
Hierarchy in position 1. Block created by validator A . It has been validated by ABCDE so it has a weight of 5.
Hierarchy position 2. We have a block created by B. It has been validated by A,B,C,D,E. Node has a weight of 5
Hierarchy position 3. We have a fork with block created by validator D and block created by validator C. Block created by validator D is only validated by himself. It has a weight of 1. While block created by validator C is validated by block A,B,C.E having a weight of 4.
From this we can deduce that the correct chain (path) is A,B,C,E.
The nice thing about this protocol is that the minority can never beat the majority. If validator D continues to create block on the path A-B-D at a faster rate compared to the other validators that path will only be validated by the minority rendering such an attack useless. Rendering 51% attacker thats are present in POW protocols a thing of the past.
Important to note that by following these rules there is no way the validators can choose the wrong path unless they willingly doing so to perform an attack. All the validators have the knowledge to validate the correct chain. This provides us with the concept of finality.
Vitalic approach is simpler to integrate as it provides a hybrid between POW (Proof of Work) and POS (Proof of Stake). This will allow easy migration of the current Ethereum network to the final version of Casper that will likely draw learning from both FFG and CBC.
Hope you liked this article. Feel free to add me on Linkedin here or contact me on email on [email protected].