Friendly Casper - how to achieve consensus and solve the problem of trust in distributed computing systems
Casper protocol - how to achieve consensus and solve the problem of trust
This is the graph of the trust network in the Casper protocol, which is responsible for the reliability of data and calculations in the blockchain project "RChain". The core of its developers lives in Seattle, but in RChain.coop cooperative there are developers from Asia, Africa and Europe. This text is based on a post by one of the project’s leading developers, Michael Birch, on the Casper consensus protocol.
The audience of Habr, for sure, is familiar with the protocols that provide consensus and allow you to decide which data you can trust and which you don’t. More detailed explanations of the problem and its solutions can be found in the presentation of one of the key developers on the Ethereum platform Vlad Zamfir and other lectures .
Introduction to Casper Protocol
On the RChain blockchain, consensus arises due to the Casper protocol, which was created using the pi-algebra of computational processes. This approach to programming gives protocol several useful properties.
The consensus does not occur over the blockchain, as in Ethereum, but over the directional acyclic block graph (blockDAQ). This means that a unit may have several parents and several children. Thanks to this structure, it is easier to combine independent branches into one, which reduces the time required to reach a consensus.
The network has the concept of political capital (PC), which validators possess, developing it for honest execution of operations. The volume of the PC that the validator decides to put (to bet) on this block depends on its weight, which is determined according to the rule of choice of the GHOST fork. Validators can not only create new blocks and vote for them, but also confirm old ones. The confirmation procedure does not depend on the GHOST rule and therefore validators have a more weighty voice regarding which branch of the block graph should be continued further. Block recognition is the only way to make a PC. This is a very important difference from other protocols. This leads to the fact that the only way to create new blocks in such a system is to join the branch that has been participating in the consensus process for the longest. The GIF shows the operation of the three validator nodes of the RChain network. The colored circles denote blocks in the blockDAQ, the color depends on which node created them. The only orange dot at the beginning is the genesis block. The diameter of the circle depends on the number of transactions in the block and the number of contracts that are executed in this block. The smallest circles denote blocks in which there are no contracts and which consist only of evidence. Arrows point to parent blocks. The red arrows correspond to the edges of the main NAG, which is determined by the GHOST rule, and the black arrows indicate the branches that were or will be discarded.
RChain node version 0.3 can be downloaded at github 'e. The launch of the first version of the blockchain is scheduled for the end of this year: see the timeline "Flight to Mercury" . The contracts launched in such a network are written in the language of Po .