Hearing about cryptocurrency mining, you picture coins while they are pulled out of the ground. But considering that cryptocurrency is hardly of the physical world, why do we actually call it mining?
Because it’s like gold mining, with bitcoin existing in the protocol’s design (as you would find gold underground), except that they haven’t been exposed to the light yet (gold that hasn’t been extracted). Based on the cryptocurrency protocol, 21 million bitcoin will exist at a certain point. Miners get them out gradually and in sets.They are able to do this as a prize for constructing blocks of validated transactions and making them a part of the blockchain.
Cryptocurrency software runs on a unique and dedicated computer known as a node.Because this computer plays a part in the information transfer process, it thus helps keep cryptocurrency running.Certain nodes are mining nodes (also known as miners). They work by grouping outstanding transactions into blocks and adding them to the blockchain.
The process requires solving a difficult math problem that comes as part of the cryptocurrency program, after which the answer will be added to the block. The idea is to discover a number which gives an outcome in a particular range when it is incorporated into the data in the block and goes through a hash function.
Solving the Problem
What should be done to find this number? By making random guesses. Because of the hash function, output predictions are completely impossible. Therefore, miners just take a wild guess at this all-important number and run the hash function on that number and the data in the block.
The hash that comes up needs to begin with a preset number of zeroes. It is impossible to know which number will actually work, as results can very widely with any two consecutive integers.Moreover, there can be a lot of nonces that lead to the intended result, or there can be none.
The miner that first gets a resulting hash in the intended range will tell the rest of the network about its victory. At his point, other miners will instantly stop work on that certain block and begin with the succeeding one.
The triumphant miner then receives some new cryptocurrency as a prize. Since calculation difficulty (on the number of zeroes that are required at the start of the hash string) changes often, it can take some ten 10 minutes to finish with one block. Such is how much time cryptocurrency developers think will be needed to have a steady and decreasing flow of new coins until the 21 million max, which is said to happen within the year 2140.