bitcoin mining
bitcoin mining

Uncovering “Mining”: Detailed Explanation of ASIC Miners?

Abstract: In recent years, with the gradual rise of encrypted digital currency, Bitcoin (Bitcoin, BTC), as the representative of encrypted digital currency, has attracted widespread attention. The Proof-of-Work (POW) mechanism that Bitcoin is based on stipulates that the miners who are the first to solve complex mathematical problems can obtain the power of accounting and Bitcoin rewards. Mining equipment, as the source of solving this complex math problem, requires constant calculations. In the current hot bitcoin market, the rising price of the currency has not only led to more and more participants in mining, but also caused the supply of various mining equipment to be in short supply, resulting in a situation of “one machine is hard to find”. In this article, based on my major (integrated circuit technology and management), I have made an interesting introduction to the mining equipment related to encryption algorithms and integrated circuits in Bitcoin mining, and introduced the existing mainstream mining equipment and equipment. The industrial chain situation was analyzed.

Keywords: Bitcoin; mining; mining equipment; ASIC mining machine; blockchain

  1. Bitcoin Mining

1.1 Hash function and SHA-256

A hash function is a mathematical function that can be calculated to convert any form of data into a fixed-length value. Because of its one-way, anti-collision, stability and other characteristics, it has been widely used in digital signature, file verification, encrypted digital currency and other fields.

Figure 1 is a flow chart of encryption using a hash function. In the figure, the leftmost part is the input information, the middle part is the hash function used, and the rightmost part is the output result value.

Hash function encryption flow chart

Suppose we input the character “Dog”, after the operation according to the hash function, we will get a series of output, such as “0eb1 29bf…”. In the same way, you can also get an output when you enter the “I am a student” string. When we add a “.” to the end of the string, that is, the original character becomes “I am a student.”, we can see that the output text at this time has undergone tremendous changes, which shows that we cannot reverse the output only from the output. Features of push input. In addition, the hash function can also handle input other than this text, such as files and so on.

Among the hash functions, one of the most famous algorithms is the SHA series of algorithms. The SHA series of algorithms are designed by the National Security Agency (NSA) and are a series of cryptographic hash functions released by the National Institute of Standards and Technology (NIST), including SHA-1, SHA-224, SHA-256 and SHA-512, etc. Variants. Among the SHA series of algorithms, the most commonly used is the SHA256 algorithm. The characteristic of the SHA-256 algorithm is that for messages of any length, it outputs a result with a fixed length of 256 bits.

SHA-256 encryption algorithm

Figure 2 shows the encryption process using the SHA-256 algorithm. However, in the figure, only “982153ce…” 64-bit characters are output. This is because this 64-bit character is actually represented in hexadecimal form, so the actual output is still 256 bits (4-bit binary can be represented by 1-bit hexadecimal: such as 1100 and ten in binary c in hexadecimal equivalent).

1.2 What is mining?

Table 1 shows different encrypted digital currencies and the encryption algorithms they use. It can be seen that the hash function used by Bitcoin is the SHA-256 algorithm in cryptography. The following descriptions take Bitcoin as an example.

BTC is composed of blocks, and each block can be divided into block header and block body. The block header mainly records the basic information of the current block, as shown in Figure 3, including: version (Version), timestamp (Timestamp), difficulty (Difficulty), random number (Nonce), current block transaction information hash value (Merkle root) and other information. The block body mainly records the current block transaction information.

block header information

The rule designed by Satoshi Nakamoto, the founder of Bitcoin, is: whoever finds a block that meets the conditions first will be able to get the reward of Bitcoin, so how should this block be found? In fact, in the block header information given above, except for the random number Nonce, other values ​​are known. To this end, what we are looking for is the random number Nonce, so that the hash value obtained after the current block header is processed by the hash function is less than the specified hash value. Since the SHA-256 algorithm is a one-way calculation function, it cannot be reversed, and there is no known formula, so it can only be tried by counting a number until the correct value is found.

In addition, Satoshi Nakamoto also predicted that with the continuous development of science and technology, the computing resources of people’s computers must become larger and larger. In order to prevent the process of finding blocks from becoming more and more simple, he stipulated a hash value when specifying a Difficulty coefficient, let the specified hash value change continuously with the change of the coefficient.

As shown in Figure 4, since the difficulty is in the denominator, as the difficulty coefficient increases, the probability of finding the hash value of the block header that satisfies the condition becomes smaller and smaller. For this, we need a lot of computing, to keep trying.

For example, on April 6, 2022, since the difficulty is 28.59T, in theory, (28.59T) times (2 to the 32nd power) hash operations are required. To put it simply, the essence of mining is that many computers work together to calculate a mathematical problem, and whoever calculates the answer first is equivalent to mining a block and earning bitcoin rewards. Since the computing power of each computer is different, but all perform mining tasks, we can use computing power (the number of hash operations that can be performed per unit time) to measure the pros and cons of a device.

  1. Mining equipment

Mining equipment can be mainly divided into three categories: CPU equipment, GPU equipment and ASIC equipment. Between these three is a continuous iterative and evolving process. In short, the three tend to specialize in equipment and become more and more efficient in mining. There are often people who cannot understand the relationship between the three. We can make an analogy: Suppose we are going to solve a very complex mathematical problem that requires a lot of calculations, then the CPU is a primary school student who does not have much knowledge reserves. The computing power is very slow, Each step takes a long time to think. GPU is a college student who has studied advanced mathematics, with a certain mathematical foundation, and the computing power is much faster than that of elementary school students. ASIC, on the other hand, can be compared to an old professor in the mathematics department, who has read countless questions, has the strongest computing power, and has the highest problem solving efficiency.

2.1 CPU device

The CPU (Central Processing Unit) is the central processing unit, which is the core device of the computer and is responsible for information processing and execution. When Bitcoin was just born, everyone used ordinary computer equipment (CPU) to mine. Few people use a computer for mining, because only part of the computing resources are used in the mining process, and other resources in the computer (such as hard disk, storage, etc.) are almost idle, which is very uneconomical. However, with the increasing number of miners and the increasing difficulty of mining, the mining efficiency using CPUs on general-purpose computers is getting lower and lower. It is very difficult to mine Bitcoins with CPUs.

2.2 GPU Devices

GPU (Graphics Processing Unit) is a graphics processor, which was initially used in graphics cards to accelerate the rendering of images, and its excellent computing performance attracted the attention of the currency circle. With the popularity of encrypted digital currency, graphics cards have also been used for mining, which is also the reason for the shortage of graphics cards and the skyrocketing price. At present, the GPU market is mainly monopolized by AMD (A card) and NVIDIA (N card).

2.3 ASIC Devices

ASIC (Application Specific Integrated Circuit) is an application specific integrated circuit, which refers to an integrated circuit designed and manufactured according to the requirements of specific users and the needs of specific electronic systems. The ASIC mining machine we often hear refers to the chip used in it is an ASIC-specific chip.

Since ASIC chips can be customized for a certain algorithm, in the field of encrypted digital currency, if users want to mine BTC, they can design a dedicated ASIC chip for SHA-256 algorithm to improve computing efficiency.

Figure 5 shows a relatively simple example. If we now want to implement the operation of F=A+B*C on the CPU and ASIC devices, then the CPU device will pass the two-step method of “multiplication first, then addition”. calculate. The specially developed ASIC chip can design a multiply-add operation separately, and complete the addition and multiplication in one step.

After the ASIC chip design is completed, it needs to go through the steps of verification, synthesis, testing, and layout and wiring in the integrated circuit before it can be sent to the foundry for tape-out, and further packaging and overall testing of the chip must be performed after tape-out. The chip will not be returned to the customizer until all the above processes are completed. At this point, the mining machine manufacturers who have obtained the ASIC chips also need to assemble various components to form the final ASIC mining machine. Since the handover of ASIC chips from the initial design to the final physical product involves many processes, the development cycle of ASIC mining machines is generally about a year or even longer. Since ASIC chip mining machines can perform more efficient operations and greatly increase the number of operations in the same time period, ASIC mining machines are currently the most efficient mining solution.

Table 3 compares the three mining rigs and their corresponding features. For CPU equipment, due to its generalization characteristics, it is less efficient under the specific requirement of mining. Because ASIC devices can only be developed for a specific application, flexibility is largely sacrificed in terms of efficiency. GPU devices are somewhere in between.

3.1 The main structure of the mining machine 3. The structure, indicators and products of the mining machine

We know that the most important part of the ASIC mining machine is the ASIC chip, but in addition to the ASIC chip, there are other important components. The main structure of the mining machine will be analyzed below.

(1) Chip: The ASIC chip is the core device in the entire ASIC mining machine.

(2) Mainboard: It is convenient to integrate chips and various accessories together, as shown in Figure 6.

(3) Network port: used for information exchange on the network

(4) Fan: Used to dissipate heat, the miner will generate a lot of heat when it is running.

(5) Power supply: power supply for the entire mining machine.

3.2 Mining machine indicators

(1) Computing power – the number of hash operations that can be calculated per second, the most basic unit is hash per second (H/s). In addition, there are KH/s (103H/s), MH/s (106H/s), GH/s (109H/s), TH/s (1012H/s) and other units. At present, the computing power of GPU equipment is generally in the order of MH/s, and the computing power of mining equipment is generally in the order of TH/s.

(2) Cost – the purchase cost of each mining machine

(3) Electricity fee – the power consumption of the mining machine

(4) Maintenance – need to regularly clean up dust and oil the fan, etc.

(5) Noise – Although the mining equipment is small, it tends to generate large noise during operation

Among them, from the perspective of profit, most miners mainly focus on the first three indicators.

3.3 Mining Machine Products

At present, the mainstream mining machines include Antminer, Whatsminer, Avalon Miner, etc. Here we take the Antminer produced by Bitmain as an example. Bitmain, one of the world’s largest producers of mining machines, was a young company founded in 2013 and posted an operating profit of $3 billion to $4 billion in 2017, compared with Nvidia’s $3 billion operating profit during the same period. When the currency speculation was at its peak, the company paid the highest amount of tax in Haidian District, Beijing, and its profits were evident.

Table 4 shows the relevant indicators of the three mining machines sold by Bitmain in April 2022. It can be seen that with the gradual upgrading of mining machine models, the energy efficiency of mining machines is getting higher and higher. Power consumption is getting lower and lower. However, due to the constant fluctuation of the currency price, the price of the mining machine is not stable. Under the current circumstances, the average unit computing power price of the three mining machines is around $80/TH.

In order to further illustrate the impact of the currency price on the price of the mining machine. Table 5 presents the relevant indicators of Antminer S19 and Antminer S19Pro at two different time points (March 2020 and April 2022).

No Comments

Leave a Reply

New Client Special Offer

20% Off

Aenean leo ligulaconsequat vitae, eleifend acer neque sed ipsum. Nam quam nunc, blandit vel, tempus.