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.

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.

  • 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 Jul 24 at 9:14

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.