From code:

 // Create coinbase tx
 CTransaction txNew;
 CPubKey pubkey;
 if (!reservekey.GetReservedKey(pubkey))
     return NULL;
 txNew.vout[0].scriptPubKey << pubkey << OP_CHECKSIG;

 // Add our coinbase tx as first transaction
 pblocktemplate->vTxFees.push_back(-1); // updated at end
 pblocktemplate->vTxSigOps.push_back(-1); // updated at end

How I can connect mined blocks with various addresses in base58? Not only with miner address.

I want send part of mined value to one address (developer fund), different of miner address.

add vtx[1]? Only check it in connectblock and createnewblock functions?

  • I am not sure I understand what you are asking: Is this question about how to send the mining reward to more than one address?
    – Murch
    Sep 4, 2013 at 22:23
  • Yes. Send part of getblockvalue() to selected address. Sep 5, 2013 at 9:58

1 Answer 1


This isn't a complete answer but I might be able to point you in the right direction:

It seems like you have:

CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)

So you're taking a CScript as a parameter. Some additional relevant links. I think you would either use that to create multiple outputs, or you would use


Also see how they do it here: - https://dev.visucore.com/bitcoin/doxygen/miner__tests_8cpp_source.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.