Crypto-algorithm for miningsteemCreated with Sketch.

in #cryptocurrency7 years ago

IMG_20180326_113700_545.JPG

Many of you probably wondered from the start "How does it work there?". I will try to answer this question in the most precise and approachable manner. No wonder the algorithms and everything else is connected with this topic, it has a crypto prefix. It's not spontaneous. So in order to get to the bottom of this - you would have to wade through a jungle of cryptographic terms like SHA-256, Scrypt, RIPMD-160, base58check etc. I decided to gather everything in one article. Since the material will not be much and it is well involved. And you can also compare and identify the weaknesses and strengths of each method.

SHA-256

There is one interesting thing about it. It hasn’t even crossed your mind, but you use this algorithm every day, using the internet. Each time you go to a site that is protected by an SSL certificate, the algorithm SHA-256 is used. In addition to that, this algorithm uses the protocols SSH, PGP and several others. However, we are interested in what role it performs in mining.

A bit of history

SHA-256 is a cryptographic hash function. It was developed by the US National Security Agency.
The main job of any hash function is to turn (or hash) an arbitrary set of data items into a fixed-length value ("fingerprint" or "digest"). This value will unambiguously characterize the set of initial data (serve as its signature), without the possibility of extracting these initial data. (Source: Wikipedia)
Somehow too systematic, don’t you think? Now let’s comprehend what all of this means.

When mastering the cryptonym, SHA-256 solves the task with the help of processors (CPUs), video cards (GPU) or specialized devices like ASIC. How is the solution of this problem: So the pool (the place where the miners gather in order to combine their capacities into one large, quicker and more efficient coin mining) gives us a new block, which consists of a huge data set. From thousands or even millions of lines. However, this block is represented by only one line. Its "digital signature" - the next block of transactions with a random number added to it. This line is called HASH.

In order to find the desired hash for the new block, you need to solve a lot of problems by searching. This is because we are looking for a specific hash that starts at certain number of zeros. Likelihood that an accidentally generated hash will have the required number of zeros at the beginning - about 1 to 1.000,000. Everything depends of course on the complexity parameter that the pool sets. Ahead of it to understand if it will turn out at you or not - it is not possible. With computers that are able to calculate such combinations, everything becomes easier.

Naturally, in order to raise your chances, powerful equipment is needed. But there are always those who have more. This does not mean that you have no chance. In fact, there still are. For example, on "young" cryptocurrencies: like peercoin, namecoin, zetacoin, ocoin, tekcoin and dozens of others. Or in cooperation with the pool.

This was, perhaps, everything on SHA-256 and now we move on to the next algorithm.

Scrypt
IMG_20180326_113621_585.JPGScrypt is the second most popular algorithm in the world of cryptocurrency. This algorithm was created specifically to complicate the process of mining the cryptocurrency. The SHA-256 algorithm migrated very quickly from CPUs to video cards (GPUs) and to programmable hardware devices (FPGAs), and later on to specially grounded ASIC chips for this process. This is because such computations are performed on certain devices much faster .

And for this purpose, the Scrypt hashing algorithm was born, which (at least in theory) would complicate hardware implementations by simply increasing the hardware capacity required for the computation process.

In principle, Scrypt-mining differs little from the usual bitcoin-mining (SHA-256):
A data block is fed into the input, a hash function is applied to it, then at the output we try to get a "nice hash". The hash function itself is much more difficult to compute. This algorithm uses a larger amount of RAM (random access memory) than SHA-256. Memory in Scrypt is used to store a large vector of pseudo-random bit sequences generated at the very beginning of the algorithm. After the vector is created, its elements are queried in pseudo-random order and combined with each other to obtain the final key.
Since the algorithm for generating a vector is known, in principle, it is possible to implement a scrypt that does not require much memory but calculates each element at the time of the reference. However, computation of the element is relatively difficult, and during the operation of the scrypt function, each element is read many times. Scrypt has a balance between memory and time that implementations that do not use memory are too slow.
In this manner, the created artificial complexity and memory requirements lead to the fact that specialized devices for mining have become much inferior to CPU and GPU devices (although this line can be gradually overcome). Ideally, the extraction of coins should be carried out exclusively on computers. If you have already thought about what configuration to collect for yourself for mining - then take your time. In the network, you will find a lot of information about the fact that ATI video cards outperform Nvidia in terms of practicality. The price/kilo-hash ratio lies on the ATI side of the video cards. But that was before. Now the situation is changing rapidly and in fact there is not much difference. Although ATI is also leading in some other parameters, that would be a topic for a separate article.

So to sum it all up. In fact, both SHA-256 and Scrypt are created for one purpose - by busting to get a nice hash, thus extending the blockage and eventually getting a reward for it. However, the task is solved in different ways. SHA-256 tries to maximize the hardware capabilities of any device that was created for this - the higher the performance, the better the result. Well, Scrypt requires a large amount of memory and as a result, the performance of RAM (RAM) and video cards are installed in the computer/computers.

The most famous coins are extracted with the help of the Scrypt algorithm: Litecoin, dogecoin, digitalcoin, franco, bottlecaps and many more. The popularity of such coins has greatly increased when bitcoin-mining migrated to ASIC devices. All those miners who honestly mined the currency with video cards being left out of business, as their equipment cannot compete in the following categories like price, energy consumption, size, noise (i.e. In principle, in everything). Therefore, all those who have invested in equipment and have not had time to pay back have then switched to Scrypt-mining.

The described algorithms have occupied more than 90% of all the extracted currencies. Although there are others, in my opinion, they do not deserve attention as of the moment. Since every week, another clever person offers an increasingly inventive algorithm so that they can not be followed. I will tell you about the most interesting aspects in the following articles.

Coin Marketplace

STEEM 0.14
TRX 0.23
JST 0.030
BTC 85167.93
ETH 1982.81
SBD 0.81