<p>I've spent hours and hours trying to find a solution to this problem, with no success.</p>

<p>Using Bitcoin Core on a Linux machine, so using bitcoin-cli to process commands back to the daemon.</p>

<p>Here's what I want to achieve: I want to send a transaction and be able to specify a custom transaction fee in Bitcoin/KB on a "per transaction basis".</p>

<p>So far, I haven't found a solution. These are the areas I have been looking at:</p>

<p>Change the paytxfee global variable and then just send the transaction. ---> If I do this, the resultant fee once the transaction has been sent is about 40% lower than what I specified in the <code>paytxfee</code> variable. Why is it smaller?</p>

<p>So.... does anyone please have any ideas how I can just send a transaction and specify a custom fee which is the actual fee used when the transaction is broadcast to the network?</p>

<p>Thanks in advance for your help.</p>

<h2>Edit</h2>

<p>Hi. Thank you for your reply. I'm panicking a bit as I have to get this sorted by tomorrow. I've tried setting "paytxfee" with the "settxfee" command. In the last example I sent a dummy transaction using "sendtoaddress". I entered "0.00170" in the "paytxfee" global variable (170 satoshis per byte). Having looked at the resultant transaction on Blockchain.com explorer, only 114 sat/B were used instead of the requested 170. When I used "fundrawtransaction" and specified a "feeRate" option, it was calcultaing the fee on the virtual size rather than the total size, so once again I was getting about a 40% reduction in fees once the transaction was broadcast. I now have loads of transactions stuck!! Anyway, that's not a problem as they were only tests... Any ideas how I can resolve this? Happy to send screenshots or maybe we can email/use messenger? Desperate to get this sorted .... Thank you so much!</p>

CC BY-SA 4.0
2020-05-19T00:28:55.143Z
Is the resulting feerate wrong? `fundrawtransaction` will try to predict the size of the signatures (even before they're actually added), and use that to determine the total fee.
Pieter Wuille
CC BY-SA 4.0
2020-05-19T00:40:07.537Z
My reply was too big so I've appended it on to the bottom of the question for you. Thank you!
user3931836
<blockchain><bitcoind><transaction-fees><bitcoin-cli>
Problems Setting a Transaction Fee on a Per Transaction Basis Bitcoind
user3931836
# Problems Setting a Transaction Fee on a Per Transaction Basis Bitcoind

(Asked by: username_0 on 2020-05-18)

I've spent hours and hours trying to find a solution to this problem, with no success.

Using Bitcoin Core on a Linux machine, so using bitcoin-cli to process commands back to the daemon.

Here's what I want to achieve: I want to send a transaction and be able to specify a custom transaction fee in Bitcoin/KB on a "per transaction basis".

So far, I haven't found a solution. These are the areas I have been looking at:

Change the paytxfee global variable and then just send the transaction. ---> If I do this, the resultant fee once the transaction has been sent is about 40% lower than what I specified in the `paytxfee` variable. Why is it smaller?

So.... does anyone please have any ideas how I can just send a transaction and specify a custom fee which is the actual fee used when the transaction is broadcast to the network?

Thanks in advance for your help.

## Edit

Hi. Thank you for your reply. I'm panicking a bit as I have to get this sorted by tomorrow. I've tried setting "paytxfee" with the "settxfee" command. In the last example I sent a dummy transaction using "sendtoaddress". I entered "0.00170" in the "paytxfee" global variable (170 satoshis per byte). Having looked at the resultant transaction on Blockchain.com explorer, only 114 sat/B were used instead of the requested 170. When I used "fundrawtransaction" and specified a "feeRate" option, it was calcultaing the fee on the virtual size rather than the total size, so once again I was getting about a 40% reduction in fees once the transaction was broadcast. I now have loads of transactions stuck!! Anyway, that's not a problem as they were only tests... Any ideas how I can resolve this? Happy to send screenshots or maybe we can email/use messenger? Desperate to get this sorted .... Thank you so much!

**Tags:** blockchain, bitcoind, transaction-fees, bitcoin-cli

> **Comments:**
> **username_1**: Is the resulting feerate wrong? `fundrawtransaction` will try to predict the size of the signatures (even before they're actually added), and use that to determine the total fee.  
> **username_0**: My reply was too big so I've appended it on to the bottom of the question for you. Thank you!  

---

## 0 answers

