Anyone who has already dealt a little with Bitcoin has most likely stumbled across the term “mining”. But what is mining and how does it work? What is needed for the mining process? What is a hash and how is it generated? What is a mining pool? In this post, you will learn all the important basics about mining.
What is mining?
In the mining process, computing power is provided to process transactions, secure and synchronize network participants. The goal of this process is to combine the individual blocks into a blockchain via a decentralized peer-to-peer network. In the process, all blocks have a so-called “hash value”, which contains a kind of check number for all transactions.
Traditionally, the term “mining” comes from the mining industry and refers to the search for, development, extraction and processing of mineral resources from the upper earth’s crust using machines and tools. Unlike traditional mining, a Bitcoin miner receives a reward in the form of Bitcoins for providing computing power. The reward that each miner receives for solving complex cryptographic tasks is halved after each “halving”. Thus, over time, fewer and fewer newly generated Bitcoins come onto the market. It is important to understand that the actual purpose of mining is not to issue new Bitcoins; this is merely the incentive for securing the network. Rather, mining is a decentralized security mechanism.
How Bitcoin mining works
The purpose of mining is to create new blocks that are used to log and document blockchain activity and then add to the blockchain. Adding blocks creates new Bitcoin and simultaneously confirms a portion of new or pending transactions. This process can be understood as decentralized “money creation.” At the same time, it secures the network against potentially “bad actors”. This is ensured by the fact that the Bitcoin Blockchain only appends a block to the blockchain when more than half of the miners find a transaction to be correct and confirm it. Thus, to manipulate the Bitcoin blockchain, more than half of the network would have to be under the control of the “bad actor.” This is too expensive due to the high power consumption involved in the proof of work consensus algorithm. However, this high power consumption and the resulting high costs are also the reason why the Bitcoin network is considered very secure. To make this effort worthwhile for the miners, each miner who generates a valid block receives a reward in the form of currently 6.25 Bitcoin, as well as the fees from the included transactions. After a new block is verified, this state of information is transmitted to all Bitcoin nodes in the network as a new, longer blockchain.
The role of the blockchain
The blockchain itself can be understood as a ledger of accounts, which contains every transaction already made, including information about which wallet address transferred how many coins, when, to which wallet address. The blockchain can be viewed by every network participant and thus offers complete transparency. All blocks contain a summary of all transactions already made and are basically a series of hashes. Each hash is created using the so-called SHA256 algorithm, a cryptographic hash function standardized by the U.S. National Institute of Standards and Technology.
What is needed for the mining process?
The original vision of the Bitcoin creator, known by the pseudonym Satoshi Nakamoto, was that anyone with a standard computer could participate in the mining process. After this worked well in the early years, the process was quickly replaced by specialized hardware. Today, Bitcoin mining is only worthwhile with special hardware, such as ASIC miners, which are manufactured solely for the mining process. In order to join the network, each network participant must install the Bitcoin Client. This software contains a copy of the entire blockchain. This is important so that the network cannot be manipulated. If a computer on the network is hacked, it is automatically removed from the network.
What is a hash and how is it generated?
Hashes are nothing more than hexadecimal numbers that have to be calculated. The hash value represents the result of a calculation task that must be solved by the mining process. The underlying arithmetic problem must be solved without changing the transaction that has taken place. The miners have to guess a nonce (“number only used once”), which in the Bitcoin example is 32 bits in size. The nonce is then added to the values of the block to be created and re-hashed in its entirety. The reward is only released when a miner has found the matching nonce to the matching hash. If the number of miners increases, the so-called “difficulty” of the search increases. If the number of miners decreases, the difficulty decreases.
The role of the difficulty
The difficulty is a measure of how difficult it is to search for a certain hash. Considering various factors, it is continuously updated. The factors include the number of active miners in the network, as well as the available computing power. Currently, each miner who has found a block and added it to the blockchain receives 6.25 Bitcoins. This happens about every 10 minutes. The difficulty mechanism ensures that hashes cannot be processed too quickly in too large a quantity and that searching for and finding the pairings of nonces and hashes described above requires more time and computing capacity. Like clockwork, the difficulty is readjusted every 2016 ticks. Without this process, all 21 million bitcoins ever available would have already been mined.
Because finding a block is becoming increasingly difficult and is associated with enormous computing effort, it is often no longer worthwhile to mine as an individual. The probability of finding a block as an individual and thus receiving the block reward of 6.25 Bitcoin is very low. Therefore, it makes sense to mine Bitcoin in so-called “mining pools”. In this process, a large group of miners join together and combine their hash rates. In this way, they increase their chances of receiving block rewards. These are distributed after finding a block depending on the computing power.