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

Data report: Which exchanges are the most used in currency, fire, and OKEx?

(Image courtesy of 2Bitcoins.ru ) The Blockchain Transparency Institute (BTI) recently released a market monitoring r...

Blockchain

How many entities hold Bitcoin? These 7 exchanges are worth watching

Written by: Rafael Schultze-Kraft Translation: Lu Jiangfei Source: Chain News Problems with quantifying the number of...

Blockchain

Interpreting FTX's preliminary restructuring plan Cash compensation is adopted, excluding FTT holders.

At present, the restructuring plan of FTX is still in its early stages. The team will submit a revised plan and discl...

Blockchain

SBF returns to the witness stand admitting mistakes but refusing to plead guilty, Binance, ex-girlfriend, and Three Arrows caused FTX to collapse.

SBF revealed insider information that Binance had once sought to acquire FTX, and described himself as the CEO who do...

Blockchain

OTC is a hotbed of money laundering, can the exchange stay out of the way?

What should I do if my account is accidentally frozen? The over-the-counter market (OTC) is becoming more and more at...

DeFi

Postponed Fraud Trial of Mango Markets Exploiter: A Delayed Showdown

Fashion executive, Avraham Eisenberg, accused of a $116 million fraud at Mango Market, will face trial on April 8, 20...