
Lastly, no special support is needed from Bitcoin.(It will bloat the Namecoin chain a bit as it means some blocks will have an extra header and an extra hash.) The "Bitcoin stuff" that goes in the Namecoin tree is basically ignored and only used to validate the proof of work. The two hash chains remain fully independent.At most, one tiny hash is inserted in the transaction tree. The Bitcoin chain doesn't get junked up with Namecoin stuff due to merged mining.They are fully independent - only the mining is merged. One block can "win" in the public chain and not the other. Note that a miner can solve both chains simultaneously, and they will if they solve at the higher difficulty. (Because you can't build the Bitcoin transaction set containing that hash, and therefore the Bitcoin header that secures it, without that information. 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. This entire "mess" is then submitted to the Namecoin system. 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. If a miner solves the hash at the Namecoin difficulty level, the Namecoin block is assembled. The Namecoin hash does nothing and the Bitcoin network ignores it. If a miner solves the hash at the Bitcoin difficulty level, the Bitcoin block is assembled and sent to the Bitcoin network. He then assembles the final Bitcoin header with this transaction in it and sends out the work units. 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 Namecoin block and hashes it.

I'll use the example of Bitcoin and Namecoin, where Namecoin supports merged mining and Bitcoin doesn't:įirst, the miner must assemble a transaction set for both block chains.

The only confusing detail is how the same hash can secure both block chains. 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).

Work units based on this block are then assigned to miners. 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. 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. Merged mining allows a miner to mine for more than one block chain at the same time.
