I'm running bitcoind and I want to send all my coins to another address. What is the command for this?

2 Answers 2


To be strict, OP asked to send all coins, which @eatingthenight didn't answer.

The key thing to do this is the last optional bool argument of the sendtoaddress RPC command called subtractfeefromamount. The way to use it is:

bitcoin-cli walletpassphrase <passphrase> <timeoutInSeconds>
bitcoin-cli sendtoaddress <bitcoinaddress> `bitcoin-cli getbalance` "" "" true

This command:

sendtoaddress <bitcoinaddress> <amount>

will do the trick.

Look at the bitcoind api for more info: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.