Lesson 4: "Proof of Work" Understanding the consensus building mechanism

我为什么要上这堂课?

In this lesson, we will learn about the Proof of Work that underpins the blockchain, which will help us understand why the blockchain is so difficult to tamper with. It is a bit difficult to understand, but let's take our time to learn it.

在本课中,你将学习到什么?

  • About Proof of Work
  • Consensus building mechanism using Proof of Work (consensus algorithm)
  • Mechanism for adjusting the difficulty of consensus building (Difficulty)

Proof of Work

Following the timestamp server, the second mechanism for realizing Bitcoin is Proof of Work (PoW).

Many people mistakenly believe that PoW is a completely new mechanism that was created along with the blockchain, but the technology was originally developed to prevent spam mail, and was created in 1993.


PoW is the process of reverse engineering a hash function.

In order to prevent spam mail, we developed a system that requires proof that the reverse calculation of the hash function has been performed when sending mail.

The idea is that since it takes a huge amount of time to reverse the hash function, it is not possible to send a large number of emails.

This mechanism is also known as HashCash.


In the case of Bitcoin, when each block of the blockchain is hashed, it is necessary to find a value that has a specified number of zeroes at the beginning of the generated hash value.


Each block in the blockchain contains various information that can be categorized into fixed values and variable values.

These variable values are called nonces (random numbers), and PoW in Bitcoin is the process of finding input values with leading zeros by changing these nonces.


When this PoW process is completed, the formation of a block in the blockchain is complete.

In addition, each block contains the hash value of the previous block.

Therefore, if you want to tamper with any block, you need to tamper with the data of all the blocks that are connected after that block.

This is the reason why blockchains are said to be difficult to tamper with.


检查您的课程进度

了解了本课的内容,
就点击 "检查 "按钮吧!

Consensus building mechanism through Proof of Work

PoWs can also be used to determine whose opinion is representative in decision making in an unspecified group.

In PoW, one participation right is assigned to each CPU.

This means that it is difficult to secure a large number of participation rights, and a truly fair decision-making process can be expected.


In this case, the chain with the highest amount of PoW computation will naturally be the longest chain.

This longest chain will be the representative of an unspecified group of people in the decision making process.

This is based on the idea that if the majority of CPUs are controlled by good nodes, then the chain will grow the fastest.


检查您的课程进度

了解了本课的内容,
就点击 "检查 "按钮吧!

Adjusting the difficulty of consensus building

The tamperability of a blockchain decreases exponentially with the number of blocks that follow a particular block. (The more blocks that follow, the more work is required to tamper with them.

In order to tamper with a block from a certain point in the past, it is necessary to recreate the block by PoWing all the blocks that follow it.

To tamper with a block from a certain point in the past, you need to recreate the block by re-writing all the blocks in the chain after that block.

This is because the longest chain will be the correct one.


We will learn briefly about the probability of this incorrect chain overtaking the correct one here.

PoWs are designed so that the difficulty of the PoW itself does not fluctuate due to Moore's Law improvements in hardware performance, or due to the increase or decrease in the number of participants in the PoW.

This is because if the difficulty level fluctuates, it is easy for a rogue chain to overtake a correct chain.

This difficulty level is called Difficulty, and it is automatically adjusted so that the number of blocks generated per hour remains constant.

If the number of blocks generated per hour increases, the difficulty of the PoW is increased, and if the number of blocks generated decreases, the difficulty of the PoW is decreased.


检查您的课程进度

了解了本课的内容,
就点击 "检查 "按钮吧!

Lesson 4: "Proof of Work" Understanding the consensus building mechanism

0%

0%

你还没有完成所有的课程。 在做测试之前,让我们先完成所有的测试吧!

点击下面的按钮,开始测试。