Science | Three Principles of Bitcoin Mining: A Brief History of Cryptography, Hardware Knowledge, and Development

This article is the second of three series in Bitcoin mining. View previous article: Popular Science | Three Business Models of Bitcoin Mining, Logic of a Chicken Farm

Three articles in Bitcoin mining (2 ): a brief history of hardware knowledge and development of cryptographic principles

Author: village two old

Previous Article The business model of a chicken farm is analogous to a bitcoin mine, which leads to the basic ecology of the entire bitcoin mining industry, such as mining company, mine, mining pool, mining machine hosting, second-hand mining machine market, cloud computing power, and computing power. Picture. Today is the second of three mining articles, mainly describing the mathematical principles of bitcoin, cryptography and hardware knowledge, and a brief history of the development of bitcoin mining machines.

Continue to use a simplified, easy-to-understand form to describe such a process.

Why are 21 million Bitcoins?

 

Putting aside the designer ’s economic ideas, let ’s talk about mathematical ideas directly. Starting on January 3, 2009, about 10 minutes a block, a block reward is 50 btc, halved in 4 years to 25 btc, then Four years continue to halve, and so on.

Currently in the third stage, the packaged block reward is 12.5, which will be halved to 6.25 next year.

Use mathematical formulas to calculate.

There are six ten minutes in one hour, 24 hours a day, 365 days a year, and halving in four years. It has been halved, which is followed by a proportional series.

Total Bitcoin = 50 x 6x 24 x 365 x 4 x (1 + 1/2 + 1/4 + 1/8 + …… + 1/2 ^ n)

The above equation is approximately 21 million, where (1 + 1/2 + 1/4 + 1/8 + … + 1/2 ^ n) is a proportional series, which is mathematically equal to 2.

It can also be seen that in the first four years of Bitcoin, the number of dug out is 10.5 million, which is half. Half of 5.25 million is 2.625 million. It is now at the end of the third cycle (halved in May and June 2020), so a lot of news says that the "circulation" of Bitcoin is 17 or 18 million. You can add it with a calculator. Millions may have been lost forever and circulation is much lower than output.

Note: There are actually two parts to the mining reward, one is the block reward, and the other is the Bitcoin transaction fee that occurs throughout the network in about ten minutes. The latter accounted for a very small proportion, which can be ignored in the current stage of the revenue calculation.

Quoting the logic of the previous chicken farm, the hens laid golden eggs, but some of them were lost, so the total circulation was lower than the output.

To put it simply, the economic model, this is the deflation model, there is no big innovation in the economic model. Whether Satoshi Nakamoto (this person or this organization) has a Nobel Prize-level contribution has nothing to do with this deflation model. Because it is a very simple (and relatively crude) economic model. No country in history has adopted this model to achieve economic prosperity. This article only talks about mathematical models.

What is the process of Bitcoin mining? What is the principle of cryptography?

To put it simply: solve a mathematical problem, broadcast it, and get a block reward after verification. After other miners received the information, they gave up solving this mathematical problem and went to calculate the next mathematical problem in order to win block rewards. And so on.

To be specific, the mathematical problem here is to use a cryptographic knowledge: one-way hash function

One-way hash function, also called hash function, the hash function in Bitcoin is SHA256.

I have written many articles about cryptography before, you can refer to it ("Cryptography in Bitcoin: Five Features of Hash Functions and Mining Principles"), which are also briefly described here.

SHA256 is a hash function. SHA (information) = 256-bit binary number. Enter any information, it can be a "Red Mansion Dream" can be a word, etc. You can quickly get this 256-bit binary. Change the input information a little, and the results are much different, and the input information cannot be deduced from the result information.

For binary, the more the previous 0 is, the smaller the number is. If the range is less than or equal to this number, it means that in binary digits, the more the preceding 0 is, the narrower the range is. The more difficult it is to guess the input value.

SHA256 (SHA256 (information + x )) is less than or equal to the target .

Use the miner to find or guess x, knowing that the conditions are met. This is mining.

The information in the formula is the block header information, including version, pre_hash, merkle root, ntime, nbits, and so on. It changes with the change of block height and time. The x value to guess can also be written as nonce, as What is not important does not affect the understanding of Bitcoin mining. I probably know that there is such a thing.

The mining process uses only the characteristics of a one-way hash function. The concepts of public key encryption, signature, and verification should not be tangled. This problem-solving process is not needed.

If you still don't understand it clearly, please ignore the description of the one-way hash function above. A simple and crude understanding is to solve a mathematical problem. Moreover, the mathematical problem can only be solved by guessing. There is no reasonable calculation method to solve this problem.

A brief history of hardware knowledge and mining machine development

The mathematical puzzle was initially done by the CPU, then GPU graphics mining, then FPGA, and then the current mainstream ASIC mining machine for bitcoin mining.

The CPU can handle complex problems, but this problem-solving process does not require such a complicated mind, so guess hard. So it is better to use GPU parallel computing and other related features. The most famous companies are NVIDIA and AMD. In the mining circle, the former is called N card and the latter is called A card.

GPU has power consumption and other shortcomings, so FPGA is used. There is a very good drone company in Shenzhen called DJI Technology, which uses FPGA behind it. GPUs and FPGAs have many applications in the field of artificial intelligence (knowledge extension, which has nothing to do with today's topic).

FPGA is a field programmable gate array (remind again: all concepts that don't understand, don't get tangled, just skip), that is to say, it is easy to program and adjust. However, there are still too many functions. I just want someone who can put the Lantern Festival in the box, no need for a college student doctoral student, continue to simplify, and ASIC chips appear.

"I only need a pair of hands, and you gave me one"-Henry Ford

Now AISC is essentially a simplified product. Only one hand is left, and only this one function problem is solved.

Compared with the CPU, the CPU is a competition for doctoral students and production line workers who can put the Lantern Festival into the box. Due to the excellent integration, it has become a competition of doctoral students and ten hundred production line workers who install the Lantern Festival Load fast. The results can be imagined, so now, Bitcoin mining uses only ASIC chip miners.

The logic of the development of the mining machine has been finished, and the historical part is briefly described as follows:

On January 3, 2009, Satoshi Nakamoto used CPU mining; GPU mining in September 2010, FPGA in 2011, and fried cat in August 2012 crowdfunding for ASIC mining machines, that time began The world's mining industry is leaning towards China. In November 2012, BTC halved for the first time, almost four years from 2009. In early 2013, roasted cats continued to dry. The Avalon ASIC mining machine has been produced, and it is also the earliest batch of ASIC mining machines in China. The parent company is Jia Nan Yun Zhi, the company that recently listed on the NASDAQ stock price and plummeted.

At the end of 2013 on the Dayang Line, many first-generation classmates entered the market. The first appearance of two large-scale miners and speculators in China was in 2013, and the second was in 2017. A big sun line meets thousands of horses, that's what it means. History after 2014 can easily be found online. The roast cat disappeared in January 2015. It disappeared mysteriously. The specific reason for this disappearance was that it was murdered, was it taken away by aliens, or was it because the mining machine was not good enough and people ran away? Now, we don't care about these contents, this is not a gossip article. Comrade Roasted Cat has made great contributions to Bitcoin mining, and pay tribute to Comrade Roasted Cat.

After that, everyone knows that the rise of Bitmain has accounted for more than 80% of the global market in 2017 and 2018. According to the data of the past year, Bitmain's miners, ant miners accounted for more than 60%, and Shenma Miners accounted for 20% +. The grievances and grievances and the specific market proportions are here, and you are interested to check it yourself.

This article covers three topics: the basic principles of bitcoin mining, a simple knowledge of mining hardware, and a brief history of the development of mining machines.

Combine the first and second articles of the three mining articles to understand the overall picture of the Bitcoin mining industry. The next article is about computing power, cloud computing power, electricity costs, payback period, profit calculation, etc., a bunch of calculation formulas It will appear, rest assured, a mobile calculator is sufficient. Stay tuned.