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

<p>It seems like you have:</p>

<pre><code>CBlockTemplate* CreateNewBlock(const CScript&amp; scriptPubKeyIn)
</code></pre>

<p>So you're taking a <a href="https://dev.visucore.com/bitcoin/doxygen/script_8h.html" rel="nofollow">CScript</a>  as a parameter. Some additional relevant links.  I think you would either use that to create multiple outputs, or you would use    </p>

<pre><code>txNew.vout[1];
</code></pre>

<ul>
<li><p><a href="https://en.bitcoin.it/wiki/Transactions#general_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout" rel="nofollow">https://en.bitcoin.it/wiki/Transactions#general_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout</a></p></li>
<li><p><a href="https://en.bitcoin.it/wiki/Script" rel="nofollow">https://en.bitcoin.it/wiki/Script</a></p></li>
<li><p><a href="https://dev.visucore.com/bitcoin/doxygen/script_8cpp.html" rel="nofollow">https://dev.visucore.com/bitcoin/doxygen/script_8cpp.html</a></p></li>
<li><p><a href="https://dev.visucore.com/bitcoin/doxygen/class_c_transaction.html" rel="nofollow">https://dev.visucore.com/bitcoin/doxygen/class_c_transaction.html</a>
(and follow the links to CTxIn/CTxOut from there</p></li>
</ul>

<p>Also see how they do it here:
 - <a href="https://dev.visucore.com/bitcoin/doxygen/miner__tests_8cpp_source.html" rel="nofollow">https://dev.visucore.com/bitcoin/doxygen/miner__tests_8cpp_source.html</a></p>

CC BY-SA 3.0
2013-09-05T21:23:14.873Z
2013-09-06T16:08:56.187Z
2013-09-06T16:08:56.187Z
Neil Neyman
<p>From code:</p>

<pre><code> // Create coinbase tx
 CTransaction txNew;
 txNew.vin.resize(1);
 txNew.vin[0].prevout.SetNull();
 txNew.vout.resize(1);
 CPubKey pubkey;
 if (!reservekey.GetReservedKey(pubkey))
     return NULL;
 txNew.vout[0].scriptPubKey &lt;&lt; pubkey &lt;&lt; OP_CHECKSIG;

 // Add our coinbase tx as first transaction
 pblock-&gt;vtx.push_back(txNew);
 pblocktemplate-&gt;vTxFees.push_back(-1); // updated at end
 pblocktemplate-&gt;vTxSigOps.push_back(-1); // updated at end
</code></pre>

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

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

<p>add vtx[1]?
Only check it in connectblock and createnewblock functions?</p>

CC BY-SA 3.0
2013-09-04T22:23:16.410Z
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
CC BY-SA 3.0
2013-09-05T09:58:33.007Z
Yes. Send part of getblockvalue() to selected address.
user1497250
<alternatives>
Connect mined blocks with various addresses
user1497250
# Connect mined blocks with various addresses

(Asked by: username_0 on 2013-09-04)

From code:

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

 // Add our coinbase tx as first transaction
 pblock->vtx.push_back(txNew);
 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?

**Tags:** alternatives

> **Comments:**
> **username_1**: 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?  
> **username_0**: Yes. Send part of getblockvalue() to selected address.  

---

## 1 answers

### Answer by username_2 on 2013-09-05. Score: 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](https://dev.visucore.com/bitcoin/doxygen/script_8h.html) as a parameter. Some additional relevant links. I think you would either use that to create multiple outputs, or you would use

```
txNew.vout[1];

```

* <https://en.bitcoin.it/wiki/Transactions#general_format_.28inside_a_block.29_of_each_output_of_a_transaction_-_Txout>
* <https://en.bitcoin.it/wiki/Script>
* <https://dev.visucore.com/bitcoin/doxygen/script_8cpp.html>
* <https://dev.visucore.com/bitcoin/doxygen/class_c_transaction.html>
  (and follow the links to CTxIn/CTxOut from there

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


---

