Getting started with blockchain | Miners traverse all random numbers, still can't get a positive solution, is the love vow wrong?

In "Why are some blocks not packaged, is the miner forgetting?" In the article, there are readers asking questions:

This question is sorted out as follows:

Assuming the latest block height is 10,000, it is dug out at 10:00, the miner quickly builds a block with a height of 10,000, and then at 10:05, Dabai released a deal at 10:06. The latest block was dug up, and the package was released to release the deal. Why? It stands to reason that when the new deal was released, the miners had already built up the candidate block, and the deal was definitely not in the candidate block that he originally built.

Today we will try to answer this question.

01
Mining is constantly trying random numbers

In the article "A classic story, let you understand Bitcoin mining in 3 minutes," the vernacular blockchain has been introduced. The process of mining is to continuously try random numbers and try to find a solution that meets the requirements. After constructing the block, the miner constantly tries random numbers until someone finds a random number that meets the requirements (the hash value of the block head ≤ target value), the new block is dug out, and the miner gets a block reward.

02 limited random number

The random numbers that can be tried in the Bitcoin system are limited, with only 2^32 possible values. After the miners build the block, iterate through all the random numbers and it is likely that the solution is still not met. In this case, what should the miners do? The hash function is characterized by a change in the input value: it can be to change the order, increase the content, reduce the content, etc., and the result of the output value will vary from day to day. So in this case, the miner can rebuild the block, for example, the other content is unchanged, package a just-released transaction into the block, and then try the random number. In this case, if you just find a solution that meets the requirements, new The block was dug up and the new deal was confirmed. This also answers the question we started with.

03 Other adjustment methods for miners

In the case that after traversing all the random numbers, the solution that meets the requirements is still not found, what other adjustment schemes does the miner have in addition to adjusting the transactions packaged in the block?

We know that the condition for dig out a new block is: the hash value of the block header ≤ difficulty target.

The block header content contains:

Excluding the random number field, the version field in the block header, the parent block header hash value, and the difficulty target are all determined and cannot be adjusted, and the range of the timestamp field is very limited. In this way, the Merkel root field is left in the part that is easy to adjust. The block header does not contain the transaction data of the block, but the hash value of the transaction information is taken, and then the hash value of the transaction is merged and then the hash value is taken until the final form a field, this field is formed. It is the Merkel root field, which will be stored in the block header.

▲Image from the network: Merkel tree

So when there is no suitable solution for traversing all the random numbers, the miner can adjust the transactions in the block: including the order of the transactions, increasing the packaged transactions, reducing the packaged transactions, etc. These adjustments will eventually result in the block header. The Merkel root has a hash value that affects the hash of the entire block header. But such processing is an auxiliary way, and miners are more common in modifying the extra random number of a particular transaction (Extra Nonce), which is relatively more efficient.

This special transaction is a coin-operated transaction in which bitcoin is awarded. The transaction was created "out of thin air" by the system, so the transaction is uninputted, meaning that its input field (input field) is empty by default. The miner can modify this field to find a solution that meets the requirements. The coin trading input field provides 8 bytes of space for additional random numbers. In other words, this expands the random number from the original 2^32 possibilities to 2^96 possibilities, and the miner traverses 2^96 species. Possibilities, generally can find solutions that meet the requirements.

It is also worth mentioning that the input field of this special transaction is still a "window" of many people's information, such as the "hand of the sacred fish , and the old man. The mermaid to winter and winter" is written in the coin transaction. In the input field.

If you are a miner and want to enter the domain "Show Love" in the coin trading, you should write the message "Xiu Enai" before the block is dug out, or wait until the block is dug out and then write it? why? Welcome to write your opinion in the message area.

——End——

Author | Yan Wenchun produced | vernacular blockchain (ID: hellobtc)

『Declaration : This series of content is only for the introduction of blockchain science, and does not constitute any investment advice or advice. If there are any errors or omissions, please leave a message.

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Bitcoin

Beware! FTX Users Targeted in Hilarious Yet Insidious Withdrawal Scam

Fashionista alert Reports of FTX users falling victim to phishing scam through enticing emails and withdrawals.

Blockchain

A picture to understand the difference between Bakkt's bitcoin futures and "traditional" futures

According to the delivery method, futures contracts are usually divided into cash delivery and physical delivery. At ...

Blockchain

Alameda Research's $200M Blow A Tale of Phishing Attacks and Poor Security Practices, as Confessed by Ex-FTX Engineer

Aditya Baradwaj has revealed that a file containing blockchain private keys and exchange API keys was left vulnerable...

Market

With the entry of big players and the halving narrative, is now the best time to buy Bitcoin?

Using the term "ups and downs" to describe the trend of BTC since June is not an exaggeration, or more precisely, it ...

Blockchain

"New and old" exchanges compete on the same stage, how can you play in the future? | Interview with SheKnows

Exchanges are an important part of the blockchain ecosystem. They interact directly with users and therefore change a...

Blockchain

The original market maker is not "Zhuang"? What is the significance of the coin safety ball recruitment market?

On September 30th, the company announced that it has launched the Global Markets Program and will recruit Market Make...