The discussion about AsicBoost and SegWit has become much quieter, but I still want to try to explain it from a technical perspective:
Before talking about these two things, we cannot do without a key word: Mining Bitcoin mining mechanism: Bitcoin mining mechanism uses the SHA256 algorithm, but the SHA256 algorithm is not done for the entire block, but only for the block header (Block Header). The following figure shows the composition of the block: From the above picture, we can see which fields are combined and then hashed to get the Block hash. The field with yellow background is the block header, which contains:
In a round of mining, the version number, the hash of the previous block, and the difficulty are all fixed. All miners need to do is to constantly modify the Nonce to change the hash value of the current block to find But the available search space for Nonce is not enough because the number of bits of Nonce is only 4 bytes . The number of bits occupied by each field in the Block Header is: A 4-byte Nonce means that its search probability space is When the search space of Nonce is insufficient, only Miners obtain new To summarize Bitcoin mining:
The above briefly describes the Bitcoin mining mechanism, but what about AsicBoost The process of calculating the hash of Such a padded SHA256=F(Chunk1)+B(Chunk2) Chunk1=(version)+(Previous hash)+F28(Merkle root) Chunk2=B4(Merkle Root)+Timetamp+Bits+Nonce+padding Combined with the above, a phenomenon occurs when calculating block hash:
This is a method to optimize mining . After the optimization, the Nonce is changed in the searchable space in each round, and the formula for calculating SHA256 becomes:
Basically all mining machines have done this optimization . Based on this optimization,
If we can find that the last four digits of
For timestamp, it is basically unchanged during a round of mining, while Nonce is traversed in the search space within 2 32. The remaining problem is to find enough Merkle Roots with the same last four digits, so that the calculation results of the latter part can be reused each time the Nonce is traversed, which effectively reduces the calculation and increases the probability of finding the block hash. As mentioned above, a new Merkle Root can be obtained by changing the transaction order, changing the Coinbase, etc., so that the Merkle Root with the same last 4 bits can be found through collision. What is the probability of finding the same hash with the same last 4 bits through collision? According to the "birthday paradox" (the probability that the last 4 bits of the same bytes are the same 32 bits), its probability is: There is a 50% chance that the last four digits of the hash will be the same after 77,000 collisions. How much can such a collision increase the probability? The AsicBoost white paper gives the following results: This optimization can theoretically improve the collision efficiency by 20%, and the performance improvement of merging is about 7%.
It can be seen that AsicBoost has only one technical optimization It is clear that AsicBoost neither destroys the current Bitcoin protocol nor produces unusable blocks, nor does it cause any security issues for Bitcoin. It can be said that all software and systems have the possibility of being optimized, and the history of Bitcoin mining is a process of continuously optimizing efficiency.
If there is a technology that improves the efficiency of Bitcoin mining, I hope that miners can apply this technology as soon as possible, so that attackers will not have a technical advantage over miners. After all, computing power is the foundation of Bitcoin security. If attackers are ahead of miners in technology, the possibility of Bitcoin being attacked will increase a lot. After introducing SegWit and AsicBoost SegWit (Segregated Witness) is isolated verification. Its application will change TX. It will adopt a new TX ID: Correspondingly, the Witness ID corresponds to In the output_data = WITNESS_COMMITMENT_HEADER + ser_uint256(uint256_from_str(hash256(ser_uint256(witness_root)+ser_uint256(witness_nonce)))) script = CScript([OP_RETURN, output_data]) The newly added output includes: OP_RETURN + WITNESS information + The calculation of This brings up a problem. If any transaction position is changed in If the AsicBoost used in SegWit obtains a new Merkle Root by changing the transaction order, the efficiency will be reduced because This is the impact of SegWit on AsicBoost. But we cannot ignore an important fact:
The way to change Coinbase to obtain SegWit and AsicBoost are not mutually exclusive, and it does not mean that AsicBoost optimization does not exist in SegWit. In SummarizeHow AsicBoost works:
SegWit:
Based on the above, the following conclusions can be drawn: AsicBoost is essentially just an optimization based on the block header structure and SHA256 algorithm.AsicBoost and SegWit are not mutually exclusive As long as the block header structure and SHA256 algorithm remain unchanged, SegWit will have an impact on the way transactions are exchanged in AsicBoost In SegWit, every change in transaction order will result in a change in Coinbase, which will require recalculation of If there is a better way to engineer AsicBoost, it will still work in SegWitIn addition to the inefficiency of changing the transaction order to update the Merkle Root, the engineering optimization AsicBoost method is still effective. For example, parallel computing, etc.
Share a Weibo post I saw: |
<<: The discovery of the Antbleed vulnerability caused a stir in the Bitcoin mining community
>>: User loses 70 bitcoins due to Bitcoin wallet exposure
The palm will have a certain impact on our fortun...
Whether a person's face is good or not actual...
Following the acquisition of the Libra (Diem) pro...
S-shaped eyebrows are very common. Generally spea...
Rage Review : Barclays Bank demonstrated the R3 C...
In addition to depending on one's living habi...
Face analysis of Berlin Film Award winner Liao Fa...
There are many different kinds of lines in the pa...
What does a bump on a woman’s nose mean? Physiogn...
On March 19, Bitmain, one of the world's top ...
Why is Terra spending billions of dollars to buy ...
Traditional physiognomy covers a wide range, among...
Naturally, everyone wants money, and the more the...
What is the fortune of a woman with high brow pea...
Recently, some customers reported that some minin...