Bitcoin 0.18: how to send bitcoin from one address to another using Bitcoind?

1

To transfer bitcoin from one account to another address, we have used sendfrom method and which got deprecated in the latest version Bitcoin 0.18.0

Bitcoin sendfrom method

On reading the document of Bitcoin 0.18.0, it is suggested to use sendtoaddress method.

sendtoaddress method has two required parameter

  1. "address" - address to which we want to sent BTC
  2. "amount" - amount in whole number

Unlike sendfrom method, there is no parameter where we can pass the parameter with account or address from which we want to send BTC.

Please let me know how can I define the account or address from which I need to send Bitcoins or is there any other method available.

I am using bitcoind to make RPC calls.

Puneet Kushwah

Posted 2019-07-23T11:51:14.277

Reputation: 111

Answers

1

Please let me know how can I define the account or address from which I need to send Bitcoins or is there any other method available.

The listunspent and createrawtransaction commands together can be used to achieve what you are asking.

The listunspent command will give you all the UTXOs that your wallet controls. You can pass an address parameter to filter all the unspent outputs by address. The documentation of listunspent is available here. This command will return you the txids, output index, value and others.

Then use the createrawtransaction command and specify those txids and output indexes in the input, and the address and value that you want to send in the output.

Ugam Kamat

Posted 2019-07-23T11:51:14.277

Reputation: 5 180

Thank you for your response... i checked the process of transaction and we need to sign and then send the raw transaction. Is there no straight forward method like sendfrom?Puneet Kushwah 2019-07-24T09:14:51.407