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

Wuzhen News | BKEX founder Ji Jiaming confirmed attending the World Blockchain Conference, he will bring the heavy news of BKEX

On November 8-9, 2019, the second blockchain conference hosted by Babbitt·Wuzhen will be held in Wuzhen. BKEX (c...

Blockchain

Decentralized exchange Newdex strength to play "fake"

From the earliest decentralized exchanges in the EOS ecosystem, it has grown and steadily occupied the top spot of EO...

Blockchain

Gemini Exchange sets up insurance company to provide $ 200 million in insurance for custody services

The Winklevoss brothers' Gemini exchange has set up an insurance company to prepare up to $ 200 million in insur...

Blockchain

HKEx will start blockchain bidding

As one of the world's major exchanges, the HKEx is actively embracing the new wave of technology. “Every ...

Blockchain

Has the long-standing resentment towards VC finally erupted? After falling out with LianGuairadigm, Reflexer bought back tokens and put on a mocking face.

This year, you can earn substantial profits from cryptocurrency, all coming from self-reliant projects without ventur...

Blockchain

The compliance exchange is about to appear in Singapore?

On December 18, 2019, the official website of the Monetary Authority of Singapore (hereinafter referred to as "M...