1

I have created an account in a bitcoind wallet which has got some 1.055btc which has to be wiped out to 0.00BTC to another account. so the actual BTC has to be sent is 1.055 - transaction fee.

Is there any calculation for bitcoin to find transaction fee or any jsonrpc to find estimation fee like ethereum (balance - (gasprice*gaslimit)).

Murch
  • 71,155
  • 33
  • 180
  • 600

2 Answers2

2

With recent versions of bitcoind, you can use sendtoaddress with the optional subtractfeefromamount argument.

sendtoaddress 123abc... 1.055 "" "" true

Creates a transaction with 1.055 BTC of inputs. The destination address will receive a little less than 1.055 BTC, after an appropriate fee is subtracted.

Nate Eldredge
  • 22,970
  • 3
  • 39
  • 80
0

There are a couple of ways to estimate the transaction fee (Skip to 3 if you want an automated way to send your entire balance).

  1. You can use the Bitcoin cli. From a previous answer on how to estimate fees:

    bitcoin-cli estimatesmartfee 6
    
  2. You can also use many webservices that focus on fee estimation:

  3. Finally, you could upload your private key to a wallet such as electrum which will take care of fee estimation for you and ensure all your bitcoin is transferred.

Jonathan Cross
  • 1,410
  • 10
  • 30
timothyylim
  • 353
  • 1
  • 15