Any miner is interested in getting as many coins as possible. So, you can mine two cryptocurrencies at once on one equipment – this process is called merged mining.

Hash Algorithms

Mining in a simplified sense can be reduced to finding the correct hash value. Hashing is the process of generating fixed-size output data from arbitrary-sized input data using mathematical formulas known as hash functions. Different cryptocurrencies can use the same hashing algorithm. For example, the popular SHA-256 is used in Bitcoin, Bitcoin Cash, Peercoin, Namecoin and other blockchains.

As cryptocurrencies became more widespread, enthusiasts asked a logical question: is it possible to simultaneously search for hash values ​​for two cryptocurrencies based on the same hashing algorithm on the same hardware? It turned out that this is quite possible.

Merged mining

Merged mining is the simultaneous mining of two or more cryptocurrencies on the same hardware without compromising the overall performance of the process. Essentially, a miner can use their computing power to simultaneously mine blocks on multiple chains using Auxiliary Proof-of-Work (AuxPoW).

What is AuxPoW

AuxPoW idea is is that work done on one blockchain can be used on another. A blockchain that provides proof of work is referred to as a “parent blockchain,” and one that is willing to accept proof of work from another chain is referred to as a satellite distributed ledger.

For this process, firstly, both blockchains must have the same hashing algorithm. Secondly, the auxiliary blockchain must support the AuxPoW solution. Support for AuxPoW is not mandatory for the parent blockchain, since the work is performed primarily for it and on its rules. Therefore, it will be considered valid in any case. The question is whether the secondary blockchain is willing to accept work done for another ledger.

Typically, in order to add or remove AuxPoW support, the blockchain requires a hard fork.

How merged mining works

Let's assume that a miner is mining Bitcoin (which will be the parent blockchain) and another SHA-256 cryptocurrency that supports AuxPoW, such as Namecoin (an auxiliary blockchain).

First, blocks of transactions are formed for both cryptocurrencies. In a Bitcoin block, the miner adds a transaction that contains a hash that refers to the Namecoin block. This is so that the Namecoin blockchain can accept proof of work done on the parent blockchain. A complete specification of what, how and where is recorded during merged mining can be study separately.

Then comes the stage of mining or validating transactions by entering them into a block, where the miner tries to find the correct hash value. If successful, one of the following may occur:

  1. The block was mined at the difficulty level of the Bitcoin network. Since the difficulty level at which a Bitcoin block was mined is higher than the difficulty level of Namecoin, the miner mines a block in both, thereby receiving both mining rewards.

  2. The block is mined at the Namecoin difficulty level (but lower than the Bitcoin difficulty level). Namecoin is able to accept proof of work even if a miner fails to mine a block on the Bitcoin network, but the resulting hash matches Namecoin's difficulty level. In this case, the miner will only receive mining reward Namecoin.

Features of AuxPoW blocks

How does the helper blockchain accept proof of work from the parent blockchain?

The thing is that AuxPoW blocks have additional data fields (Bitcoin block header and transactions in it) that show that the miner who created this block actually did work on the parent blockchain, and that work corresponds the level of complexity of the supporting blockchain, so the block should be accepted.

This is precisely why AuxPoW support is necessary – otherwise the auxiliary blockchain simply will not understand that the work sufficient to create the block has been done at all.

The role of Satoshi Nakamoto

We owe the concept of merged mining to the creator of Bitcoin – Satoshi Nakamoto proposed it back in 2010. Already in 2011, it was implemented in Namecoin: in block 19,200 Namecoin, support for merged mining was activated, which made it possible to simultaneously mine bitcoins and Namecoin.

Pros and cons of pooled mining

In addition to increasing miner income, federated mining can provide increased security for small, low hash rate blockchains by harnessing the hash power of the Bitcoin network or another larger chain. This could potentially reduce the likelihood of 51% attacks if enough miners agree to use pooled mining.

On the other hand, there is an opinion that pooled mining gives a false sense of security. Thus, a large pool, which, of course, no matter how large it is, cannot overwhelm the Bitcoin network, can easily reach 51% in a smaller chain. And then merged mining can actually reduce the security of a smaller network rather than increased.

What can you mine at the same time?

Using the SHA-256 hashing algorithm paired with Bitcoin, you can mine Lyncoin, Terracoin, Syscoin, Namecoin, Xaya, Emercoin, Myriadcoin, Rootstock.

In Scrypt you can mine at the same time Litecoin, Dogecoin, Dingocoin, Worldcoin, Earthcoin, Newyorkcoin, Myriadcoin, Viacoin.

Conclusion

Merged mining allows you to mine two or more cryptocurrencies at the same time. This requires that they have a common hashing algorithm and that the supporting blockchains support the AuxPoW protocol.