How does merge mining work?


#1

I did some quick research on my question first, but didn’t really find anything out…it more had to do with scrypt coins. But, does Bitcoin merge mine with any other coin or does it always fly solo? If it was to merge mine, what benefits would BTC gain from the merge mining. I have read that it can make the block chain more secure as there can be more hashing power, but that seems to be more beneficial for the merged coin more so than BTC. Just something I have been wondering about.


Bitcoin Market Discussions
#2

Merged mining allows a miner to mine for more than one block chain at the same time. The benefit is that every hash the miner does contributes to the total hash rate of both (all) currencies, and as a result they are all more secure.

Starting with a high-level explanation:

The miner (or mining controller in the case of pooled mining) actually builds a block for both hash chains in such a way that the same hash calculation secures both blocks. Work units based on this block are then assigned to miners. If a miner solves a block (at the difficulty level of either or both block chains) the block is re-assembled with the completed proof of work and submitted to the correct block chain (or both blocks are separately reassembled and each submitted to the corresponding network if it met both of their difficulty requirements).

The only confusing detail is how the same hash can secure both block chains. I’ll use the example of Bitcoin and Namecoin, where Namecoin supports merged mining and Bitcoin doesn’t:

First, the miner must assemble a transaction set for both block chains. He then assembles the final Namecoin block and hashes it. He then creates a transaction containing this hash that is valid in the Bitcoin chain and inserts it in the Bitcoin transaction set at the tip of the tree. He then assembles the final Bitcoin header with this transaction in it and sends out the work units.

If a miner solves the hash at the Bitcoin difficulty level, the Bitcoin block is assembled and sent to the Bitcoin network. The Namecoin hash does nothing and the Bitcoin network ignores it.

If a miner solves the hash at the Namecoin difficulty level, the Namecoin block is assembled. It includes the Namecoin transaction set, the Namecoin block header, the Bitcoin block header, and the hash of the rest of the transactions in the Bitcoin block. This entire “mess” is then submitted to the Namecoin system. The Namecoin system, supporting merged mining, accepts this as proof of work because it contains work that must have been done after the block header and Namecoin transaction set was built. (Because you can’t build the Bitcoin transaction set containing that hash, and therefore the Bitcoin header that secures it, without that information. So it proves the work was done.)

Note that a miner can solve both chains simultaneously, and they will if they solve at the higher difficulty. One block can “win” in the public chain and not the other. They are fully independent – only the mining is merged.

Three key points to remember:

  • The Bitcoin chain doesn’t get junked up with Namecoin stuff due to merged mining. At most, one tiny hash is inserted in the transaction tree.
  • The two hash chains remain fully independent. The “Bitcoin stuff” that goes in the Namecoin tree is basically ignored and only used to validate the proof of work. (It will bloat the Namecoin chain a bit as it means some blocks will have an extra header and an extra hash.)
    Lastly, no special support is needed from Bitcoin.
  • The benefit for Namecoin is obvious. A lot of Bitcoin miners will probably do merged mining, since it costs them basically nothing and gives them a greater return than mining Bitcoins alone. As a result, their block generation timing will be more predictable and their transactions more secure against a 51% attack.

Source: http://bitcoin.stackexchange.com/questions/273/how-does-merged-mining-work


#3

Hey nice explanation. I always wondered how that worked.


#4

google and copy/paste love me :slight_smile:


#5

Aha! moment. WHat limitations does the second coin have? I read a bit about merged mining, but must have been on a bad day because i didnt realize the double potential. Thought of it more or less as a second coin hashing in the BTC blockchain just as a way to show POW & assumed this:

Understood the 2nd coin would get its proof but have always been more interested in the BTC then any alternative coin.


#6

Same here but the advantage is that if the pool doesn’t find a BTC block they might find a block or blocks of the other coins or both. Thus if they find both it will increase payouts. I think syntaks was looking into adding merge mining support to neos and I think there is a few more coins by now that support it. Need to read more into it myself :slight_smile:


#7

Google “auxpow”. Most of the latest hits will bring up auxpow stuff as implemented by DOGE to allow for merge mining with LTC,


#8

Mind blown. This connected a lot of dots for me! Where’s the tip bot???


Forum Tipping App and IRC Bot
#9

I moved 3 posts to a new topic: Forum Tipping App and IRC Bot


#10

That’s the one! :+1:


Hmm speaking about tips… anyone happen to have one for IRC #GetHashing? I can look at a tip thingy for the forum but lets not start a point thingy that ends up being a coin…pls. :wink: