Talking about mining to obtain Bitcoin

in #bitcoin4 years ago

Foreword: Before writing this article, I checked the Bitcoin white paper and some web blogs. Through repeated understanding and thinking, I now talk about my understanding of Bitcoin, which is also a summary of my own learning, and I hope to share with you.

First of all, we have to understand that Bitcoin and blockchain are two concepts. Blockchain is a technology, this technology is a decentralized technology, and Bitcoin is the first application of this technology. What exactly is decentralization? For example, traditional banks and third-party payment institutions apply centralized technology, and their role is to trust intermediary. And decentralization is a direct peer-to-peer transaction without any third party. It is based on cryptographic principles and not based on trust. It eliminates the possibility of rolling back payment transactions, that is to say, transactions generated by using blockchain technology It cannot be rolled back.

There may be some students who are still a blank paper about Bitcoin, so let me give you an easy-to-understand example to help you build a model in your mind:

In a closed small fishing village, fishermen live by fishing. Now Xiao Wang wants to give Xiao Liu 5 fish: Then the idea of ​​using Bitcoin is:

Xiao Wang first told the whole village about the loan of 5 fish to Xiao Liu;

After the villagers found out, they went to Xiao Wang’s house to confirm that Xiao Wang had enough fish for Xiao Liu, and then the villagers wrote in their notebooks that there were 5 less fish from Xiao Wang’s family and 5 fish from Xiao Liu’s family;

Then the villagers went out to fish and passed on the fact that Xiao Wang lent 5 fish to Xiao Liu. Everyone knows about it and ensures the consistency of the ledger.

Then there must be some fishermen who are unwilling to do this in vain. In order to solve this problem, the big guys unanimously decided who would first confirm that Xiao Wang lent 5 fish to Xiao Liu and give a fish a reward, so everyone would actively do it. this matter.

So where did the reward come from? This is the birth of Bitcoin today. Mining is actually a process of recording transaction information and packaging it into blocks. The Bitcoin system generates a block every ten minutes, and the first person to pack this block will receive a certain Bitcoin reward.

A total of 2,100W bitcoins are issued, and a certain number of bitcoins are rewarded for each block for every 10 minutes. At the beginning, each block rewards 50 bitcoins for mining, and then every 21,000 blocks rewards are halved (the reward is halved every 4 years), and now every block generated is rewarded 12.5 bitcoins. The generation time of each block is 10 minutes, but with the development of computer technology, the current mining power is constantly increasing, so the time to generate a block must be less than 10 minutes, which requires certain control measures to ensure this time . This measure is the difficulty of mining. If the output time of each block is less than 10 minutes, the difficulty of mining will be increased, and the difficulty of mining will be reduced if the output time of each block is less than 10 minutes. The difficulty adjustment time is 2016 blocks, which is 2 weeks.

The mining difficulty will be adjusted automatically after every 2016 blocks, and all nodes will automatically adjust according to a certain formula. This formula is based on the latest, which is the time spent on 2016 blocks in this cycle and the expected time (the expected time is 20160 minutes, which is two weeks. ) Comparison.

New difficulty = old difficulty value * (the time spent in the past 2016 blocks / 20160 minutes)