user6408: following the manual on https://bitcointalk.org/index.php?topic=101525.0 , i would like to merge multiple fractions of BTC from multiple addresses i own, to another single address i own(reassemble, sort of, organize stuff). how will my approach look like? i still don't get what does "vout" value mean in the createrawtransaction? i think it's about this:
# assume i would like to merge transactions "aaaa..." and "bbbb..." to address "1mainaddr..."
# "aaaa..." has 0.01  btc unspent
# "bbbb..." has 0.0105 btc unspent
# "1mainaddr..." is emtpy
# i would like to pay 0.0005 btc as a fee

createrawtransaction [{txid:aaaa...,vout=0},{txid:bbbb...,vout=1}] {1mainaddr...=0.02}

is that correct?
i would like to first test this on testnet but still waiting on block confirmations. i'd appreciate 1-2 testnet BTC on moBHB5euzHyKtcabpD3UND9PYB994cisqb and will return it to you once block 101602 is confirmed.

user575: vout is the serial number of the output you're redeeming in its transaction.
For example, if you want to redeem the first output in the transaction with hash X, you specify X for txid and 0 for vout. If you want the second output in that transaction, you specify 1 for vout instead, etc.

user5181: From the command line, you need to add commas around the parameters and format the JSON correctly.
For example:
bitcoind createrawtransaction '[{"txid":"aaaa"...,"vout"=0},{"txid":"bbbb"...,"vout"=1}]' '{"1mainaddr"...=0.02}'


user6408: ok, i figured it out. the correct answer to the following example will look this way:
# get your unspent transactions
listunspent
# select the ones you want to pour BTC from, please also note their 'vout', it is an output of a transaction you own a private key to and therefore able to spend.
createrawtransaction '[{"txid":"aaaa...","vout":0},{"txid":"bbbb...","vout":0}]' '{"1mainaddr...":0.02}'
# explained: you are using two outputs, of total 0.0205 BTC. you give away 0.0005 fee and you keep 0.02 at your 1mainaddr...
# you can dump the resulting transaction draft to see how it'll look like
decoderawtransaction <...result_from_createrawtransaction...>
# sign it with your private keys
signrawtransaction <...result_from_createrawtransaction...>
# if it returns you a hex with "complete" : true, you can now send it off to network
# if it returns "complete" : false, you either don't have a private key for signing, or you might have specified invalid 'vout'. google for more possible problems, those were two i experienced.
sendrawtransaction <...result_from_signrawtransaction_hex...>

references:

people.xiph.org/~greg/signdemo.txt
bitcointalk.org/index.php?topic=101525.0

thanks:

@Murch

this is a manual for original satoshi client.

6408: <p>following the manual on <a href="https://bitcointalk.org/index.php?topic=101525.0" rel="nofollow">https://bitcointalk.org/index.php?topic=101525.0</a> , i would like to merge multiple fractions of BTC <strong>from multiple</strong> addresses i own, <strong>to</strong> another <strong>single</strong> address i own(reassemble, sort of, organize stuff). how will my approach look like? i still don't get what does "vout" value mean in the <em>createrawtransaction</em>? i think it's about this:</p>

<pre><code># assume i would like to merge transactions "aaaa..." and "bbbb..." to address "1mainaddr..."
# "aaaa..." has 0.01  btc unspent
# "bbbb..." has 0.0105 btc unspent
# "1mainaddr..." is emtpy
# i would like to pay 0.0005 btc as a fee

createrawtransaction [{txid:aaaa...,vout=0},{txid:bbbb...,vout=1}] {1mainaddr...=0.02}
</code></pre>

<p>is that correct?
i would like to first test this on testnet but still waiting on block confirmations. i'd appreciate 1-2 testnet BTC on <em>moBHB5euzHyKtcabpD3UND9PYB994cisqb</em> and will return it to you once block 101602 is confirmed.</p>
 575: <p>vout is the serial number of the output you're redeeming in its transaction.</p>

<p>For example, if you want to redeem the first output in the transaction with hash X, you specify X for txid and 0 for vout. If you want the second output in that transaction, you specify 1 for vout instead, etc.</p>
 5181: <p>From the command line, you need to add commas around the parameters and format the JSON correctly.</p>

<p>For example:</p>

<pre><code>bitcoind createrawtransaction '[{"txid":"aaaa"...,"vout"=0},{"txid":"bbbb"...,"vout"=1}]' '{"1mainaddr"...=0.02}'
</code></pre>
 6408: <p>ok, i figured it out. the correct answer to the following example will look this way:</p>

<pre><code># get your unspent transactions
listunspent
# select the ones you want to pour BTC from, please also note their 'vout', it is an output of a transaction you own a private key to and therefore able to spend.
createrawtransaction '[{"txid":"aaaa...","vout":0},{"txid":"bbbb...","vout":0}]' '{"1mainaddr...":0.02}'
# explained: you are using two outputs, of total 0.0205 BTC. you give away 0.0005 fee and you keep 0.02 at your 1mainaddr...
# you can dump the resulting transaction draft to see how it'll look like
decoderawtransaction &lt;...result_from_createrawtransaction...&gt;
# sign it with your private keys
signrawtransaction &lt;...result_from_createrawtransaction...&gt;
# if it returns you a hex with "complete" : true, you can now send it off to network
# if it returns "complete" : false, you either don't have a private key for signing, or you might have specified invalid 'vout'. google for more possible problems, those were two i experienced.
sendrawtransaction &lt;...result_from_signrawtransaction_hex...&gt;
</code></pre>

<p><strong>references</strong>:</p>

<ul>
<li>people.xiph.org/~greg/signdemo.txt</li>
<li>bitcointalk.org/index.php?topic=101525.0</li>
</ul>

<p><strong>thanks</strong>:</p>

<ul>
<li>@Murch</li>
</ul>

<p>this is a manual for original satoshi client.</p>
