Longest Chain Rule

7 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€93.30
List Price:  €130.62
You save:  €37.32
£79.79
List Price:  £111.72
You save:  £31.92
CA$136.51
List Price:  CA$191.13
You save:  CA$54.61
A$152.32
List Price:  A$213.26
You save:  A$60.93
S$135.97
List Price:  S$190.37
You save:  S$54.39
HK$782.61
List Price:  HK$1,095.68
You save:  HK$313.07
CHF 91.14
List Price:  CHF 127.60
You save:  CHF 36.46
NOK kr1,099.65
List Price:  NOK kr1,539.56
You save:  NOK kr439.90
DKK kr695.84
List Price:  DKK kr974.21
You save:  DKK kr278.36
NZ$167.38
List Price:  NZ$234.34
You save:  NZ$66.95
د.إ367.24
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,987.33
List Price:  ৳15,382.71
You save:  ৳4,395.37
₹8,345.51
List Price:  ₹11,684.05
You save:  ₹3,338.54
RM476.90
List Price:  RM667.68
You save:  RM190.78
₦132,499.74
List Price:  ₦185,504.94
You save:  ₦53,005.20
₨27,870.93
List Price:  ₨39,020.42
You save:  ₨11,149.48
฿3,701.15
List Price:  ฿5,181.76
You save:  ฿1,480.61
₺3,236.01
List Price:  ₺4,530.55
You save:  ₺1,294.53
B$511.64
List Price:  B$716.32
You save:  B$204.68
R1,874.13
List Price:  R2,623.86
You save:  R749.72
Лв182.50
List Price:  Лв255.51
You save:  Лв73
₩137,667.26
List Price:  ₩192,739.67
You save:  ₩55,072.41
₪376.30
List Price:  ₪526.84
You save:  ₪150.53
₱5,769.57
List Price:  ₱8,077.63
You save:  ₱2,308.05
¥15,587.34
List Price:  ¥21,822.90
You save:  ¥6,235.56
MX$1,712.57
List Price:  MX$2,397.67
You save:  MX$685.09
QR365.03
List Price:  QR511.06
You save:  QR146.02
P1,378.03
List Price:  P1,929.30
You save:  P551.26
KSh13,498.65
List Price:  KSh18,898.65
You save:  KSh5,400
E£4,784.52
List Price:  E£6,698.52
You save:  E£1,914
ብር5,745.61
List Price:  ብር8,044.09
You save:  ብር2,298.47
Kz83,397.65
List Price:  Kz116,760.05
You save:  Kz33,362.40
CLP$95,071.49
List Price:  CLP$133,103.89
You save:  CLP$38,032.40
CN¥724.13
List Price:  CN¥1,013.82
You save:  CN¥289.68
RD$5,869.02
List Price:  RD$8,216.87
You save:  RD$2,347.84
DA13,441.55
List Price:  DA18,818.71
You save:  DA5,377.16
FJ$225.51
List Price:  FJ$315.73
You save:  FJ$90.21
Q778.65
List Price:  Q1,090.14
You save:  Q311.49
GY$20,944.44
List Price:  GY$29,323.05
You save:  GY$8,378.61
ISK kr14,022.59
List Price:  ISK kr19,632.19
You save:  ISK kr5,609.60
DH1,011.24
List Price:  DH1,415.78
You save:  DH404.53
L1,769.74
List Price:  L2,477.71
You save:  L707.96
ден5,744.06
List Price:  ден8,041.92
You save:  ден2,297.85
MOP$807.26
List Price:  MOP$1,130.19
You save:  MOP$322.93
N$1,888.87
List Price:  N$2,644.49
You save:  N$755.62
C$3,684.35
List Price:  C$5,158.24
You save:  C$1,473.89
रु13,347.21
List Price:  रु18,686.63
You save:  रु5,339.41
S/376.08
List Price:  S/526.53
You save:  S/150.44
K386.44
List Price:  K541.04
You save:  K154.59
SAR375.02
List Price:  SAR525.05
You save:  SAR150.02
ZK2,652.95
List Price:  ZK3,714.24
You save:  ZK1,061.28
L464.20
List Price:  L649.90
You save:  L185.70
Kč2,348.23
List Price:  Kč3,287.62
You save:  Kč939.38
Ft36,571.12
List Price:  Ft51,201.04
You save:  Ft14,629.91
SEK kr1,091.69
List Price:  SEK kr1,528.41
You save:  SEK kr436.72
ARS$87,466.76
List Price:  ARS$122,456.97
You save:  ARS$34,990.20
Bs694.29
List Price:  Bs972.03
You save:  Bs277.74
COP$395,890.30
List Price:  COP$554,262.26
You save:  COP$158,371.95
₡50,869.89
List Price:  ₡71,219.89
You save:  ₡20,349.99
L2,472.19
List Price:  L3,461.17
You save:  L988.97
₲745,423.92
List Price:  ₲1,043,623.31
You save:  ₲298,199.38
$U3,863.50
List Price:  $U5,409.05
You save:  $U1,545.55
zł403.45
List Price:  zł564.85
You save:  zł161.39
Already have an account? Log In

Transcript

First, let's understand what a conflict in mining is. conflict in mining originates when multiple miners are working on the same block. Suppose two miners are working on the same block data and they can confirm the block within fraction of seconds to each other. Both the blocks get added to the blockchain and miners start working on the next block. In this type of situation where two miners have confirmed the same block, then the blockchain gets divided into two separate chains branching out from one single chain. This situation arises because both the blocks are coming in with similar type of information, timestamp and within the fraction of seconds.

This creates a significant problem for blockchain. We need to make sure that blockchain is only being formed as one single chain instead of forming multiple branch chains as this will lead to double spending and also expose blockchain for many sophisticated attacks. Most of the public chains like Bitcoin and aetherium work on the principle of the longest chain rule. longest chain rule states that all the miners will follow the chain with China's most work done upon at the time. What do we mean by most work done upon this means the chain which has the most difficulty or the chain for which the most hash calculations have been made, all the other chains will be dropped after some time, and unconfirmed transactions from those chains will be added back to the memory pool. Node prefers the first seen valid chain with the most work measured in terms equivalent to the sum of the difficulty of all the blocks.

If they see another chain apart from their current chain with more work, they will shift to that chain Let's see this conflict resolution and how things work with the help of an example. As you can see in the diagram, we have block one which is already confirmed over the blockchain in time period one. For the time period two, two miners were able to confirm the blocks in a fraction of seconds to each other, those dividing the chain into two branch chains. Both the blocks two and four have almost similar information and are confirmed in fraction of seconds. Now there might be a possibility that block two has been confirmed in America and block four has been established in Australia. The miners who are present near block two currently have the visibility of chain which is formed by block two.

They don't have the visibility of block four yet. Same is the case with the Australian miners who are seeing the chain with block for this scenario creators situation that other miners start working over the blocks. as per their visibility. One of the US miners is able to create block three after block two. On the other hand, miners near block four start building blocks after block four. The same scenario can take place after time period to where again two miners are able to confirm the blocks in fraction of seconds.

As you can see in the image, we have shown block seven and block eight being created after block four. So in this way, different miners are working on different chains and building the blocks as per their visibility. All these branch chains have some work done upon them by the miners. Now let's suppose that we have reached the stage of time period three, where we have block three, block seven and block eight. Now again, the miners in the US were able to see the block three and they started creating the block Five after that, similarly some other miners present in New Zealand saw the chain associated with block eight and begin building block nine after that later in the time period five and six, the complete blockchain Gods thing and every miner has the full visibility miners realize that the branch chain from the US has much more work done upon it all the miners shift from their branch chains to the US chain and start mining after block five they create two more blocks after block five which are block six and block 10.

Now this first chain forms the main chain for over network. In this way, the longest chain rule helps to maintain one single complete block chain. Now a new miner coming in at the time period seven will see all these processes and will only choose the chain which is most worked upon. He will take the chain which has the most difficulty and The most hash calculations, which is the first chain shown in this diagram. Moreover, blockchain will disregard the other side chains which have been formed and only take the chain which is most worked upon the blocks related to all other side chains will be disregarded and the transactions in the blocks will be reverted to the transaction pool. Only the transactions which are inside the main chain will be confirmed over the blockchain.

That's why it's typically said that whenever you mine a block over a Bitcoin blockchain, you have to at least wait for six blocks to pass before receiving the reward. This is because the average Network Time for Bitcoin blockchain is 17 minutes. The longest chain rule is in complete effect when the six blocks have passed. As we saw in the image, the longest chain rule is the conflict resolution protocol for public chains like Bitcoin and tedium. This longest chain rule is mainly responsible for maintaining a single chain throughout the system. If you again look back at over example, we demonstrated how the miners are choosing their chains to work upon, there will be a point of time in the network when there is only one single chain which is the most worked upon and all the other side chains will be discarded.

Miners will keep on adding the blocks only with the main chain. This was about the working principles of how the consensus and the longest chain rule works. In this section, we saw the consensus mechanism. The consensus mechanism discussed here is related to Byzantine fault tolerance, which is working with proof of work consensus algorithm. There are many more consensus algorithms in play, which are much more efficient than the proof of work consensus algorithm. In the next lecture, we are going to discuss Some of the consensus algorithms and we will also address some of the examples which are using those consensus algorithms.

We are hoping that you can now understand the complete working of the blockchain. If you have any queries feel free to contact us at info at the rate v2 blocks.com.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.