The word mining originated from a metaphor for cryptocurrency, and those who engage in mining are therefore called miner. When miners team up to mine by sharing resources, the sum of their computing power is called a mining pool. Mining is the core of the PoW consensus mechanism. In addition to digging out new coins, mining is also a mechanism that helps verify the validity of transactions and maintain network security.
Take Bitcoin (BTC) as an example. Bitcoin is a blockchain network, and all transactions and data are stored in the form of blocks. Every once in a while (about 10 minutes), a block containing transactions is generated in the Bitcoin network, and the process of generating blocks is the mining process. In the process, miners need to solve complex mathematical puzzles generated by the network.
This complex mathematical problem is built based on hash functions. Hash functions are a complex concept in cryptography. For now, we only need to think of the hash function as a mysterious black box. No matter what format of information you input into it, it will be processed (or hashed) into a unified format value, that is, a hash value.
In the context of mining, the input information is called a nonce. Since the value space of nonce is huge, it is almost impossible for miners to "guess" it without calculation. The miner who "pays" the most in the iterative calculation process that consumes a lot of time and energy will be recognized as the winner. This "payment" is the workload (Work) in the Proof of Work (PoW) consensus.
Miners need to perform iterative calculations (that is, repeated calculations) through the mining program to successfully complete the operation and dig out a new block. To put it simply, in this process, miners need to try out answers that meet the requirements one by one from massive amounts of data in order to successfully produce blocks.
The first miner (or mining pool) to successfully complete the operation will receive the reward. Currently, miners who successfully mine a block in the Bitcoin network receive 6.25 BTC. The number of Bitcoins awarded as a reward is halved every four years, with the next Bitcoin reward halving expected to occur around 2024.
In the mining process, expensive mining machines and other hardware are required to run the mining machines. Factors such as electricity and mining pool fees together constitute the cost. Among them, the resource cost invested in order to achieve the advantage of computing power and complete calculations first accounts for the majority.
Mining can provide more liquidity, and at the same time support trust building in decentralized systems and maintain network security through high costs of evildoing. Specifically, the combination of mining difficulty and the corresponding reward mechanism provides a security mechanism for the network, that is, through efficient computing power competition among miners, the network does not need to go through centralized institutions (such as banks in traditional markets). ), the verification and relay of transaction records and data can be completed.
As far as Bitcoin with a fixed maximum supply is concerned, as the number of unmined Bitcoins becomes smaller and smaller, the competition for mining computing power becomes increasingly fierce. Now an individual with ordinary computing power can no longer It is possible to mine Bitcoin, which brings risks related to centralization.
At the same time, the computing power of unsuccessfully mined blocks and the related hardware and resources invested are also regarded as an "unenvironmental waste". These factors have led many people to seek more sustainable and energy-efficient consensus protocols besides the mining-based PoW consensus, such as the Proof of Stake (PoS) consensus.