2 Minutes: The minimalist introductory course of consensus and the forks
What is consensus?
The consensus is essential in a decentralized system, and without consensus, a decentralized system cannot function.
But in a centralized system, consensus is not required. There are only two roles in a centralized system: the command (the controlling end) and the executor (the controlled end), which are one-to-one or one-to-many.
The one-to-one relationships, for example: using a remote control to control a TV, or using a mouse to control a computer.
The one-to-many relationships, for example: in the 1990's, there was a beeper-herding of sheep. Put a beeper on the neck of each head of the flock, and if the shepherd sends a message to the beeper, All the sheep will be returned by the head of the sheep. But the sheep leader could only recognize the vibration of the beeper, not its contents. If someone else knows the number of the beeper and sends a message to it, the beeper can also vibrate to control the flock.
In a centralized system, the controlled end trusts the control end and must execute instructions from the control end unless it is broken. But in a decentralized system, there is no command and no executor. All nodes are equal and operate according to predetermined mechanisms known as consensus.
Let’s go back to the example of herding sheep, if the sheep are not managed by one shepherd, but by five shepherds.There was a vote when five shepherds debated whether the sheep should go home.If three agree and two disagree, the minority is subordinate to the majority.The group of shepherds agreed to let the sheep go home.This consensus is outside the system.
If the beeper is modified, 5 instructions should be received each time,1 represents going home, 0 represents not going home, then the beeper will judge whether it vibrates or not according to the proportion. Five shepherds started sending messages, three told the sheep to go home, two told the sheep not to go home, and the beeper received three 1 and two 0. According to the rules, the beeper vibrates and the sheep go home. This is the consensus within the system, which multiple parties agree on a rule or proposal.
The consensus in blockchain is to decide who has the billing power and verify whether the billing is valid according to a set of rules. The consensus can make the data of each node be the same, thus ensuring the consistency of the whole system. If there is a disagreement in the consensus, a bifurcation will be formed.
This is a simple example to explain the forks.
Now there is a blockchain running account composed of 3 nodes, each node has 1 running account, and there are 3 running accounts in total, the content is as follows:
The running account of node a:
On January 1, A transfers an apple to B,
On January 2, B transfers two apples to C.
Running account of node b:
On January 1,A transfers an apple to B,
On January 2,B transfers two apples to C.
Running account of node c:
On January 1,B transfers an apple to A,
On January 2,C transfers an apple to A.
In this example, the running accounts of node a and node b are the same, but they are different from node c. The blockchain must be consistent, or the new running account will not know which one to follow. If node a and node b are the same, the result of 2/3 is regarded as the final result. The data from node a and node b will eventually overwrite node c, then making the whole blockchain consistent.
What if node c still does not recognize a and b?
Node c can invite new nodes d and e to make the running account of d and e consistent with itself. In this way, the new system has 5 nodes, and 3/5 is larger than 2/5, thus achieving the new consistency. Or node c bribed node b, and the data of node b is changed to be consistent with node c.
In this way, a fork is formed. In the bifurcated blockchain, on January 1, B transfers an apple to A. And before it forks, A transfers an apple to B. It can be seen that the power of bifurcation comes from interests.
To avoid malicious bifurcation, consensus needs to be supported by secure encryption algorithms and constrained by reasonable economic models.
After the above description, we believe that we can have a new understanding of the consensus.
Thank you again for supporting us! We always appreciates your support and company.
‘Till next time.
— Join the Jura community to stay updated with the latest news:
· Get on our Telegram channel
· Follow us on Twitter, LinkedIn, and Reddit
· Read weekly articles on the Jura medium channel
· Telegram community in 한국 and Tiếng Việt,
· Instagram: juranetwork