Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the Bitcoin technology writing process in the blockchain?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what is the bitcoin technology writing process in the blockchain". In the daily operation, I believe that many people have doubts about what the bitcoin technology writing process is in the blockchain. The editor consulted all kinds of data and sorted out the simple and useful operation methods. I hope it will be helpful to answer the doubts about "what is the bitcoin technology writing process in the blockchain?" Next, please follow the editor to study!

0) user submits transaction (personal supplement): an is a real person who wants to transfer money to B, A needs a client that uses bitcoin, select the amount transferred and B's wallet ID, click send. Bitcoin clients can get A's address, that is, A's wallet ID and electronic signature. As a result, all the information needed for a transaction is available except for the output of the previous transaction.

1) Node broadcast transaction: this transaction is sent to a Bitcoin system node N1 through the Bitcoin client. N1 receives this transaction information and broadcasts it to other nodes, which is asynchronous. There is no need to wait for other nodes to reply. Other nodes will also broadcast after receiving new transaction information.

2) Node packaging transaction: it is assumed that each node of the system has the ability to write data to the blockchain (in fact, a node writes data to the blockchain is to write to the local disk). Each node puts the valid transaction information it receives into a block and stores it locally, which we call the candidate block.

3) Mining: (proof-of-work) the word mining is very popular. We mentioned earlier that there is a nonce in the head of each block. the essence of mining is to use the computing power of the computer to find a suitable nonce, so that the decimal of all the information in this block after hash is small enough, for example, the first 70 digits are 0. Because the change in nonce affects the entire hash value, changing this nonce value can change the value after hash. Because this threshold is small enough and requires a lot of calculation, it usually takes 10 minutes to dig up the nonce, and the node dug to the nonce is qualified to write this candidate block to the local block chain, which proves the workload. This mining node can be called a miner.

Why don't these miners cooperate and each dig in a certain range? This is not feasible, because each miner has a different local candidate block, so the nonce value of each candidate block is also different, maybe you have a range where you can't dig the mine at all, so each miner has to dig on his own.

Why would anyone want to be a miner? People will not do anything thankless, because miners will harvest bitcoin when they dig into the mine. The money will be recorded at the beginning of each block in the form of a bill. Therefore, in fact, what each miner needs is the computing power and electricity of CPU. The higher the computing power is, the greater the probability of who can dig the mine is, the richer he will be, and who will continue to increase his computing power.

From this point of view, the time for the mine to be dug will be shorter and shorter, because the computing power of computers is increasing year by year. Here, Satoshi Nakamoto also designed that the difficulty of mining can be adjusted dynamically, that is, the threshold that the value after hash needs to be less than is adjustable. If you dig faster, turn it down a little bit, and if you dig slowly, turn it up a little bit. Stabilize the entire block chain at the level of adding one block every 10 minutes.

Therefore, the process of mining is summarized as follows: dig the mine that belongs to your candidate block and write the candidate block into the local block chain.

4) broadcast block: when this block B is written, the miner needs to broadcast B to other nodes.

5) verify the block and write: when the node receives a block B, it verifies whether the B meets the requirements and the transaction is legal, which means that there is no repeated consumption of bitcoin. B will not be recognized if the requirements are not met. If you meet the requirements, write B to the end of the local block chain.

6) continue to write: step 5) only write this block locally, so how can I tell others that I recognize this block? The method is as follows: if a new block is generated, it is appended to the end of B and the new block continues to be broadcast. This shows that this node believes in the validity of B and intends to add data after B.

Ideal mode of operation

An ideal working mode is to strictly follow that one node reaches the mine every 10 minutes, and a block can reach all nodes within 10 minutes.

For example: there are thousands of Bitcoin nodes, and one node at 1: 00 has a mine. You can write a block to the block chain and broadcast the block to all other nodes by 01:10, and all the other nodes have verified the block. and add the block to the local chain. At this point, the data of all nodes are consistent. At 01:10, another node was dug into the mine, so continue the cycle.

In this way, the data in the whole distributed system is always consistent, and the inconsistent time is no more than 10 minutes. Due to the strict control of the writing speed, there is no conflict in the system. So the system runs happily forever.

However, the reality is not so beautiful, perhaps 10 minutes there are two nodes dug to the mine, the chain will conflict, that is, the data is inconsistent. We will cover the issues of conflict resolution and double payment in the next section.

At this point, the study on "what is the writing process of bitcoin technology in the blockchain" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report