Science | What is the SHA256 algorithm used for Bitcoin mining?

Video Source: Matthew Endures Teaching

Translation: Cobo Wallet

The most popular computer algorithm in the world is probably the SHA 256 hash algorithm. First look at its definition-a deterministic one-way hash function. Let's explain it word by word:

"Algorithm" is a series of steps / processes that perform operations;

"Hash function" is a mathematical function, the length of the input can be arbitrary, but the length of the output is fixed, it can be understood as the digital fingerprint of the file;

It has the characteristic of "deterministic", which means that the same input value can always get the same output value.

SHA 256 refers to a secure hash algorithm with an output value of 256 bits. What does "one-way" mean? One-way means that the function is difficult to reverse. Some functions are easy to reverse, such as adding 30, which can be reversed only by subtracting 30; but if you want to reverse the multiplication formula of two large primes, it is difficult.

The SHA 256 function is a one-way hash algorithm. The input value can be of any type and length, and the output value is 256 bits. It may be 256 1s and 0s. This is a long number, so it usually Written as a 64-bit hexadecimal number.

This formula has two interesting and practical features:

First, if you get the same hash value, or digital fingerprint, it is because you have entered the exact same input value, two different input values ​​will not result in the same output value (digital fingerprint).

What is the number of hashes-2 to the power of 256.

Another interesting feature is the butterfly effect, as long as the input value changes a little, the output value will change. For example, I'm taking a picture now, pixel: 1000×1000, file length: 24 million bits, run it with SHA 256 algorithm, and get a hash value. Now change a small unit of the input value, enlarge the pixels of this pole, change the green value from 0 to 1, and run it again with the SHA 256 algorithm to get a completely different output value. This has only changed. One of 24 million units.

The above two features help SHA 256 apply to various scenarios: cryptography, digital signature, authentication, and Bitcoin.

SHA 256 plays a key role in the Bitcoin protocol. Anyone can run this mathematical function on their own computer, but no one can reverse it. If you can reverse this algorithm, you can mine faster than others, and then make a lot of money.

The process of Bitcoin mining is to find the input value. This input value uses the SHA 256 algorithm to generate a series of output values ​​with about 70 zeros at the beginning. However, because there is no known formula, everyone can only try to count one by one by brute force until they find the correct input value. However, Bitcoin mining only needs to find a close hash value, and does not need an exact match. In fact, the difficulty of mining can be adjusted to ensure that miners can find a matching input value every ten minutes, and then earn 12.5 bitcoin block rewards, which is why I think it is the most popular algorithm on the planet, or should Said to be the most commonly used algorithm on earth.

In order to outperform the Bitcoin mining competition, people specifically use computers that can quickly run the SHA 256 algorithm. How fast?

If you add up all the Bitcoin miners in the world, they are currently calculating 600 billion hashes per second, every second, every day.

So I say that SHA 256 is the most popular algorithm, and this conclusion is quite fair. I think there may be other character processing algorithms competing with it, such as the Fourier transform function, but can it be calculated more than 600 billion times per second?

I do not know…

Anyway, I said these are to show that no one can find a shortcut to bitcoin mining. Although there is a huge economic incentive to find a shortcut, maybe someone can find it, but they will not do it, they will only choose to follow the rules …

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Blockchain

Getting Started | What is an aggregate transaction? What are the operating principles and advantages?

Recently, the concept of aggregate transactions has been repeatedly mentioned, how is aggregated trading realized? Wh...

Market

Future of Web3: Triple Impact of VSAP on Exchanges, Financial Markets, and TradFi

With the rapid development of the virtual currency market, more and more people are investing and trading in virtual ...

Opinion

Research on the major wallet risks of Binance, KuCoin, and Jump: Are assets stored in large institutions 100% safe?

Undoubtedly, mainstream exchanges and institutions have invested a significant amount of funds and manpower in networ...

Blockchain

Metropolitan Museum of Art in New York to return $550,000 FTX donation

According to Decrypt, the Metropolitan Museum of Art in New York has agreed to return hundreds of thousands of dollar...

Blockchain

How does the derivatives market fight on the platform of the 5-year-old exchange?

Derivatives trading has become a battleground for the military, and OKex, Huobi, Gate, Fcoin, which are well-known ex...

Market

Latest Interview with Zhao Changpeng: Being "Under the Microscope" of Regulation, Market is Recovering in Bearish Period

On May 29th, Binance CEO Changpeng Zhao gave an interview to Bankless discussing his views on the current state of th...