<p>Yes that possible:</p>

<p>you need to know the txid and Vout index for those particular addresses when they were funded</p>

<p>for example here i have used 3 addressees to send some BTC  to single addresses <code>2N6V6Ko17CPWaZZf6YrGKeq8R1fzbqrTKLF</code> and if  know the txid and vout of those addresses when they were funded i will do:</p>

<p>1)create raw tranaction</p>

<pre><code>syntax: createrawtransaction   [{"txid":txid,"vout":n},...] {address:amount,...} 

 bitcoin-cli -regtest createrawtransaction '[{"txid":"582283c5f2293a2cdb27173c3118ff59863d9ff2be5c3b48fa8e66509e9a7d0d","vout":1},{"txid":"3126fc2864fbf780460734dd1512b98e86f72f8e5b8b59047beae9dd859ac33a","vout":0},{"txid":"94a6701b68e38b3f980c9bf2b0e905dd7e479c7ed01590eeee20b1753c29d6af","vout":1}]' '{"2N6V6Ko17CPWaZZf6YrGKeq8R1fzbqrTKLF":"2"}'
</code></pre>

<p>2) Sign raw transaction:</p>

<pre><code>syntax: signrawtransaction  &lt;hexstring&gt; [] [&lt;privatekey1&gt;,...] 

bitcoin-cli -regtest  Signrawtransaction hexstring_from_createRawtransaction '[]'["pvtkey_add1","pvtkey_add2","pvtkey_add3"]
</code></pre>

<p>3) send raw transaction</p>

<pre><code>syntax: sendrawtransaction hexString

bitcoin-cli -regtest hexString_from_signrawTransction
</code></pre>

CC BY-SA 4.0
2019-09-17T04:54:58.170Z
Very cool stuff, Thank you... I have a couple of questions, 1) How do I find the vout number, is there a command to get that information? 2) The private keys used in the sign transaction command, those would be the private keys of the addresses associated with those transactions?
Jeffrey L. Roberts
CC BY-SA 4.0
2019-09-17T06:20:12.700Z
@cryptoKTM `signrawtransaction` was deprecated in v0.17 and was removed from v0.18. The alternatives are `signrawtransactionwithkey` and `signrawtransactionwithwallet`. In the above example, since you are explicitly mentioning the keys you would use the former one.
Ugam Kamat
CC BY-SA 4.0
2019-09-17T11:30:39.320Z
@JeffreyL.Roberts you should know the txid when the address was funded, by simple rpc i.e getrawtransaction on particular txid you can find the vout index
, yes they are pvt key associated with addresses

also please refer to letest  comment for upgraded versions
Parishilan Rayamajhi
CC BY-SA 4.0
2019-09-17T04:47:15.903Z
2019-09-17T04:47:15.903Z
Parishilan Rayamajhi
<p>I am looking into being able to send coins from specific addresses to a single output address using bitcoin-cli</p>

<p>Is this possible? What RPC command would I use? Any chance of an example?</p>

<json-rpc><bitcoin-cli>
Use Bitcoin RPC to send from many addresses to single address
Jeffrey L. Roberts
# Use Bitcoin RPC to send from many addresses to single address

(Asked by: username_0 on 2019-09-17)

I am looking into being able to send coins from specific addresses to a single output address using bitcoin-cli

Is this possible? What RPC command would I use? Any chance of an example?

**Tags:** json-rpc, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2019-09-17. Score: 1 | Accepted answer

Yes that possible:
you need to know the txid and Vout index for those particular addresses when they were funded
for example here i have used 3 addressees to send some BTC  to single addresses 2N6V6Ko17CPWaZZf6YrGKeq8R1fzbqrTKLF and if  know the txid and vout of those addresses when they were funded i will do:
1)create raw tranaction
syntax: createrawtransaction   [{"txid":txid,"vout":n},...] {address:amount,...} 

 bitcoin-cli -regtest createrawtransaction '[{"txid":"582283c5f2293a2cdb27173c3118ff59863d9ff2be5c3b48fa8e66509e9a7d0d","vout":1},{"txid":"3126fc2864fbf780460734dd1512b98e86f72f8e5b8b59047beae9dd859ac33a","vout":0},{"txid":"94a6701b68e38b3f980c9bf2b0e905dd7e479c7ed01590eeee20b1753c29d6af","vout":1}]' '{"2N6V6Ko17CPWaZZf6YrGKeq8R1fzbqrTKLF":"2"}'

2) Sign raw transaction:
syntax: signrawtransaction   [] [,...] 

bitcoin-cli -regtest  Signrawtransaction hexstring_from_createRawtransaction '[]'["pvtkey_add1","pvtkey_add2","pvtkey_add3"]

3) send raw transaction
syntax: sendrawtransaction hexString

bitcoin-cli -regtest hexString_from_signrawTransction

> **Comments:**
> **username_0**: Very cool stuff, Thank you... I have a couple of questions, 1) How do I find the vout number, is there a command to get that information? 2) The private keys used in the sign transaction command, those would be the private keys of the addresses associated with those transactions?  
> **username_2**: @cryptoKTM `signrawtransaction` was deprecated in v0.17 and was removed from v0.18. The alternatives are `signrawtransactionwithkey` and `signrawtransactionwithwallet`. In the above example, since you are explicitly mentioning the keys you would use the former one.  
> **username_1**: @JeffreyL.Roberts you should know the txid when the address was funded, by simple rpc i.e getrawtransaction on particular txid you can find the vout index , yes they are pvt key associated with addresses  also please refer to letest  comment for upgraded versions  

---

