How to estimate optimal fees for transaction in bitcoind?

10

2

As I understand, with the network congestion it's sometimes advisable to set a higher fee to process a transaction within a block or two. Is there some way to estimate the optimal fee through calls to bitcoind? I know there are some online services that do those estimations, but I'd rather not rely on such external factors.

ThePiachu

Posted 2016-12-26T23:19:51.187

Reputation: 41 594

Answers

9

The other answer is outdated. estimatefee is deprecated. You should use estimatesmartfee

Please use estimatesmartfee for more intelligent estimates. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks. Uses virtual transaction size of transaction as defined in BIP 141 (witness data is discounted).

Arguments: 1. nblocks (numeric, required)

Example:

bitcoin-cli estimatesmartfee 6

Aminadav Glickshtein

Posted 2016-12-26T23:19:51.187

Reputation: 250

8

Have you tried using the estimatefee RPC call? This will calculate the amount needed per kilobyte.

For example calling bitcoin-cli estimatefee 2 would provide a fee per kb to try to get confirmed within 2 blocks.

https://bitcoin.org/en/developer-reference#estimatefee

m1xolyd1an

Posted 2016-12-26T23:19:51.187

Reputation: 3 356

2In fact, if you use any of the automatic send RPCs (sendtoaddress etc), and don't configure a manual feerate (the -paytxfee option), fee estimation will be used automatically.Pieter Wuille 2016-12-27T10:59:30.863

1

I am using https://bitcoinfees.net . They hare using Bitcoin Core's "estimatesmartfee" method. You can easily pick a transaction fee based on confirmation time.

Васил Тошков

Posted 2016-12-26T23:19:51.187

Reputation: 21