【Cold Knowledge】Joint Mining Principles and Benefits

【Cold Knowledge】Joint Mining Principles and Benefits

At present, most mining pools have launched mining coin-increasing services, such as giving away NMC, ELA, and Vcash for mining Bitcoin, and giving away Dogecoin for mining Litecoin, etc. This is due to the technical realization of joint mining.


In joint mining, the currencies are divided into main chain and auxiliary chain. For example, in joint mining of Litecoin and Dogecoin, Litecoin is the main chain and Dogecoin is the auxiliary chain. The auxiliary chain can verify its own blocks with the help of the computing power of the main chain without affecting the normal block generation of the main chain. For example, in joint mining of Litecoin and Dogecoin, the income of Litecoin miners will not be affected at all, and they can also mine more Dogecoin income, killing two birds with one stone. So how is the joint mining technology realized? This article will take you to find out.


01

Principle of Joint Mining

1. Block structure


For the POW mining block structure, click to view "[Mining from Beginner to Mastery] [Beginner's Edition] POW Mining Logic Process"


Joint mining has no effect on the block structure of the main chain. The mining pool only needs to add the block header hash value information of the auxiliary chain block to the ExtraNouce 1 field of the coinbase of the main chain, a total of 44 bytes.


POW block coinbase analysis, click to view "[Mining from Beginner to Mastery] [Beginner's Edition] How the mining pool issues tasks"


For example, if BTC and NMC are jointly mined, the ExtraNouce1 information in BTC's coinbase contains the following fields:


  • magic // As an identifier, the following fields are related to joint mining


  • nmc_block_header_hash // NMC block header hash


  • merkle_size // Set to 1 when there is only one auxiliary chain


  • merkle_nonce // Set to 0 when there is only one auxiliary chain


Bitcoin block at height 599722 Source: BTC.com


The above picture shows the coinbase transaction of the Bitcoin block with a height of 599722 that was exposed on October 17, 2019. Its field input field is "��]e/BTC.COM/��mm�j�+�,^S��Ƒ;]&��# t%!iUO�=<�r�� X��" .


mm indicates that the 44 bytes starting from mm are the auxiliary chain information of the joint mining. In addition, there is a BTC.com mining pool logo in ExtraNouce1. Generally, block browsers use this logo to determine the mining pool of the block explosion.


The block structure of the main chain does not change, but the block structure of the auxiliary chain needs to be changed significantly.


The auxiliary chain needs to add an AuxPOW structure to the original block structure (block header, transaction list). Taking BTC and NMC joint mining as an example, this structure mainly includes the following parts:


  • btc_coinbase_txn //BTC coinbase transaction


  • btc_block_header_hash //The hash value of the BTC block header

  • btc_coinbase_branch //merkle_branch of BTC's coinbase

  • nmc_blockchain_branch //NMC's merkle_branch

  • btc_blockheader //btc block header


Because the block structure of the joint-mining auxiliary chain is different from the traditional POW block structure, the auxiliary chain currencies that originally do not support joint-mining need to be upgraded or hard-forked. For example, Dogecoin supports LTC joint-mining after hard forking.


2. Annex chain verification process


Verification method:


The traditional POW mechanism verifies whether a block has exploded:


hash(BlockHeader) < Difficulty Target


For the logical process of POW mining, click to view "[Mining from Beginner to Mastery] [Beginner's Edition] The logical process of POW mining"


In joint mining, the verification of the auxiliary chain's verification block is verified in two steps:


1. Verify hash (BlockHeader of the main chain) < Auxiliary chain difficulty target


2. Verify that the auxiliary chain’s block is indeed associated with the main chain’s BlockHeader.


Take BTC and NMC joint mining as an example. Since BTC is a typical POW block explosion mechanism, it is necessary to continuously change the value of the variable field to calculate the hash (BlockHeader) to meet BTC's own block explosion difficulty target. Therefore, after NMC and BTC jointly mine, NMC as an auxiliary chain can use hash (BTC's BlockHeader) to compare its own difficulty target value. When the requirement is met, it can explode the block. In this way, NMC can use BTC's computing power to complete its own block explosion work, and because BTC itself needs to calculate hash (BTC's BlockHeader), it is equivalent to a piece of cake, so it has no impact on BTC's own computing power and revenue.


According to the verification process, it can be concluded that because the auxiliary chain uses the block header hash of the main chain to generate blocks, the main chain and the auxiliary chain must use the same hash algorithm to conduct joint mining. For example, BTC and NMC are both SHA256 algorithms, and LTC and Dogecoin are both Scrypt algorithms.


Verification process:


Taking BTC and NMC as an example, in the same mining pool, the main chain and auxiliary chain nodes run simultaneously.


Preparation:


Build the transaction list of the NMC block, and then get the block header (note: the auxiliary chain does not need to traverse Nouce and other values, just pack them by default) and calculate the block header hash value hash (nmc_block_header).


Fill the hash (nmc_block_header) into the ExtraNouce1 field in the coinbase of the BTC block.


Traverse and calculate the hash (btc_block_header) of the variable fields (Nouce, Time, ExtraNouce2) in the BTC block header.


The first step is verification:

Target: hash(btc_block_header) < NMC difficulty target, verified by main chain nodes


Hash (btc_block_header) is compared with the NMC difficulty target and the BTC difficulty target respectively.


If the BTC difficulty target is met, BTC will explode and NMC will enter the second step of verification.


If the difficulty target of NMC is met but the difficulty target of BTC is not met, BTC will continue to traverse and NMC will enter the second step of verification.


Second step verification:

Ensure the association between NMC blocks and BTC blocks, verified by the auxiliary chain nodes


By comparing the btc_block_header_hash in the AuxPOW structure with the auxiliary chain difficulty target, it is confirmed again that hash (btc_block_header) < NMC difficulty target.


Verify that btc_coinbase_txn is included in the main chain block based on btc_coinbase_txn, btc_coinbase_branch, and btc_block_header_hash in the AuxPOW structure.


Verify that nmc_block_header_hash exists in btc_coinbase_txn.


If the verification result is correct, NMC will explode.



02

Joint mining benefits

The income of each mining pool's joint mining currency is distributed in a ratio, for example, the ratio of LTC to Dogecoin is 1:2000 (take the majority data). How is this income calculated?


Litecoin block at height 1720792 Source: chain.so


Dogecoin block at height 2939363 Source: chain.so


You can get the 20191017 data:


Dogecoin Difficulty: 2,315,320.67

Litecoin Difficulty: 9,419,531.81


Since both use the same data to generate blocks, the difficulty of the entire network also changes synchronously, so when a Litecoin block is produced per unit time, 9,419,531.81/2,315,320.67 blocks will be produced, which is approximately equal to 4 Dogecoin blocks. The current reward for a Dogecoin block is 10,000 Doge, and the Litecoin block reward is 12.5 LTC, so on average, when a Litecoin is produced, 40,000/12.5 Dogecoins will be produced, totaling 3,200 Dogecoins. Attached is the current ratio of Dogecoins given by mainstream mining pools:



The income from other joint mining currencies can also be calculated using a similar method.


"Pick Sir"

  1. Joint mining increases miners’ profits while keeping their computing power unchanged.

  2. Joint mining is conducive to the stability of the auxiliary chain's computing power.


<<:  [Evaluation] Packet capture data tells you whether the fish pool is stealing computing power

>>:  [Decryption] Calculation method of mining income

Recommend

The potential market for Bitcoin is huge

Bitcoin prices rebounded in the Asian session on ...

How to read the fortune line of a wealthy girl's palm

How to read the fortune line on a girl’s palm? Th...

Nervos CKB testnet mining tutorial: NBminer & Bminer

ViaBTC currently supports Bminer and NBminer mini...

Phoenix eye pattern pictures_Difference between Phoenix eye pattern and Fuzi eye

If we look at the pictures, we will find that the...

What is the fate of a man with light eyebrows?

People's eyebrows are very important and have...

People with fat on their faces are not to be trifled with.

A person's appearance can leave a first impre...

Bitmain to open new data center in Texas, USA

On August 1, according to CCN news, Bitmain, the ...

Bitcoin miners acquire New York power plant to quadruple mining power

A decade ago, the bankrupt owners of New York'...