consensus mechanism
As mentioned earlier, the Bitcoin network is equivalent to the global account book, each node has the same complete ledger, which is also an important strategy of the Bitcoin security mechanism, it determines that the transactions that have occurred cannot be tampered with. But when the accounting of each of the various, will inevitably produce synchronization and chaos, so can only be accounted for by one person, and then sync to other people good. Then who will be responsible for the bookkeeping?
This requires the introduction of a new concept called the consensus mechanism. Bitcoin uses a consensus mechanism of proof of effort to determine the right to account, that is, who proves that their workload is large, who will be the accounting. The amount of work is calculated by calculating the hash value of the chunk header so that it meets enough difficulty targets to prove who is to be accounted for as early as is reached. Because this process (access to accounting rights) costs a lot of computing, it will receive a Bitcoin reward (the bonus for the new block and the transaction fee for that period). Digging Mine
The process of competing for the right to account is called "mining", and all the nodes involved are called "miners". Because the process is similar to that of precious metals, it is called mining. The difficulty target of mining is as shown in the figure:
Hash Value
A string of 16 binary numbers with a length of 64 bytes. Difficulty Target
The first 17 bytes are all 0 (the data is from 2015, about 62 of the 17-square operation is required). Time
Each time a valid hash value is found for approximately 10 minutes, the Bitcoin network adjusts the difficulty target every two weeks to ensure that the full net count is able to find a valid hash value in 10 minutes. ore-Digging process
In every 10 minutes, the miners constantly combine the received trade orders (which are verified at the same time), the rewards they receive, the hashes of the latest chunks, calculate the new hashes, see if they meet the difficulty target, and, once satisfied, generate new chunks and broadcast them.
If it is not met and a new chunk is received, which means that the right to compete for the title fails, the process is reset until the calculation succeeds.
If a node has any cheating, will lead to other node verification does not pass, will directly discard its generated chunks, it can not be recorded in the total ledger, cheat nodes are wasted computing power. Therefore, under the huge mining cost, the miners voluntary the consensus agreement, also ensured the reliability of the Bitcoin system. Summary
Mining is the currency distribution mechanism of Bitcoin, its purpose is not to get rewards, but to adjust the behavior of miners in this way, to achieve the most important cornerstone of Bitcoin security: The automatic consensus mechanism to centralized.