<p>If you're using Bitcoin Core, you must first import the private key using the <code>importprivkey</code> console command.  The coins held by that private key will then be added to your existing balance (if any).</p>

<p>If you want to spend those <em>specific</em> coins rather than some others in your wallet, you can use the "coin control" feature.  This can be enabled in Settings:Options:Display; when you send coins, you will be offered a list to select which addresses/transactions you want to spend from.</p>

CC BY-SA 3.0
2014-08-14T18:35:27.530Z
Thanks a lot for your answer. Let's say I want to spend those specific coins. Do you know the way to do it with RPC commands?
heyo
CC BY-SA 3.0
2014-08-14T17:55:30.757Z
2014-08-14T17:55:30.757Z
Nate Eldredge
<p>For RPC you can do a raw transaction where you can specify which inputs to use.  First <strong>listunspent</strong> then <strong>createrawtransaction</strong>, then sign and transmit to the network.</p>

<p><a href="https://en.bitcoin.it/wiki/Raw_Transactions" rel="nofollow">https://en.bitcoin.it/wiki/Raw_Transactions</a></p>

CC BY-SA 3.0
2014-10-13T22:25:41.780Z
2014-10-13T22:25:41.780Z
siliconsys
<p>Let's say the user sends me his private key. What is the appropriate RPC command to spend the Bitcoins of this user using his private key?</p>

<p>Should I import his private key in the wallet before?</p>

CC BY-SA 3.0
2014-08-14T17:45:44.437Z
Note that under any normal circumstances, you should never send/receive a private key. It kinda defeats the purpose of having public key cryptography.
Tim S.
CC BY-SA 3.0
2014-08-14T17:57:48.123Z
Alternate solution: use https://brainwallet.github.io/#tx so you don't have to rescan the blockchain for transactions, or do raw signing stuff.
Tim S.
<private-key>
Sendtoaddress using custom private key
heyo
# Sendtoaddress using custom private key

(Asked by: username_0 on 2014-08-14)

Let's say the user sends me his private key. What is the appropriate RPC command to spend the Bitcoins of this user using his private key?

Should I import his private key in the wallet before?

**Tags:** private-key

> **Comments:**
> **username_1**: Note that under any normal circumstances, you should never send/receive a private key. It kinda defeats the purpose of having public key cryptography.  
> **username_1**: Alternate solution: use https://brainwallet.github.io/#tx so you don't have to rescan the blockchain for transactions, or do raw signing stuff.  

---

## 2 answers

### Answer by username_2 on 2014-08-14. Score: 1

If you're using Bitcoin Core, you must first import the private key using the `importprivkey` console command. The coins held by that private key will then be added to your existing balance (if any).

If you want to spend those *specific* coins rather than some others in your wallet, you can use the "coin control" feature. This can be enabled in Settings:Options:Display; when you send coins, you will be offered a list to select which addresses/transactions you want to spend from.

> **Comments:**
> **username_0**: Thanks a lot for your answer. Let's say I want to spend those specific coins. Do you know the way to do it with RPC commands?  

---

### Answer by username_3 on 2014-10-13. Score: 0

For RPC you can do a raw transaction where you can specify which inputs to use. First **listunspent** then **createrawtransaction**, then sign and transmit to the network.

<https://en.bitcoin.it/wiki/Raw_Transactions>


---

