Brother
Professional
- Messages
- 2,590
- Reaction score
- 544
- Points
- 113
I am sure you have known for a long time that miner is translated as miner. But what does the mine have to do with it? Why cryptocurrency miners? What's going on, why are all these people?
In past publications, I told what is blockchain like in bitcoin blockchain new coins appear, and what is hash and why is it needed.
Now we have all the basic information in order to figure out what the work of a miner is, and where gigawatts of electricity are leaking.
In the simplest terms, the miner is doing absolutely useless work. For this useless work, the entire Bitcoin blockchain spends more electricity per year than Denmark, Belarus or Bulgaria consume.
More precisely, how to say ... The activities of miners have a side positive effect - the formation of blockchain blocks, as well as the emission of new coins. But the calculations themselves, which are performed in mining farms, have absolutely no payload at all. In these calculations, a model of the universe is not calculated, there is no mathematical modeling of new drugs, and some abstract scientific theory is not even tested. The direct meaning of the calculations that are performed at the miners' capacities is completely absent. All the benefits of these calculations are purely incidental.
More precisely, it was for this side benefit that everything was started, but everything looks as if we were burning the forest just in order to get black paint from the ash. No one was warmed, quality wood was actually thrown away, but we got ash, which at the very least we put into business.
Is it really necessary to burn so much energy for all this to work? Not really. In theory.
However, instead of admiring beautiful metaphors, let's look at the heart of the matter.
So, we have many copies of the database (in the sum, this is a blockchain). And we need a way to keep these copies in sync (to make them the same). Moreover, we remember that we do not have some kind of central administrator of this entire database, i.e. some way is needed by which the participants can coordinate their own actions to synchronize this common database.
If everyone just starts randomly sending messages to each other about a new added record, then the network will begin real chaos. It would be nice, at least, to somehow structure these records and regulate the time when they enter the database.
Therefore, it was proposed to organize the records into blocks. But who would do it? The idea behind blockchain is peer-to-peer, i.e. there is not and cannot be any one network regulator. All nodes in the network are equal. We need to come up with some kind of mechanism so that each member of the network can apply its hot processor to the formation of the block.
So they decided: let everyone who wants to form a block. And so that there are no conflicts, all the nodes compete in performing some difficult task, and whoever decides first won. No one is offended, because the task is the same for everyone in terms of complexity. Well, to make people want to solve it, a reward was established for solving the problem. Whoever wins - bitcoins. It is very remotely just like working in a mine: you have to make a lot of effort, and at some point someone gets lucky and he finds a big diamond. In general,
ore is being mined, diamonds are found, lave is turbid (the blockchain network is working).
If the reward is not established, no one will have an incentive to maintain the network and solve its problems. Pure volunteering, which is not always the case.
In general, based on the above, it is clear that both the mathematical problem itself and the competitiveness in its solution are a rather artificial idea. And all this is needed exclusively for organizational tasks. But whatever one may say, it turned out that it all works great. For nine years now we have seen this confirmation.
What is this task?
This is where the hash comes in handy, which, in fact, was invented for completely different purposes. But, damn it, he fits in very well here.
Let me remind you that a hash is a unique digital characteristic of some block of information. And the algorithm for calculating the hash is specially designed so that it is impossible to recover the original data from the hash itself. It will not be possible to restore the contents of the book from the serial number of the book on the shelf.
Those. in order to find the source text for a given hash, it would be necessary to simply go through an almost infinite number of random texts, then calculate the hash for each of them in the hope that one day it will match. Therefore, there remains only an overkill, and this is the only way. And I wrote last time that the size of the number that is generated by some hash algorithms is such that it will be enough to number all the electrons in the Universe. Well, how are we going to pick it up? Find an electron with a specific number?
But this is too much! Therefore, a simpler task is used in the blockchain.
Bitcoin is not looking for a specific initial value, but such that it gives a hash that obeys a certain inequality. Due to this, the complexity of the problem can be flexibly regulated (through a change in the inequality parameter). It is as if in a mine it was possible to regulate the density of distribution of diamonds in the rock. In general, the hash value for a block of information is unpredictable, that is, one might say, randomly. Therefore, the problem is solved purely by chance (like a diamond is accidentally found in a diamond mine). The essence of the miner's work can be very roughly described as digging in a mine in search of diamonds. Search for the right number among the many unnecessary ones.
And now a little specifics.
We have several transactions that need to be formed into a block. We build them up, add them with the first transaction "credit me 12.5 bitcoins", we fill in some more required fields of the block (which include a link to the previous block and its hash - this is necessary for the integrity of the entire database), and we get a block candidate. But the block must have one more field, nonce. It is completely meaningless and is only needed so that the miner has something to do. So, we take the candidate block and set nonce = 0. We count the hash from the whole block. Damn, it does not fit the inequality. We set nonce = 1, counting the hash, again bypass.
And so - until a lucky chance occurs. Or until someone else finds a solution to his candidate block. And his block candidate differs from ours in at least the first transaction, because in our candidate we indicate our wallet in this transaction, and the other miner indicates his wallet. Whoever finds a suitable nonce faster will replenish the wallet. That's the whole point of mining ...
As you can see, the winner is the one who goes over faster. Who digs ore faster in the mine. One - with a children's shovel, the second - with a multi-bucket excavator. And the power of "ore mining" is measured in hashes per second. More precisely, now, perhaps, already in gigahashes per second. Although no, the entire biktoin network has exahashes. Dofigaheshi.
It is clear that the total power of all miners is growing, and this must be taken into account somehow, otherwise chaos will begin. So, the system once in 2016 takes blocks and slightly changes the parameter of the inequality to be solved so that one block is found again every 10 minutes. If there are fewer miners, inequality will become simpler. If it gets bigger, it gets more complicated. But on average, the block will be again once every ten minutes. As it were, the density of diamonds in the mine is regulated. We change the probability of finding a solution.
If there are a lot of miners, the number of diamonds sharply decreased. Therefore, it does not matter at all how many miners there are on the network. All of them, in the end, sweep the parade ground with a crowbar, i.e. doing work "to get bored". More precisely, "to fuck with these hashes for at least ten minutes."
So the calculations that miners do are completely useless, and are used only because this task (the task of finding the right nonce to get a suitable hash) can not be tricked in any way, only sequential brute force, only hardcore. Only sweaty Ramstein.
Unfortunately, so far this is one of the few ways to make egoists work for the common good. Selfish - I mean all of us, humanity.
PS Trying to remember the name of the nonce field, I rummaged through several sites and was amazed at the number of articles on the topic of "finger mining" all over the Internet. Honestly, I still cannot understand why this cryptocurrency topic is so interesting to my subscribers (judging by the likes on previous posts, this is exactly the case), because so many excellent texts have been written? Only the lazy don't mine .. uh ... don't write about it. Of course, it's convenient for me to think that I'm all such a great storyteller, but somehow it's too vain. Dear friends, do not consider it a work explain to me
In past publications, I told what is blockchain like in bitcoin blockchain new coins appear, and what is hash and why is it needed.
Now we have all the basic information in order to figure out what the work of a miner is, and where gigawatts of electricity are leaking.
In the simplest terms, the miner is doing absolutely useless work. For this useless work, the entire Bitcoin blockchain spends more electricity per year than Denmark, Belarus or Bulgaria consume.
More precisely, how to say ... The activities of miners have a side positive effect - the formation of blockchain blocks, as well as the emission of new coins. But the calculations themselves, which are performed in mining farms, have absolutely no payload at all. In these calculations, a model of the universe is not calculated, there is no mathematical modeling of new drugs, and some abstract scientific theory is not even tested. The direct meaning of the calculations that are performed at the miners' capacities is completely absent. All the benefits of these calculations are purely incidental.
More precisely, it was for this side benefit that everything was started, but everything looks as if we were burning the forest just in order to get black paint from the ash. No one was warmed, quality wood was actually thrown away, but we got ash, which at the very least we put into business.
Is it really necessary to burn so much energy for all this to work? Not really. In theory.
However, instead of admiring beautiful metaphors, let's look at the heart of the matter.
So, we have many copies of the database (in the sum, this is a blockchain). And we need a way to keep these copies in sync (to make them the same). Moreover, we remember that we do not have some kind of central administrator of this entire database, i.e. some way is needed by which the participants can coordinate their own actions to synchronize this common database.
If everyone just starts randomly sending messages to each other about a new added record, then the network will begin real chaos. It would be nice, at least, to somehow structure these records and regulate the time when they enter the database.
Therefore, it was proposed to organize the records into blocks. But who would do it? The idea behind blockchain is peer-to-peer, i.e. there is not and cannot be any one network regulator. All nodes in the network are equal. We need to come up with some kind of mechanism so that each member of the network can apply its hot processor to the formation of the block.
So they decided: let everyone who wants to form a block. And so that there are no conflicts, all the nodes compete in performing some difficult task, and whoever decides first won. No one is offended, because the task is the same for everyone in terms of complexity. Well, to make people want to solve it, a reward was established for solving the problem. Whoever wins - bitcoins. It is very remotely just like working in a mine: you have to make a lot of effort, and at some point someone gets lucky and he finds a big diamond. In general,
ore is being mined, diamonds are found, lave is turbid (the blockchain network is working).
If the reward is not established, no one will have an incentive to maintain the network and solve its problems. Pure volunteering, which is not always the case.
In general, based on the above, it is clear that both the mathematical problem itself and the competitiveness in its solution are a rather artificial idea. And all this is needed exclusively for organizational tasks. But whatever one may say, it turned out that it all works great. For nine years now we have seen this confirmation.
What is this task?
This is where the hash comes in handy, which, in fact, was invented for completely different purposes. But, damn it, he fits in very well here.
Let me remind you that a hash is a unique digital characteristic of some block of information. And the algorithm for calculating the hash is specially designed so that it is impossible to recover the original data from the hash itself. It will not be possible to restore the contents of the book from the serial number of the book on the shelf.
Those. in order to find the source text for a given hash, it would be necessary to simply go through an almost infinite number of random texts, then calculate the hash for each of them in the hope that one day it will match. Therefore, there remains only an overkill, and this is the only way. And I wrote last time that the size of the number that is generated by some hash algorithms is such that it will be enough to number all the electrons in the Universe. Well, how are we going to pick it up? Find an electron with a specific number?
But this is too much! Therefore, a simpler task is used in the blockchain.
Bitcoin is not looking for a specific initial value, but such that it gives a hash that obeys a certain inequality. Due to this, the complexity of the problem can be flexibly regulated (through a change in the inequality parameter). It is as if in a mine it was possible to regulate the density of distribution of diamonds in the rock. In general, the hash value for a block of information is unpredictable, that is, one might say, randomly. Therefore, the problem is solved purely by chance (like a diamond is accidentally found in a diamond mine). The essence of the miner's work can be very roughly described as digging in a mine in search of diamonds. Search for the right number among the many unnecessary ones.
And now a little specifics.
We have several transactions that need to be formed into a block. We build them up, add them with the first transaction "credit me 12.5 bitcoins", we fill in some more required fields of the block (which include a link to the previous block and its hash - this is necessary for the integrity of the entire database), and we get a block candidate. But the block must have one more field, nonce. It is completely meaningless and is only needed so that the miner has something to do. So, we take the candidate block and set nonce = 0. We count the hash from the whole block. Damn, it does not fit the inequality. We set nonce = 1, counting the hash, again bypass.
And so - until a lucky chance occurs. Or until someone else finds a solution to his candidate block. And his block candidate differs from ours in at least the first transaction, because in our candidate we indicate our wallet in this transaction, and the other miner indicates his wallet. Whoever finds a suitable nonce faster will replenish the wallet. That's the whole point of mining ...
As you can see, the winner is the one who goes over faster. Who digs ore faster in the mine. One - with a children's shovel, the second - with a multi-bucket excavator. And the power of "ore mining" is measured in hashes per second. More precisely, now, perhaps, already in gigahashes per second. Although no, the entire biktoin network has exahashes. Dofigaheshi.
It is clear that the total power of all miners is growing, and this must be taken into account somehow, otherwise chaos will begin. So, the system once in 2016 takes blocks and slightly changes the parameter of the inequality to be solved so that one block is found again every 10 minutes. If there are fewer miners, inequality will become simpler. If it gets bigger, it gets more complicated. But on average, the block will be again once every ten minutes. As it were, the density of diamonds in the mine is regulated. We change the probability of finding a solution.
If there are a lot of miners, the number of diamonds sharply decreased. Therefore, it does not matter at all how many miners there are on the network. All of them, in the end, sweep the parade ground with a crowbar, i.e. doing work "to get bored". More precisely, "to fuck with these hashes for at least ten minutes."
So the calculations that miners do are completely useless, and are used only because this task (the task of finding the right nonce to get a suitable hash) can not be tricked in any way, only sequential brute force, only hardcore. Only sweaty Ramstein.
Unfortunately, so far this is one of the few ways to make egoists work for the common good. Selfish - I mean all of us, humanity.
PS Trying to remember the name of the nonce field, I rummaged through several sites and was amazed at the number of articles on the topic of "finger mining" all over the Internet. Honestly, I still cannot understand why this cryptocurrency topic is so interesting to my subscribers (judging by the likes on previous posts, this is exactly the case), because so many excellent texts have been written? Only the lazy don't mine .. uh ... don't write about it. Of course, it's convenient for me to think that I'm all such a great storyteller, but somehow it's too vain. Dear friends, do not consider it a work explain to me