Last updated: August 25, 2019 3:20 AM

When you hear about the “mining” of bitcoin, imagine that coins will be extracted from the ground. But bitcoin is not physical coin or money, so why do we call it bitcoin mining?

Because it is similar to the extraction of gold mining in which bitcoins exist in the design of the protocol (just as gold exists underground), but they have not yet been brought to light (just as gold has not yet been unearthed) . The bitcoin protocol specify that 21 million bitcoins will exist at some point in future. What the “miners” do is bring them out, one at a time.

They can do this as a reward for creating validated transaction blocks and including them in the blockchain.

How Bitcoin Mining Works

Nodes

Going back a bit, let’s talk about “nodes”. A node is a powerful computer that runs bitcoin software and helps keep bitcoin running by participating in the transmission of information. Anybody can run a bitcoin node, easily download the bitcoin software (free) and leave a certain port open (the drawback is that it consumes energy and storage space; the network at the time of writing occupies about 145 GB). The nodes distribute bitcoin transactions in the network. A node will send information to a few nodes that it knows, who will transmit the information to the nodes they know, etc. That way, you’ll end up touring the entire network quite quickly.

Some nodes are mining nodes (usually called “miners”). These group the pending transactions into blocks and add them to the blockchain. How do they do that? By solving a complex mathematical puzzle that is part of the bitcoin program and include the answer in the block. The puzzle that must be solved is to find a number that, when combined with the data in the block and passed through a hash function, produces a result that is within a certain range. This is much harder than it seems.

(For trivia lovers, this number is called “nonce,” which is a concatenation of “once used number.” In the case of bitcoin, the nonce is an integer between 0 and 4,294,967,296).

Solving the puzzle

How do you find this number? Guessing at random. The bitcoin software hash function makes it impossible to predict what the output will be. Then, the miners guess the mysterious number and apply the hash function to the combination of that guessed number and the data in the block. The resulting hash has to start with a preset number of zeros. There is no way to know what number will work, because two consecutive integers will give very different results. In addition, there may be several nonces that produce the desired result, or there may not be any (in which case the miners keep trying, but with a different block configuration).

The first miner to obtain a resulting hash within the desired range announces his victory to the rest of the network. All other miners immediately stop working on that block and start trying to discover the mysterious number for the next one. As a reward for his work, the victorious miner gets some new bitcoins.

Bitcoin Mining Works

Economics

At the time of writing, the reward is 12.5 bitcoins, which at the time of writing is worth almost $ 200,000.

Although it is not a deal as comfortable as it seems. There are many mining nodes competing for that reward, and it is a matter of luck and computing power (the more guessing calculations you can perform, the more luck you will have).

In addition, the costs of being a bitcoin mining node are considerable, not only for the powerful hardware needed (if you have a faster processor than your competitors, you have a better chance of finding the right number before them), but also for the large amounts of electricity consumed by the operation of these processors.

And, the amount of bitcoins awarded as a reward for solving the puzzle will decrease. Now it is 12.5, but it is reduced by half every four years or so (the next one is expected in 2020-21). The value of bitcoin in relation to the cost of electricity and hardware could increase in the coming years to partially compensate for this reduction, but it is not certain.

Difficulty

The difficulty of the calculation (the required number of zeros at the beginning of the hash chain) is adjusted frequently, so that the processing of a block takes on average about 10 minutes.

Why 10 minutes? That is the amount of time that bitcoin developers think is necessary for a steady and decreasing flow of new currencies until the maximum number of 21 million is reached (expected sometime in 2140).

If you got here, congratulations! There is still much more to explain about the system, but at least now you have an idea of ​​the broad scheme of programming genius and concept. For the first time we have a system that allows convenient digital transfers in a decentralized way, without trust and tamper-proof. The repercussions could be enormous.

Bitcoin and bitcoin mining images via Shutterstock.

Article Source: http://www.coindesk.com