The so-called "mining" means confirming the transactions that occur in the Bitcoin system within a period of time and recording them on the blockchain to form new blocks. People who mine are called miners. To put it simply, mining is the process of bookkeeping, miners are the bookkeepers, and the blockchain is the version.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
1. What exactly is "mining"
The so-called "mining" is to confirm the transactions that occur in the Bitcoin system within a period of time and record them on the blockchain. People who mine new blocks are called miners. To put it simply, mining is the process of bookkeeping, miners are the bookkeepers, and the blockchain is the version.
The accounting rights of the Bitcoin system are decentralized, that is, every miner has the right to accounting. As long as they successfully grab the accounting rights, the miners can obtain the newly generated Bitcoin rewards from the system. In this sense, mining is the process of producing Bitcoins.
When Satoshi Nakamoto originally designed Bitcoin, he stipulated that 210,000 blocks were not produced, and the Bitcoin reward was halved once until Bitcoin could no longer be subdivided, because the total amount of Bitcoin is limited, and Bitcoin Also known as digital gold. Bitcoin production is also commonly known as mining.
2. Necessary Tools for Mining
Bitcoin is produced through mining. Every 10 minutes, miners in the entire network calculate an arithmetic problem together. As long as the answer is calculated first, it is equivalent to mining this area. block, the miner will be rewarded with new Bitcoins from the system.
When Bitcoin was first born, mining could be done with a computer’s CPU. As more and more miners are mining, it is no longer possible to mine Bitcoins with CPUs. People are starting to use mining machines. Mining.
Essential tools for mining: 1. Mining machine; 2. Bitcoin address; 3. Mining software.
At present, the computing power of the Bitcoin network is too large. It is difficult for individuals to dig out blocks if they purchase a small number of mining machines. Many miners can only join mining pools to mine together; the mining farm is only responsible for calculation, and the mining pool is responsible. Information packaging. After mining Bitcoin, the income will be distributed according to the mining farm's computing power, which ensures a more stable input and output.
3. How miners mine
After the birth of the blockchain, miner is no longer just the abbreviation of coal miner, but has a completely new meaning. People engaged in virtual currency mining are different from traditional "miners". Miners in the blockchain field have more technological aspects. The main job of miners is transaction confirmation and data packaging.
Miners need to purchase a special computer equipment and download mining software. Mining does not require miners to do it themselves, and the computer performs specific operations entirely. For miners, just ensure the power supply and network connection of the mining machine.
Take Bitcoin as an example. Bitcoin mining machines are professional equipment that compete for accounting rights by running a large number of calculations to obtain rewards for new Bitcoins.
The composition of the mining machine includes: mining chip. Heat sink and fan. Only executing a single computer program consumes more power. Mining is actually a competition of computing power among miners. Miners with more computing power have a greater probability of mining Bitcoin.
As the computing power of the entire network increases, it becomes increasingly difficult to mine Bitcoin with traditional equipment. People have developed chips specifically for mining. The chip is the core part of the mining machine and generates a lot of heat during operation. In order to dissipate heat, Bitcoin mining machines are generally equipped with heat sinks and fans.
Users download the Bitcoin mining software on their computers, use the software to allocate the tasks of each mining machine, and then start mining. Each currency has a different algorithm and requires different mining machines.
4. Satoshi Nakamoto and “Mining”
Is mining necessary for blockchain? In order to answer this question, let’s first talk about what exactly is “mining”? Taking Bitcoin as an example, if a transaction is not generated, it is not considered completed. Only when the transaction data is written into the database can it be considered established and the other party can actually receive the money. First, all transaction data is sent to miners, who are responsible for writing these transactions into the blockchain.
The process of calculating hashes is called mining, the machine that calculates hashes is called a mining machine, and the person who operates the mining machine is called a miner. According to the Bitcoin protocol, the maximum size of a block is 1MB, and a transaction is approximately 500 bytes, so a block can include up to more than 2,000 transactions. Miners are responsible for packaging these more than 2,000 transactions together to form a block, and then calculating the hash of this block.
Satoshi Nakamoto deliberately made it difficult to add new blocks. His design was: on average, the entire network can generate a new block every 10 minutes, and only six can be generated an hour. Artificially setting a large amount of calculations and difficulty factors requires a lot of computing power to obtain the effective hash of the current block, and then add the new block to the blockchain. In order to be the first to add a new block into the blockchain, miners are full of competition. Whoever calculates it first can enjoy all the benefits of this block; while other miners can only copy that page. Paste it at the end of your account book, and then start a new accounting process. The cycle goes on and on, the account book increases page by page, and the account book becomes thicker and thicker. From this point of view, mining is actually a security mechanism that uses cryptographic hash functions and asymmetric encryption to ensure that the mining nodes of the blockchain network invest a lot of calculations before broadcasting blocks, increasing the cost of fraud and evil. , ensuring that existing data cannot be tampered with and ensuring that the entire network reaches a consensus.
The author believes that Satoshi Nakamoto’s starting point for designing this mechanism is to avoid attacks on the system. If an attacker wants to attack by messing with the ledger, they need enough computing power. When the benefits are not enough to offset the costs, attackers have no incentive to attack the system. Therefore, for blockchain, it is still necessary to establish a mining mechanism, but more reasonable and efficient solutions will definitely be produced in the future.
For more computer-related knowledge, please visit the FAQ column!
The above is the detailed content of What is the principle of network mining?. For more information, please follow other related articles on the PHP Chinese website!