<p>Most of what you need is explained at <a href="https://en.bitcoin.it/wiki/Merged_mining_specification" rel="nofollow">https://en.bitcoin.it/wiki/Merged_mining_specification</a></p>

<p>When you construct the block for the primary chain (e.g. bitcoin) you need to include a merged mining header in the generation transaction (coinbase). The format of this data is explained at the URL above under "Merged mining coinbase".</p>

<p>If, while hashing the primary chain, you get a hash that is below the target for the auxiliary chain (e.g. namecoin) you can create a block on that chain using getmemorypool (assuming the daemon for that chain supports getmemorypool).</p>

<p>To submit a merged mining block, for namecoin you need to do two things that you wouldn't do when mining non-merged.</p>

<p>The first is to set the auxpow bit in the version field of the block header. </p>

<p><code>BLOCK_VERSION_AUXPOW = (1 &lt;&lt; 8)</code></p>

<p>The second difference is that you insert an auxpow between the header and the transactions. The binary layout of the auxpow is explained at the URL above under "Aux proof-of-work".</p>

<p>The auxpow bit in the version field tells namecoin that after the block header there will be an auxpow before the transactions.</p>

<p>In theory other alt coins may need to have their merged blocks formatted differently and/or submitted differently to their daemon.</p>

CC BY-SA 3.0
2012-10-18T20:03:18.487Z
2012-10-18T20:03:18.487Z
Dr.Haribo
<p>The getmemorypool RPC command lists all transactions that are to be included in a block, with the exclusion of the generating transaction. In merged mining, one needs to add an extra transaction containing the hash of a Namecoin block to be generated.</p>

<p>If one uses the source code <a href="http://dot-bit.org/Merged_Mining#Getting_the_source_code_.28pool_operators_only.29" rel="nofollow">provided from the Namecoin wiki</a>, how would one merged mine? Is the metmemorypool transaction be supported? Would the special Namecoin transaction be included in the listed transactions?</p>

<bitcoind><namecoin><json-rpc><merged-mining><getmemorypool>
How to merged mine with getmemorypool RPC command?
ThePiachu
# How to merged mine with getmemorypool RPC command?

(Asked by: username_0 on 2012-02-10)

The getmemorypool RPC command lists all transactions that are to be included in a block, with the exclusion of the generating transaction. In merged mining, one needs to add an extra transaction containing the hash of a Namecoin block to be generated.

If one uses the source code [provided from the Namecoin wiki](http://dot-bit.org/Merged_Mining#Getting_the_source_code_.28pool_operators_only.29), how would one merged mine? Is the metmemorypool transaction be supported? Would the special Namecoin transaction be included in the listed transactions?

**Tags:** bitcoind, namecoin, json-rpc, merged-mining, getmemorypool


---

## 1 answers

### Answer by username_1 on 2012-10-18. Score: 2

Most of what you need is explained at <https://en.bitcoin.it/wiki/Merged_mining_specification>

When you construct the block for the primary chain (e.g. bitcoin) you need to include a merged mining header in the generation transaction (coinbase). The format of this data is explained at the URL above under "Merged mining coinbase".

If, while hashing the primary chain, you get a hash that is below the target for the auxiliary chain (e.g. namecoin) you can create a block on that chain using getmemorypool (assuming the daemon for that chain supports getmemorypool).

To submit a merged mining block, for namecoin you need to do two things that you wouldn't do when mining non-merged.

The first is to set the auxpow bit in the version field of the block header.

`BLOCK_VERSION_AUXPOW = (1 << 8)`

The second difference is that you insert an auxpow between the header and the transactions. The binary layout of the auxpow is explained at the URL above under "Aux proof-of-work".

The auxpow bit in the version field tells namecoin that after the block header there will be an auxpow before the transactions.

In theory other alt coins may need to have their merged blocks formatted differently and/or submitted differently to their daemon.


---

