How to send btc from the specific address using bitcoin api?

2

2

I'd like to send bitcoin from the specific address to a address using bitcoin api. I used 'sendfrom' as follows. Each address "mqXhhivMPjeVvdVMR239EVDJiRGQUYcbDZ" and "mknGW629wzSkfWvgXF23d8eTrqibnhTcrf" has bitcoin more than 0.002btc, however it returned the "insufficient funds" error. Could you tell me how to send from the specific address?

bitcoin-cli sendfrom mqXhhivMPjeVvdVMR239EVDJiRGQUYcbDZ mknGW629wzSkfWvgXF23d8eTrqibnhTcrf 0.002

Account has insufficient funds

lalala

Posted 2015-12-06T10:05:00.390

Reputation: 251

Answers

1

You cannot send from an address. All the coins inside a wallet are always treated as a single balance, for privacy reasons.

All sendfrom does is deduct the money you're sending from the virtual local account with that name. You can move money to those accounts using the move command. Received coins are by default credited to the "" account. Still, these accounts have nothing to do with actual coins on the network. This account system is scheduled for deprecation, though.

If you want to manually select the coins to use, look into the listunspent, createrawtransaction, signrawtransaction and sendrawtransaction RPC calls.

Pieter Wuille

Posted 2015-12-06T10:05:00.390

Reputation: 54 032

0

The first parameter of 'sendfrom' should be an account.You can use 'setaccount' to set an account name to a particular address, and then use 'sendfrom'

Peili Liang

Posted 2015-12-06T10:05:00.390

Reputation: 78

Note that accounts are deprecated.Murch 2017-09-25T03:15:15.700