The principle and solution of POW hollow block

Bitcoin mining revenue consists of two parts, the first is the block reward; the second is the transaction fee. If you empty the block, you will not receive the transaction fee. Why do some mining pools do not need the fee to empty the block?

The principle and solution of POW hollow block

POW mining principle

Proof-of-work POW mining is the process of generating new blocks on the blockchain. Including BTC, BCH, ETH, LTC..., POW mining is based on the following logic.

Mining is like this, the system will give a target value, which is a number, for example, there are 18 zeros in front. Mining is to find a random number smaller than this target value, for example, there are 19 zeros in front. Once found, the block is dug. Keyword: random number. Key question: How is this random calculated?

This random number is obtained by hashing the latest height of the blockchain in the mining pool. Keywords: the latest height. Key question: What is the latest altitude?

Now a mining pool has dug a block and broadcasted it. We assume that the block height is 50W. Next, all mining pools will continue to mine behind this 50W height. The specific action is that the mining pool first assembles a new block. This new block contains the "block header" and the "block body filled with transactions". There are two special instructions in the block header. The first is the hash value of the parent block, here is the hash value of 50W height; the second is Nonce, which is a number, an adjustable number, starting from 0.

After assembling this new block, the miner will hash the new block ("50W+1" height) plus the previous block with a height of 50W. This new block is the "latest height" above.

The miner executes the hash once and gets a hash value, which is a binary number. The mining pool will compare this value with the target value. If it is less than the target value, congratulations, you have successfully mined the mine, otherwise, add 1 to the Nonce, then hash it, and then compare,...

Obviously, if a mining machine is used for hashing, you have to try to find a Nounce value that meets the target value, which is really slow. However, the mining pool can assign different Nounces to different mining machines to try. For example, there are a total of 1,000 mining machines in the mining pool. Set 0 to 1,000 for the first test; 1,0001 to 2000 for the second test... This is the parallelism of mining.

The principle of POW hollow block

For the above 50W height and the latest height block, we need to elaborate further. Before mining the latest height block chain, the mining pool must verify the 50W height block. If the verification is successful, it is legal to mine at the height of the newly assembled block of "50W+1". If the height of 50W is an illegal block, then all the mining pools must return to the height of "50W" to mine. Mine.

But it takes time to verify a block, because the software and hardware of each mining pool are different, we assume an average time, 10 seconds to verify a 1M block. Before the verification is over, the mining pool cannot confirm whether the block is legal or not, and cannot confirm whether the latest block with a height of "50W+1" should be added.

It also takes time to assemble a block with the latest height. It takes time to get a block template to start assembly, fill in the parent block hash value and select transactions in the memory pool to fill the block body. We assume that it takes 0.1 seconds.

When verifying the "50W" height block, and filling the transaction into the "50W+1" block, there is an advance, the filled transaction must not be the same as the packaged transaction in the 50W height. Otherwise, your latest height block will be illegal.

And it takes time for the block of "50W" height from mining to broadcasting to all mining pools. There are two steps to broadcasting a block. The first step is to broadcast the block header; the second step is to broadcast the block body. The block body is very small, only 80 bytes, which is smaller than a transaction. The broadcast is extremely fast, and all mining pools can get the block header very quickly. With the block header, the "parent hash value" of the new height block can be obtained. The block body is the part that contains all the transactions, and is generally very large, for example, 2500 transactions are close to 1M. The maximum BTC can be close to 1M, plus 3M segregated witness blocks. And BCH once packaged a 21M block body. It will take longer for all mining pools to receive the block body, which is called network delay. We assume that the network delay is usually 0.5 seconds.

The simplest way to mine in a mining pool is: as long as a mining pool gets the block body, it can confirm which transactions are in the block body. Only by verifying the entire block can we know whether this "50W" height block is legal. Then start to assemble the latest height block, and then mine to calculate the hash value less than the target value. How long does it take to get the block body, verify the entire block, and assemble the latest height block? 0.5+10+0.1=10.6 seconds.

If a mining pool mines according to the above process, it will not be able to mine during the 10.6 second period, and the mining machine will have invalid working time. And the mining machine is still consuming electricity when it starts up.

If a mining pool works according to the following process: get the block header, start to assemble a new block with a height of "50W+1", but because it is impossible to confirm whether the transaction in this 50W block is the same as the entire block It is legal, so for this "50W+1" height block, the mining pool does not fill the block body with additional transactions, but only fills a Coinbase reward transaction. This "50W+1" height block has only the block header, plus a Coinbase reward transaction-this is an empty block-and then directly starts mining. In this way, when a new block appears on the entire network, the mine only needs to wait for the time to get the block header and assemble the empty block, and then start mining. This time is very short, usually less than 0.5 seconds. This saves more than 10 seconds of time compared to 10.6 seconds.

According to the above process of mining, the mining pool receives the complete 50W height block body and verifies the 50W height block. This process takes 10.6 seconds. In the above 0.5 seconds to 10.6 seconds, if the mining machine calculates a random number less than the target value, the mining pool successfully digs an empty block. If the mining machine does not calculate a random number less than the target value, the mining pool will give up the 10.1 second mining time, and then change to assemble a new height block filled with the transaction height of "50W+1" for mining .

The above is the whole logic of hollowing out the block.

Optimize mining principle

In the principle of the above-mentioned empty mining, confirming the transactions in the "50W" height block is an important task. If these transactions can be known in advance, then assembling the "50W+1" height block, then these transactions can not be avoided. , Have you assembled some other transactions so that you don’t have to empty blocks.

Now the BTC and BCH networks have two technologies that can optimize the spread of this block body, which also allows all mining pools to quickly know which transactions are in the "50W" height. The first technique is called Bloom filter; the second is called compact block and thin block (Xthin block). (Compact block is developed by Core dev and Xthin is developed by unlimited dev. Both have the same function.)

Bloom filters are used to mark which transactions are in blocks with a height of "50W", just for identification. When the mining pool gets this mark, it knows which transactions are in it, and then the mining pool will go to its memory pool to find these transactions, list the transactions that it does not have, and then ask other nodes for the transactions that it does not have. To reach these unavailable transactions, reassemble a "50W" height block locally instead of downloading a "50W" height block from the network. This process is the principle of Compact block and Xthin block.

Through these two technologies, the network delay time can be compressed, but the time to verify the "50W" height block is still not compressed. The former is only 0.5 seconds, and the latter is 10 seconds.

With such a time gap, the mining pool still has to go to empty the block, otherwise the entire mining machine will be wasting electricity. It is important to know that this waste of 10 seconds is an extremely huge energy source for the entire network.

What to do then?

Completely solve the method of hollowing out the block

The above analysis analyzes the principle of emptying blocks and the principle of optimizing mining. The core reason for emptying blocks is that mining pools dare not fill the empty block of "50W+1" with transactions that already exist in the height of "50W".

If there is a way to ensure that there are absolutely no transactions that have appeared in the height of “50W” in the empty blocks assembled at the height of “50W+1” in the mining pool, wouldn't the problem be solved?

One way is to generate some transactions by the mining pool itself without broadcasting, but only save them in its own memory pool to fill empty blocks with a height of "50W+1".

But the mining pool cannot generate some meaningless transactions, otherwise it will be some garbage transactions, which is a waste of the network. It is certainly meaningful to package the transactions sent by users, but the transactions sent by users are often broadcast, and the risk of packaging conflicts with transactions in the "50W" height block.

Be sure to look for transactions that have not been broadcast.

One method is to cooperate with the mining pool and the exchange. The exchange does not broadcast the withdrawal transactions initiated by the user on the exchange, but sends it directly to the mining pool in an encrypted way through IP to IP. These transactions will never be Packed by "50W" height blocks. These transactions can reach the height of "50W+1" 100% without conflict.

If there are exchanges and mining pools that are the same company entity, then this method is very easy to implement. It is not the same entity, and the mining pool is still afraid of being pitted by the exchange. If the exchange blocks a broadcast transaction, it may be wasted an empty block reward.

However, this method will reduce the user experience of the exchange because the probability of emptying the block is low. How long will it take for these transactions to be packaged. Although the mining pool can be packaged in the mining of non-empty blocks, users also You have to wait for the block to be confirmed by this mining pool, which is a long time from the whole network.

Another method is that the confidential transactions submitted by the exchange to the mining pool are not user withdrawal transactions, but some scattered UTXOs pieced together into large UTXO transactions. This kind of transaction is a great optimization of the entire UTXO volume, and these transactions do not have a very strong time requirement. Suitable for packing by empty blocks.

Concluding remarks

Only need to consider the economy because the POW mining mechanism is the optimal setting, and morality should not be mixed in. All comments criticizing mining pools for emptying blocks are without confidence in the POW mining mechanism.

USB Charger

1000_11



Product advantages:
1. Stylish, portable, practical and convenient home charger
2. 6-port USB emergency charger, which can be used safely for tablet computers and can charge 6 devices at the same time
3. Built-in IC chip and fuse, protection: over current, over voltage, short circuit protection
4. The latest release, new design, beautiful appearance, high efficiency and energy saving, the best alternative to the original charger
5. Chargers for MP3, MP4, GPS, PDA, e-books, mobile phones, digital cameras, tablets, etc.

Features
(1) Overcharge protection
(2) Over discharge protection
(3) Short circuit protection
(4) Voltage stabilization protection.
(5) Automatic identification of mobile phone current protection.

1000_16

1. Connect up to 6 USB devices at a time, and each device will receive a unique and tailor-made charge. The maximum output power of QC3.0 is 18W, which can optimize the charging of all devices.
2.2QC3.0+4 ports total 6 charging ports, which can charge 6 devices with a total power of 84W at the same time
3. With multiple protection safety systems, the product will automatically adjust the charging current according to the needs of the device being charged. Automatically detect and adjust the charging current to charge your device at the fastest speed.

One machine for multiple uses
The USB charger can charge 6 devices at the same time, and the smart recognition technology will detect and provide the best charging level for each of your devices.
The maximum output current of a single USB port is 2.4A. 2QC3.0 has 6 charging ports, which can charge 6 devices at the same time without causing shunting or reducing power. The USB charger can quickly charge your devices. Smartphones and tablets can receive up to 2.4 amps of current, so you can use the device as you like while charging.
Over-current, over-charge, and short-circuit protection will make charging safe, without any risk of overheating or damaging the device. Passed CE/FCC/ROSH/PSE/CCC certification. Through safety certification to ensure safe use.


Usb Charger,Usb C Charger,Usb C Power Adapter,Portable Usb Charger

Shenzhen Jinziming Electronic Technology Co.,LTD , https://www.powerchargerusb.com