Xiao Ming's study notes | Understand what mining pools do in one article

Xiao Ming's study notes | Understand what mining pools do in one article

Editor's note: Blockchain involves many technologies, from the Internet's bottom layer to the mysterious cryptography, but there are often more people who pay attention to the price of the currency and fewer people who study the technology. In the bull market, everyone will study hard to speculate in the currency. In the bear market, there is nothing to do anyway, so I think I can study harder. As a liberal arts student, of course I have many questions that science students think are stupid. As a reporter, it is not difficult for me to find people in the industry who understand it to explain it to me in human language, and they often don't dislike me to my face.

This is the sixth issue of Xiao Ming’s study notes. If you have other interesting questions, you are welcome to submit and ask questions.

---------This is a gorgeous text dividing line---------

Looking back, Xiao Ming's study notes have changed from weekly to monthly updates, and this one can be said to be a quarterly update from the last one. Since my current job is mainly editing, I usually take reporters out for interviews and write articles, and rarely write articles alone, so the update of study notes is probably endless.

This issue is about mining pools. First of all, I would like to thank Xie Rui, the core developer of xDAG. He is also the designer of the xDAG official mining software. He taught me a lot of knowledge in this area years ago.

I first learned about this industry when I interviewed ViaBTC in 2017. At that time, Yang Haipo summarized that mining pools are like alliances of miners, bringing everyone together to mine. This is indeed a very essential and popular explanation of mining pools.

We all know that the PoW consensus mechanism that was born with Bitcoin is essentially a random number collision in the mining process. Whoever guesses the random number correctly can obtain the right to record and become the block producer of this round. Because it is a random guess, the more times you guess per unit time, the greater the probability of guessing correctly.

With the emergence of professional mining machines and other equipment, the mining power of Bitcoin, Litecoin and other currencies has increased. Most miners have difficulty mining coins by mining alone, so mining pools have emerged. Mining pools are like an alliance, which brings together these scattered miners or even mining farms to mine together and gives miners income according to the proportion of computing power. This can not only increase the probability of mining coins, but also stabilize the income of miners. At the same time, the technology provided by mining pools is also conducive to reducing mining efficiency.

What tasks does the mining pool assign to miners?

Shenyu also once concluded that mining pools are actually assigning tasks to everyone. However, I want to know more details, that is, what are the miners calculating? How do mining pools assign tasks?

The article "A Brief Discussion on Mining Pools and Mining Farms (Mining Pools)" gives an example to illustrate the mining process: "The mining pool divides the block difficulty into many smaller tasks and assigns them to miners for calculation. After the miners complete a task, they submit the result to the mining pool, which is called submitting a share. Assuming that the network difficulty requires the value of n to be 100, that is, the first 100 bits are 0, the mining pool may assign a task to the miner, requiring the first 30 bits to be 0, and then look for the target value whose first 100 bits happen to be 0 from all the submitted tasks."

Xie Rui told me that, in theory, there are two ways for mining pools to assign tasks to miners:

The first type is that the mining pool is just a node, and the miners are still the ones who package the transactions. The mining pool will give the complete information of the task to the miners, who package the transactions and then broadcast them. The miners know the complete information, but they need to fill in more information, and the signature is also signed by the miners.

The second type of mining pool node directly packages and gives the miner the intermediate state of the result, or incomplete information. The miner fills in what he needs to fill in. The final combination of the block is done by the mining pool. The miner sends the nonce to the mining pool, and the signature is the mining pool.

“The only thing that won’t change is the way you synchronize your data with the mining pool.”

After reading the above two methods, it is obvious that most commercial mining pools will choose the second method, and the distribution of mining income is based on signatures. If I am both a miner and a mining pool owner, there is no difference between the two methods, so I can choose the first method.

You may be a little confused when you see the nonce value mentioned above. This is actually the random number that we often say will collide during the PoW process, which will be explained below.

According to the book "Mastering Bitcoin", the goal of mining is to find a nonce that makes the block header hash value less than the difficulty target. The premise is that the selected transaction has been determined. At this point, we need to learn about the Bitcoin block header structure.

The table is from "Mastering Bitcoin"

In the block header, there are basically two things that mining nodes can change: transactions and nonce. Since the goal of mining is to make the block header hash value less than the target, the whole process is basically: determine the transaction you want to package and form the corresponding merkle tree root - guess a nonce - put the nonce in the block header and hash it - to know whether it is less than the target hash value, that is, greater than the target difficulty.

So, basically, the transaction and nonce you choose will not help you "predict" the final hash value (a large nonce value does not necessarily mean that the block header hash value will increase or decrease). You can only guess at every step. Others may guess it right once, but you have guessed it tens of thousands of times and still haven't guessed it right. The only thing you can do is to guess more times than others at the same time. This is what the miners do - concentrate all their energy on doing one thing.

Let’s talk about the anti-AISC properties of mining machines

Speaking of mining machines, I asked if there really is an ASIC-resistant algorithm. Xie Rui generally believes that there is no ASIC-resistant algorithm, but different algorithms will make the cost of manufacturing ASIC mining machines higher.

Any PoW currency will have a set of mining algorithms/software, and ASIC chips burn this software into circuits. The earliest chips were all dedicated, such as radio chips that could only do radio things. FPGA (Field Programmable Gate Array) is a programmable array. By applying voltage to the silicon chip, an AND gate can become a NOT gate. This type of chip has a wider range of applications. First of all, the cost is higher than ASIC; and in order to be more versatile, there is still redundancy and it is not as efficient as ASIC. So now everyone will design on a computer, design on an FPGA, and then burn ASIC. By analogy, GPUs and even CPUs can do more types of calculations. If you want to know why FPGAs are more efficient than CPUs and GPUs, you can refer to this article.

Why is there redundancy? Let me give you a hypothetical example (not accurate but helpful for understanding), for example, 5+5, FPGA may not have the concept of 5, so it has to be 1+1+1+1+1, while ASIC can directly calculate 5+5. This reminds me of what Wang Jiaping said in an interview with Odaily Planet Daily: In the computer field, flexibility/versatility and efficiency are often in conflict.

"The strongest point of ASIC is parallel computing, while FPGA is slightly inferior. In fact, there is no anti-ASIC in essence, it can only make each step of the reverse push more difficult, such as requiring things to be calculated in memory, such as calculating variance, and putting every data in memory. From GPU to FPGA to ASIC, the memory chip required by (ASIC) may be 100 times that of GPU. (Whether to develop an ASIC mining machine for a certain currency) only depends on the cost and benefit." In layman's terms, it can be understood that developing an ASIC mining machine for Ethereum is more difficult than developing an ASIC mining machine for Bitcoin, and the chips developed in the same time are not significantly improved compared to ordinary CPU/GPU. Bitcoin may have increased by thousands of times, and Ethereum may have increased by several to dozens of times, which is not worthwhile.

Similar analysis can also be found in public information, such as this passage from Erduo Finance:

“Ethereum uses the Ethash algorithm, formerly known as the Dagger algorithm (invented by Vitailk), which is designed to resist ASIC miners. How to resist ASIC miners? By bundling mining with memory bandwidth, that is, reducing the computing advantages of other hardware, the concept of mining equipment equality is achieved.

The Ethash algorithm did not prevent the emergence of ASIC mining machines, but only delayed their emergence.

Binding memory bandwidth means that computing power can be increased by increasing the memory bandwidth speed, or power consumption can be reduced at the same memory bandwidth speed. However, the current memory bandwidth price is too high and the ETH price is too low. Considering the cost, ASIC mining machines are not cost-effective compared to GPUs.

Litecoin uses the scrypt algorithm invented by cryptographer and programmer Colin Percival in his 2009 paper Stronger Key Derivation via Sequential Memory-hard Functions. The principle is similar to that of Ethash, both of which increase the cost of memory usage during mining and delay the emergence of ASIC mining machines.

In 2014, Zeusminer developed an ASIC mining machine specifically for the scrypt algorithm. This also shows that it is impossible to completely eliminate ASIC mining machines by binding certain hardware (such as memory) to increase the cost of mining. "

Most of the current mining algorithms that claim to be ASIC-resistant bundle memory and computing.

Ethereum Chinese website also sorted out the mining efficiency growth multiples after deploying ASIC for different PoW algorithms:

SHA256: about 1000 times

Scrypt and NeoScrypt: about 1000 times

X11 and X16R: about 1000 times

Equihash: about 100 times

Cuckoo Cycle: about 100 times

CryptoNight About 50 times

Ethash: about 2 times

Mining pool profit distribution model

Finally, let’s briefly talk about the profit distribution model of mining pools. In fact, this has been explained in many articles. There are two main types of distribution models of mining pools:

The first is to divide the coins according to the actual block production situation: within a time period, the mining pool mines as many blocks as possible, and distributes the mining income (generally excluding handling fees) according to the computing power ratio.

The time period of this method is generally based on the time until the block is mined, that is, the profit is distributed according to the computing power distribution ratio within the time between two blocks are mined; it can also be settled every day. If your mining pool has several blocks, the profit of the day will be very high. If the mining pool does not mine any blocks in a day, then no one will get any profit today. This is called PPLNS (Pay Per Last N Shares).

The second method is to distribute coins according to theoretical value: within a time period (usually one day), the mining pool can theoretically obtain a certain amount of revenue, and miners are distributed money according to the proportion of computing power. This method is more stable than the previous one.

Let's use an example from this article: If you provide 1 T computing power to a mining pool in a certain 10 minutes, the mining pool's computing power is 100 T, the total computing power of the entire network is 1000 T, the Bitcoin network produces a block every 10 minutes on average, and the block reward is 12.5 BTC. The mining pool accounts for one-tenth of the total computing power of the entire network, and the expected value of the mining pool's income is 1.25 BTC. Your computing power accounts for one percent of the mining pool's computing power. Regardless of whether the mining pool mines a block, your income is a theoretical income of 1.25 BTC. This is called PPS (Pay Per Share). Because the mining pool bears the risk in the PPS mode, the fee ratio will be higher.

At this point, I have covered the basic knowledge of mining pools. I suddenly remembered that I read an article recently (I interviewed before the New Year...) and saw that the empty block rate of Ethereum has increased a lot. I asked why mining pools mine empty blocks, and the answer I got was to save time: "The benefit of mining empty blocks is that you don't need to synchronize data or download, and it is faster to upload. (However) producing too many blocks in a short period of time will increase the difficulty."

If you want to know more details, you can refer to the article "Science Popularization | What is an empty block? Why do miners mine empty blocks?":

“The only advantage of the empty block mining technology is that since an empty block only contains one piece of information, the empty block miner saves the time of ‘packaging’ a large amount of information. This allows the empty block miner to start mining the next block directly after mining this block.

If it is a large mining farm or even mining pool-level hardware, this operation only saves a few seconds, but the computing power of a large mining pool in a few seconds is millions per second, which is not an exaggeration at all.

Generally speaking, mining pools don’t like to mine empty blocks. After all, saving that little bit of time is not worth 6%~8% of the revenue.

Finally, there is the issue of blockchain network maintenance. If a large number of blocks become empty blocks, the information that needs to be transmitted cannot be circulated, which will also cause a major congestion in the blockchain network. The decline in blockchain network performance caused by the congestion may reduce the price of digital currency.

Currently, the empty block rate of Ethereum has increased, which may be related to the upcoming reduction in mining income. I want to mine more and store them while the reward for one block is still three Ethereums. "

<<:  What are the different types of 51% attacks?

>>:  Bitmain releases second-generation 7nm chip BM1397 with energy efficiency as low as 30J/T

Recommend

Are men with puffy eye bags unsuitable for early marriage?

Men with swollen bags under their eyes are suitab...

How to identify people: The color you like can teach you how to identify people

How to identify people: The color you like can te...

How to read the marriage line on your palm

Although the marriage line is not the main line i...

What does a short lifeline mean?

The lifeline is one of the three main lines on ou...

Palmistry shows who is not suitable for early marriage

Marriage is the destination of love. When is the ...

What does physiognomy mean when a woman has a mole on her right middle finger?

Generally speaking, it is less likely to grow mol...

DeFi fever subsides, NFT takes over? Ethereum is still the biggest winner

Source: Blockchain Frontier By Robert Stevens Tra...

What does the appearance of mouth corner lines mean?

Many people mistake wrinkles at the corners of th...

Several major aspects of people who always have no confidence in themselves

Many times, we say that some ideas should have a ...

What does the bifurcation of the wisdom line mean in palmistry?

In palmistry, the wisdom line is one of the three...

What does it mean if a woman has a mole on her cheekbone?

Is it a good fate for a woman with a mole on her ...

French central bank urges further blockchain research

Rage Commentary : The Financial Stability Board (...

What are the facial features of a woman who is destined to be childless?

Although the DINK family is very popular nowadays...

Is a crooked nose good or bad? See the fate of people with crooked noses

People with crooked noses have bad intentions. In...

Antminer S19 Series Sales Announcement

Spring Blossoms Finally, the launch information o...