
Editor's note: Blockchain involves many technologies, from the bottom layer of the Internet to the unknown cryptography, but there are often many people who pay attention to currency prices and few people who study technology. During the bull market, everyone will study hard to speculate in coins. During the bear market, there is nothing to do anyway, so I think we can study harder. As a liberal arts student, I certainly have a lot of questions that science students seem to think are idiotic. As a reporter, it is not difficult for me to find people who understand the industry to explain to me in human terms, and they often do not dislike me face to face.
This is the sixth issue of Xiao Ming's study notes. If you have other interesting questions, please contribute and ask questions.
---------This is a gorgeous text dividing line---------
Looking back on the past, Xiaoming's study notes have changed from weekly to monthly, and this one can be said to be a quarterly change from the previous one. Since my current job is mainly editing, I usually take reporters out to interview and write manuscripts, and rarely write manuscripts by myself, so the update of study notes is estimated to be endless.
What I want to share in this issue is the mining pool. First of all, I would like to thank Xie Rui, the core developer of xDAG. He is also the designer of xDAG’s official mining software. He gave me a lot of knowledge in this area years ago.
I first learned about this industry inInterview with ViaBTC in 2017For Weibit, Yang Haipo concluded at the time that the mining pool is like an alliance of miners, bringing everyone together to mine. This is indeed a very essential and popular explanation for mining pools.
We all know that the PoW consensus mechanism born with Bitcoin, the essence of its mining process is to do random number collision, whoever guesses the random number can get the bookkeeping right and become the block producer of this round . Because it is random guessing, the more guesses 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 in the entire network has increased. It is difficult for most miners to mine coins by their own solo mining, and mining pools have emerged as the times require. The mining pool is like an alliance, which gathers these scattered miners and even mines to mine together, and gives the 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 minerssecondary title
What tasks does the mining pool give to the miners?
Shenyu also concluded that the mining pool is actually assigning tasks to everyone. However, I want to know more details, that is, what are the miners doing? How does the mining pool allocate tasks?
"Talking about Mining Pools and Mining Farms (Mine Pools)"This article gives an example to illustrate the mining process: "The mining pool divides the difficulty of the block into many tasks with less difficulty and sends them to the 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 difficulty of the entire network 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 miners, requiring the first 30 bits to be 0, and then from all submitted tasks, find out if there is a coincidence A target value of 0 for the first 100 bits."
Xie Rui told me that, theoretically, there are two ways for mining pools to assign tasks to miners:
In the first type, the mining pool is just a node, and it is the miners who package the transaction. The mining pool will give the complete information of the task to the miners, and the miners will package the transaction and broadcast it. Miners know the complete information, but there are many things to fill in, and the signature is also signed by the miners.
The second type of mining pool node packs directly, and what is given to the miner is the intermediate state of the result, or incomplete information, and the miner fills in what he wants to fill. The final combination of blocks is done by the mining pool. The miner sends the nounce to the mining pool, and the signature is the mining pool.
"The only thing that will not change is the data synchronization method you access to this 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, so I can choose the first one.
Seeing the nounce value mentioned above, you may be a little confused. This is actually the random number that we often say will collide in the PoW process, and it will be explained below.
According to the book Mastering Bitcoin, the goal of mining is to find a nonce such that the block header hash is smaller than the difficulty target.image description
In the block header, there are basically two things that mining nodes can change: transaction and nounce. Since the goal of mining is to make the hash value of the block header smaller than the target, the whole step is basically: determine the transaction you want to package and form the corresponding merkle tree root - guess a nounce - put the nounce in the block header to hash After a while - you will know if there is less than the target hash value, that is, greater than the target difficulty.
secondary title
Let’s talk about the anti-AISC property of the mining machine
Speaking of mining machines, I ask if there is really an algorithm that is resistant to ASICs? Xie Rui generally believes that there is no anti-ASIC in essence, but different algorithms will make the cost of manufacturing ASIC mining machines higher.
This articleThis article。
Why is there redundancy? Take a hypothetical example (not accurate but helpful for understanding), such as 5+5, FPGA may not have the concept of 5, it will become 1+1+1+1+1, and ASIC can directly calculate 5+5. This reminds me of what Wang Jiaping said in an interview with Odaily: In the computer field, flexibility/generality and efficiency are often in conflict.
"The strongest aspect of ASIC is parallel computing, and FPGA is slightly worse. In fact, there is no anti-ASIC in essence, which can only make it more difficult for each step of reverse derivation, such as requiring things to be stored in memory for calculation, such as the need to calculate variance. Every data is put into memory, from GPU to FPGA to ASIC, (ASIC) may require 100 times more video memory chips than GPU. (Whether to develop an AISIC mining machine for a certain currency) only depends on cost and benefit.” Popularly speaking It can be understood that it is more difficult to develop an ASIC mining machine for mining Ethereum than to develop a Bitcoin ASIC mining machine, and the chip developed at the same time has no obvious improvement compared with ordinary CPU/GPU. Bitcoin may be increased by tens of thousands of times, and Ethereum may be increased by several to dozens of times, and the effect is not worthwhile.
Similar analysis can also be seen in public information, such as this passage from Ear Finance:
"Ethereum uses the Ethash algorithm, formerly known as the Dagger algorithm (invented by Vitailk), and its purpose is to resist ASIC mining machines. How to resist ASIC mining machines? By bundling mining and memory bandwidth, that is, reducing the computing advantages of other hardware, So as to achieve the concept of equal mining equipment.
The Ethash algorithm did not prevent the emergence of ASIC mining machines, but only delayed the emergence.
Binding memory bandwidth means that computing power can be increased by increasing memory bandwidth speed, or power consumption can be reduced at the same memory bandwidth speed, but the current memory bandwidth price is too high and ETH price is too low. Considering the cost, ASIC mining machine Not worth the money compared to the GPU.
Litecoin uses the scrypt algorithm invented by cryptographer and programmer Colin Percival in the paper Stronger Key Derivation via Sequential Memory-hard Functions published in 2009. The principle is similar to that of Ethash, which increases the cost of memory usage during mining and delays the emergence of ASIC mining machines.
In 2014, Zeusminer developed an ASIC mining machine specifically for the scrypt algorithm. This also shows that there is no way to completely eliminate ASIC mining machines by binding a certain hardware (such as memory) to increase the cost of mining. "
Most of the mining algorithms that claim to be anti-ASIC now combine memory and computing.
Ethernet Chinese NetworkAlso sorted out the multiples of mining efficiency growth after deploying ASICs 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
secondary title
The revenue distribution model of the mining pool
Finally, briefly mention the income distribution model of the mining pool. In fact, this has been explained in many articles. There are two types of distribution modes in mining pools:
The first is the actual block distribution: within the time period, how many blocks are dug by the mining pool, and the mining income is distributed according to the proportion of computing power.
The time period of this method is generally based on the time when the block is dug out, that is, the distribution of the computing power within the two times when the block is dug out to distribute the income; it can also be settled every day. If your mining pool explodes several blocks, The income of the day is very high. If the mining pool does not dig any blocks for a day, then everyone will have no income today. This is called PPLNS (Pay Per Last N Shares).
The second is to divide coins according to the theoretical value: within a time period (usually one day), how much profit the mining pool can theoretically get, and distribute money to miners in proportion to the computing power, which is more stable than the previous one.
Borrowing an example from this article: Suppose that in a certain 10 minutes, you provided 1 T computing power for a certain mining pool. The reward is 12.5 BTC, the mining pool accounts for one-tenth of the total computing power of the entire network, the expected value of the mining pool income is 1.25 BTC, your computing power accounts for 1% of the mining pool's computing power, regardless of whether the mining pool has dug into the area block, your income is the theoretical income of 1.25 BTC. This is called PPS (Pay Per Share). Due to the PPS mode, the mining pool takes risks, so the ratio of fees will be higher.
Around August 2018, F2Pool launched a new ETH mining pool, which adopts the PPS+ distribution model, which is a bit different from PPS, with a handling fee of 2.5%. The mode of how many points.
So far, the basic knowledge of the mining pool has been popularized. I suddenly remembered that recently (I interviewed it years ago...) I read the article and saw that the empty block rate of Ethereum has increased a lot. I asked the mining pool why the empty block was mined, and the answer I got was time-saving: " The advantage of hollowing out blocks is that there is no need to synchronize data or download, and the upload is faster, but too many blocks (in a short period of time) will increase the difficulty.”
For more details, please refer to"Introduction to popular science | What is an empty block?" Why do miners mine empty blocks? "This article:
"The only advantage of the empty block technology is that, because there is only one message in the empty block, the empty block miners save the time of 'packing' a large amount of information. This allows the empty block miners to dig the block and start the next block directly. block mining.
If it is a large mining farm or even a 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 not an exaggeration at all. ah.
Under normal circumstances, mining pools do not like to mine empty blocks. After all, saving that little time is not worth 6%~8% of the income.
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 large blockage of the blockchain network, and the performance of the block chain network will be reduced due to blockage. It is possible to reduce the price of digital currency.
I am Lu Xiaoming, editor of Odaily. I am exploring the real blockchain. Please add lohiuming for breaking news and communication. Please note your name, unit, position and reason.
I am Lu Xiaoming, editor of Odaily. I am exploring the real blockchain. Please add lohiuming for breaking news and communication. Please note your name, unit, position and reason.
The first period of learning before is the virtual machine ("Xiao Ming's Study Notes | Understand the Blockchain Cross-Chain Mechanism in One Article"), the second phase is cross-chain ("Xiao Ming's Study Notes | Understand the Blockchain Virtual Machine in One Article"), Issue III"Xiao Ming's Study Notes | Understand the Internet TCP/IP Protocol in One Article", the fourth issue is "Xiao Ming's study notes | One article to understand the verifiable random function VRF", the fifth issue is "Reference article:》
Reference article:
The difference between FPGA and CPU, GPU, ASIC, the application scheme of FPGA in cloud computing
ASIC Terminator: The sudden emergence of X16R algorithm
Optimizing graphics card performance, resisting ASICs, what exactly is the ProgPoW algorithm
An article to understand the status quo and secrets of the cryptocurrency mining industry
Introduction to popular science | What is an empty block? Why do miners mine empty blocks?
Which of the mining pool PPS mode and PPLNS mode has the highest mining income?