Explaining the mining algorithms of the mining

in #bitcoin7 years ago


We will begin our review, of course, with the classical SHA-256, from which it began-it is in this algorithm that Bitcoin-mining is built, as is the mining of the vast majority of Bitcoin clones (Al'tkojnov).

So what is this SHA-256? This is a cryptographic hash function that was developed by our friends, the U.S. National Security Agency. Wait, don't rush into prostration, there's nothing to worry about. Just wait a little, I promise you will not miss you.

The main work of any hash function is to convert (or hash) an arbitrary set of data elements into a fixed-length (thumbprint or digest) value. This value will uniquely characterize the set of source data (to serve as its signature), without the ability to retrieve those source data. This is an official explanation from Wikipedia, which is wonderful and scientifically valid, but I'm not speaking such a language for example. And I'm sure most of you are. Let me therefore explain the meaning of this "phenomenon", in our own simple.

As we all know, in a mining SHA-256 kriptomonet, we are tackling the task by using a CPU, GPU, or dedicated processor. The conversion processes are displayed in the code interface for mining, such as the string "accepted 0aef41a3b". The value of 0aef41a3b is the hash. It is a kind of signature of a large set of data (actually, the next block of transactions with a random number appended to it). This short string is a block that consists of several thousands, if not millions, of the same string.

This also explains why you need to accomplish multiple tasks before you can find the hash that you want for the new block. We're looking for the wrong hash, and the one that starts with a certain number of zeros. You have one chance per thousand, tens, hundreds of thousands, millions of decisions, that an accidental hash will have the right number of zeros in the beginning. How much? This is determined by the complexity setting that your mining pool specifies. It's impossible to see if you can get a "beautiful hash" or not. It's like a lottery game, but with machines that can perform a winning combination faster and better than any of us.

Do you think that you will need powerful hardware to meet the hashing tasks of using SHA-256? That makes sense. The more computing power is used, the better the more the chances for coin production increase. But keep in mind that you're not the only one who does mining. There are people who have more productive hardware. Don't get upset, you have every chance of winning. It's like a lottery game, you never know when you're lucky!

Now back to the SHA-256. Cryptocurrency is not a single example where the SHA-256 is used. There are several protocols that you've probably heard about and that use this algorithm. These are SSL, SSH, PGP, and many other protocols. Each time you log on to a secure Web site using an SSL certificate, the SHA-256 is used. I bet you didn't think about that, did you? We'll all learn something new with time!

It is the SHA-256 algorithm that has been implemented in all the specialized ASIC-minerss that have been released so far, ASIC-equipment for other mining algorithms is still being developed. In addition to Bitcoin, mining, based on SHA-256, is used in a number of other digital clone currencies. For example, Al'tkojny like miner has and namecoin are used. Recently, there has been a resurgence of new SHA-256 coins: Zetacoin, Ocoin, Tekcoin and dozens of others.

Tasks more complex: Scrypt
Scryptalgoritm SHA-256 is not the only algorithm that is interesting for miners. The second most popular mining algorithm in the world cryptocurrency is scrypt. The history of the advent of scrypt is linked to the fact that, in the early stages of the existence of the Bitcoin, it became apparent that the simplicity of SHA-256 made it possible to make hardware decisions that would perform such calculations much more effectively than on a typical computer processor (CPU). Indeed, Bitcoin-mining very quickly migrated from a CPU to GPUs, then to programmable hardware devices (FPGA), and then came out of a dedicated chip (ASIC). The high concentration of specialized ASIC is a problem for the decentralized currency.

The Hjeshinga scrypt function was specifically designed to complicate hardware implementations by increasing the amount of resources required to compute. Therefore (at least in theory) this concentration of mining resources should not occur in Bitcoin, and it will remain decentralized.