Brother
Professional
- Messages
- 2,590
- Reaction score
- 533
- Points
- 113
You've probably heard many times about some kind of tantalizing ASIC miners and guess that it has something to do with highly efficient mining.
Today we will figure out what it is, why it is so and how it works.
Let me remind you that mining is a stupid enumeration of all possible values of one meaningless number ( nonce ), and as a result of such an enumeration, the miner once accidentally finds a value at which a specially invented inequality is fulfilled. This inequality compares the hash result of the candidate block and one numeric parameter. This parameter is selected by the network so as to change the complexity of this selection depending on the total computing power of the miners. This is necessary to "give everyone an equal chance of finding a suitable nonce ." Those. if suddenly a miner comes with huge computing power, then the parameter will be adjusted so that to find the desired nonce valuewill become more difficult for everyone - both this miner and everyone else. But the greater the computing capabilities of a particular miner, the more likely it will find a suitable nonce faster than competitors. Therefore, miners are interested in increasing these computing power.
What possibilities are there?
It would seem - just buy yourself a computer with the maximum processor performance and figure out what you want. It’s so logical, but it’s an ineffective way. An ordinary processor relies on a huge number of additional devices: a motherboard on which all sorts of controllers - PCI, USB, SATA (and many others), a video card, a disk subsystem, etc. etc. All of them do not participate in the calculation, but they consume electricity, generate heat and cost money. Therefore, buying a lot of computers is not interesting, you pay a lot for the equipment itself, and for electricity, and for the area on which all this is located (after all, suddenly we have a mining farm). Well, all this generates a lot of heat - you have to spend money on cooling, and this is not like a free thing ... It is not for nothing that there are many mining farms,Okay, let's think further. In fact, when mining, you do not need to store huge amounts of data, which means that there are no high requirements for the disk subsystem. Yes, of course, the size of a local copy of the blockchain for bitcoin is about 200 GB, but the overwhelming majority of this data during mining is dead weight, the main work is still associated with enumerating the numbers and calculating the hash from the block with these substituted digits. So the file subsystem is definitely not a critical place. In the same way, not a critical place - all interfaces with the outside world, i.e. PCI, USB, etc. They are, of course, needed, but again the load there is not average, but even minimal.
Look.
We have formed a candidate block (made up of a number of service fields, transactions "credit me from nowhere 12.5 bitcoins" and several user transactions). To do this, we received data over the network, found those records in the local copy of the blockchain that are referenced by user transactions, did some relatively simple calculations, and as a result we got a block - candidate. Now we don't need the network (the only thing - we need to watch so that a message does not come that someone has already created a block, and then work should be stopped on this block.) Also, the disk subsystem becomes unimportant to us (all data has already been collected, candidate block is in RAM). Now we need to do the most important (albeit absolutely stupid) work. In this block candidate, we substitute the nonce valueand calculate the hash of this entire block. Inequality not met? Increase the nonce by one and calculate again. And so on until we come across a nonce value at which the inequality holds, or until it becomes known that someone has already assembled a block, and therefore we need to prepare a new candidate block, because this one is no longer relevant.
So, to brute force, it turns out, you only need processor power and a little RAM. All these interfaces for communication with the outside world, the disk subsystem, the video subsystem - all this does not perform the main work, which means that it is in vain to eat up electricity and money.
It is logical that miners wanted to increase the number of processors, not computers. Therefore, it would be wise to look for multiprocessor boards and mine on them. But such cards are rare beasts, are expensive, and they are not designed for a large number of processors. In addition, there is another point.
The processor itself also contains a huge amount of "unnecessary" for our task. The processor is a complex device, it is not for nothing called "central". He knows how to do absolutely everything. But a universal tool is less effective in every single task than a highly specialized one. To calculate the hash, you need to mix the bits, perform fairly simple addition and multiplication operations, as well as those not very understandable to an ordinary person, but still very simple in essence binary operations of shift, conjunction, disjunction, addition "modulo two", etc. And a good central processor can do many other things that we don't need. There are various block calculations, working with large amounts of data, predicting the next operations, etc. This is very typical for working with multimedia data, and it is these capabilities that make a modern processor so expensive. And we don't need it! If we only mine, then we pay a lot for all these multimedia goodies by buying a processor.
Video cards
In general, at some point someone guessed that this work could be performed not only on the central processor, but also on the video processor of the video card. Video processors are not as versatile as central processors, but they are good at solving a very typical problem - sequential processing of huge amounts of data. Because graphic tasks are exactly like this: there are a huge number of points, coordinates, textures, etc., and all of them must be processed sequentially and at high speed using fairly logically simple algorithms. In sum, this is a huge computational work, but the video processor is already specifically focused on just such block tasks. The task of calculating a large number of hashes is already more like sequential massive processing of graphic data, than to the stream of commands of the operating system and application programs familiar to the central processor. And most importantly, video cards have a couple of additional weighty advantages: firstly, you can insert several of them into a regular motherboard, and secondly, you can load them only with the work we need, without causing them to be distracted by working with the network, external interfaces, etc. .NS. And the central processor will take over all the service work - receive data from the network, build a candidate block, distribute work between video cards, monitor execution results, etc. By the way, the video card does not display anything on the monitor. Relatively speaking, the unit for displaying images on the monitor is not used and hangs like a dead weight. you can insert several of them into a regular motherboard, and secondly, you can load them only with the work we need, without causing them to be distracted by working with the network, external interfaces, etc. And the central processor will take over all the service work - receive data from the network, build a candidate block, distribute work between video cards, monitor execution results, etc. By the way, the video card does not display anything on the monitor. Relatively speaking, the unit for displaying images on the monitor is not used and hangs like a dead weight. you can insert several of them into a regular motherboard, and secondly, you can load them only with the work we need, without causing them to be distracted by working with the network, external interfaces, etc. And the central processor will take over all the service work - receive data from the network, build a candidate block, distribute work between video cards, monitor execution results, etc. By the way, the video card does not display anything on the monitor. Relatively speaking, the unit for displaying images on the monitor is not used and hangs like a dead weight. monitor execution results, etc. By the way, the video card does not display anything on the monitor. Relatively speaking, the unit for displaying images on the monitor is not used and hangs like a dead weight. monitor execution results, etc. By the way, the video card does not display anything on the monitor. Relatively speaking, the unit for displaying images on the monitor is not used and hangs like a dead weight.It was a breakthrough, and if you look at the performance graph of the Bitcoin network, you can clearly see a significant increase in it at the moment when mining on video cards appeared.
But this is not the ultimate dream.
ASIC
The modern electronic industry allows you to manufacture microcircuits according to your project. Those. you hire a microelectronics engineer (or a team of them), they draw and model something on a computer, and at the output they receive a drawing of the required microcircuit. There are stencils for etching crystals, etc. You give this drawing to the microcircuit manufacturer, and for your money he makes a series of microcircuits according to these drawings. The good news is that you can design a microcircuit that will most effectively solve a very specific problem. They are called so - specific-for-the-task-microcircuit, or in the bourgeoisie, Application-Specific-Integrated-Circuit (ASIC). In the world of electronics, such microcircuits are used very widely, just before the advent of mining, the general public, not associated with electronics, had not heard anything about it.Well, some of the wealthy miners did just that. We developed a chip and ordered its release on contract manufacturing. And in addition to income from mining, they also began to make money on the sale of these chips and devices based on them.
What are the advantages and disadvantages of these chips?
Roughly speaking, an ASIC for mining is a very small piece of a CPU. He knows very little. It is stupid to calculate the hash. Moreover, its scheme is carefully optimized to solve this problem. He cannot solve any other (except for a couple of additional) tasks. For the national economy, an absolutely stupid piece of iron. Well, it's like taking a car, throwing the body, gearbox, chassis, electrical wiring, interior, complex injection system into the trash, which selects the operating mode for a variety of loads, etc. And leave only the crankshaft, the pistons on it, the extremely simplified power supply and ignition system, and leave the fan on the shaft. But on the other hand, make not four cylinders, but a couple of hundred. The fan turns this device as it should, but it's absolutely impossible to ride such a thing. It is just as impossible to use it for anything other than spinning the fan. It will take about the same amount of iron as for a whole car, but damn the car for its ability to turn the fan at a fixed speed and does not stand next to this monster.It is clear that the efficiency of electricity consumption for calculating one hash is many times higher than that of a computer (and even a video card). Cost ... It's not that simple. Making chips is profitable only with huge batches, but here this issue seems to have been resolved. In general, for the price it turns out okay, especially if you count in the cost of one hash (well, not one hash, but a million hashes or a billion hashes - megahash and gigahash, respectively). In short, profitable.
Well, then we make a board where we insert these chips. This board knows how to interact with them, transfer tasks to them and receive results. There are several such chips on the board (by the way, such a board is shown in the picture for this article). And we combine several boards into one device - we get an ASIC miner. It also contains some small computer of the Raspberry PI type for organizing communication between these boards and the outside world (such a small power is quite enough here). A normal farm consists of tens (hundreds, thousands) of such ASIC miners. And although these devices are expensive, at the current bitcoin rate it is profitable to develop, buy and operate them. As soon as the rate falls below the profitability of these ASIC miners, they will cease to be produced and used.
The hash computation efficiency of such a scheme is not several times, but orders of magnitude higher than that of a conventional processor.
But this is somehow unfair. Because we create huge monsters who only know how to eat, and at the exit they give a small figure, which in itself does not mean anything to the national economy until it gets to the crypto market. And most importantly, in order to mine something, an ordinary computer will no longer be enough. You need special equipment (ASIC miner), which already costs good money (hundreds of thousands of rubles). This adds inequality to the network participants. And in the crypto community there is an implied, but not always explicitly expressed idea that the crypt is opposed to the dictates of world capital, and seems to give equal opportunities to the participants. Well, yes, this is a debatable question, especially since here it is refracted through my consciousness, and I am a bright idealist. Therefore, I will not insist on this thought.Just in case, let me remind you that "one order" is ten times. "Three orders of magnitude higher" is "a thousand times more."
Countering ASIC mining
In any case, such an ASIC is a trend, and indeed the idea of creating special devices for mining was not to the liking of very many. Therefore, the crypto community rushed to develop algorithms that would be unprofitable to implement using special devices.Well, how to develop ... They just took ready-made standard cryptographic functions (I must say that there are a great many hash functions in applied cryptography alone) and began to combine them. Well, like we take the candidate block, calculate the hash from it using this algorithm, then pass the result through the hash function using another algorithm, then add the calculation from something else, mix it according to the fifteenth algorithm, pass it through the forty-third algorithm, etc. ... This is one way. There are other ways to "counter" ASIC mining, but we won't dwell on that.
Why is this needed?
Here's why. The computational work that is done in this case is already very poorly simplified. And a two-hundred-cylinder monster with a fan cannot cope with it. He will have to add an injection controller, suspension, gearbox, body, etc. Those. designing a dedicated device will already be as difficult as (or close to) designing a conventional central processing unit. And central processors, for a minute, are developed by huge corporations with numerous development teams with a total IQ from here to Alpha Centauri. It is expensive and long to compete with them. And it would be okay to only develop ASIC ... But a number of algorithms in some cryptocurrencies are deliberately chosen so that large amounts of memory are needed for the calculation. And the modern memory subsystem in a personal computer is a rather confused thing, and the complexity of not only development, but even the use of third-party devices is quite expensive. What I mean is that if you decide to develop an ASIC that would be able to work with standard DDR4 memory modules (or any other, not old ones), then it will take a lot of effort, time and money to implement interaction with them. Developing your own version of DDR4 ... You get the idea.
In short, it is cheaper and more profitable to simply assemble a powerful computer than to develop special microcircuits that would calculate these algorithms cheaper and at least a bit more efficiently.
In general, there are a huge number of interesting cryptocurrencies where the methods for calculating the check number (this is no longer a hash in its pure form) are designed in such a way that mining with specialized devices is unprofitable. But for now, bitcoin with huge ASIC farms is still the leader in terms of capitalization. Bitcoin generally has a lot of ugly engineering solutions, but capitalization does not depend on engineering elegance. And in general, it is not awareness that rules the world, but greed, but this has nothing to do with money technology.
My task was to explain what an ASIC is. And I hope I coped with it.
