Popular Science | What is the SHA256 algorithm used in Bitcoin mining?

Popular Science | What is the SHA256 algorithm used in 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, let's look at its definition - a deterministic one-way hash function. Let's explain it word by word:

An algorithm is a series of steps/processes for performing an operation;

A hash function is a mathematical function whose input can be of any length but whose output is of a fixed length. It can be thought of as a digital fingerprint of a file.

It has the characteristic of "determinism", which means that the same input value will always produce 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, you only need to subtract 30 to reverse it; but if you want to reverse the multiplication formula of two large prime numbers, 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, which may be 256 1s and 0s - this is a very long number, so it is usually written as a 64-bit hexadecimal number.

This formula has two interesting and useful features:

First of all, if you get the same hash value, or digital fingerprint, it is because you entered the exact same input value. Two different input values ​​will not produce the same output value (digital fingerprint).

So what is the number of hash values? 2 to the power of 256.

Another interesting feature is the butterfly effect, where the output value will change as long as the input value changes a little bit. For example, I take a photo now, pixels: 1000x1000, file length: 24 million bits, run it through the SHA 256 algorithm, and get a hash value. Now change a small unit in the input value, zoom in on the pixel of the telephone pole, change the green value of 0 to 1, and run it through the SHA 256 algorithm again, and you will get a completely different output value, and this is just changing one of the 24 million units.

The above two features help SHA 256 be suitable for various scenarios: cryptography, digital signatures, authentication, and Bitcoin.

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

The process of Bitcoin mining is to find an input value that generates an output value with about 70 zeros at the beginning through the SHA 256 algorithm. However, because there is no known formula, all anyone can do is try one number after another through brute force until the correct input value is found. However, Bitcoin mining only needs to find a close hash value, and does not need to match it exactly. In fact, the mining difficulty can be adjusted to ensure that a miner can find a matching input value about every ten minutes and then earn a block reward of 12.5 Bitcoins, which is why I think it is the most popular algorithm on the planet, or should I say the most commonly used algorithm on the planet.

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

If you add up all the Bitcoin miners in the world, they are currently calculating 600 quadrillion hash values ​​per second, every day, every day.

So it is fair to say that SHA 256 is the most popular algorithm. I think there may be other character processing algorithms that compete with it, such as the Fourier transform function, but can it perform more than 600 trillion operations per second?

I have no idea...

Anyway, I say this to make it clear 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 won't do that and will only choose to follow the rules...

<<:  Kong Meng, founder of VeryHash: Bitcoin is likely to replace gold and become a financial asset with greater consensus

>>:  Exclusive interview with F2Pool CMO Qingqing: Miners’ interests come first

Recommend

The facial features of people with endless wealth

The facial features of people with endless wealth...

Why is the difficulty of Bitcoin mining different this year than in the past?

Bitcoin October 16th This year, Bitcoin price flu...

Can digital currency reduce the abuse of charitable donations?

The misuse of charity funds is a serious problem ...

What kind of face will make men more and more prosperous after marriage?

1. Beautiful features and spirit The eyes and eye...

What are the facial features of a passionate and romantic woman?

Generally, men are romantic, but now women are al...

What does the Sun in the House of Marriage represent?

The Sun is a lucky star in the Zhongtian Dou, rep...

Analysis of moles on men who are fickle and love to cheat

Everyone has moles, but the meanings of moles in d...

People with these facial features are strong women

People with these facial features are strong wome...

Mole physiognomy for men: It is not good to have a mole under the right eye

Moles are a common thing, and it can be said that...

How to tell a woman's sexual ability from her face

From a woman's facial features, we can tell t...

How to read women's faces? Which women with these faces are blessed?

Face reading can really let you know a lot of inf...