3

I am using the default signet network, my txid is 3923927eb3b6213bab5d0bee8364a87eafe357cb4d42ce6c587f0372735c7ff0.

bitcoin-cli listtransactions shows a fee of 0.00596777 when in reality the fee is 0.00000282. Why such a huge discrepancy?

Here is a link to the tx on mempool.space

And here is the output from listtransactions:

{
            abandoned = 0;
            address = tb1q9fnletvwwup855vyqttuya0evaypg0njqdjsv4;
            amount = "-5e-05";
            "bip125-replaceable" = no;
            blockhash = 00000012d461cd4e35b5b41ba81decb75b76bdcf7d84844fc91917f47d760a9f;
            blockheight = 195521;
            blockindex = 440;
            blocktime = 1715698392;
            category = send;
            confirmations = 4991;
            fee = "0.00596777";
            label = "";
            time = 1715696690;
            timereceived = 1715696690;
            txid = 3923927eb3b6213bab5d0bee8364a87eafe357cb4d42ce6c587f0372735c7ff0;
            vout = 3;
            walletconflicts =             (
            );
            wtxid = d4e19c5eb0e51ebe05db73587bf2b52afebafdcc36480befd95e190f01fef9e0;
        }

EDIT: As requested please see output direct from bitcoin-cli. FWIW this is a payjoin tx.

{
    "address": "tb1q9fnletvwwup855vyqttuya0evaypg0njqdjsv4",
    "category": "send",
    "amount": -0.00005000,
    "label": "",
    "vout": 3,
    "fee": 0.00596777,
    "confirmations": 5180,
    "blockhash": "00000012d461cd4e35b5b41ba81decb75b76bdcf7d84844fc91917f47d760a9f",
    "blockheight": 195521,
    "blockindex": 440,
    "blocktime": 1715698392,
    "txid": "3923927eb3b6213bab5d0bee8364a87eafe357cb4d42ce6c587f0372735c7ff0",
    "wtxid": "d4e19c5eb0e51ebe05db73587bf2b52afebafdcc36480befd95e190f01fef9e0",
    "walletconflicts": [
    ],
    "time": 1715696690,
    "timereceived": 1715696690,
    "bip125-replaceable": "no",
    "abandoned": false
  }
4
  • 2
    Where did you get the output from? It doesn't look like the JSONRPC returned by bitcoin-cli. Could you paste the output from bitcoin-cli? Commented Jun 18 at 9:57
  • Yeah, e.g. the fields appear to be sorted alphabetically instead of in the order that bitcoin-cli would output them, and I don’t think that Bitcoin Core would ever output scientific notation. Any chance that this output was post-processed by another program to reach this state?
    – Murch
    Commented Jun 18 at 20:26
  • I am formatting the returned value into pretty printed json. Sure, I will respond asap with the direct value from bitcoin-cli.
    – Fontaine
    Commented Jun 19 at 14:37
  • Have added the unformatted output as an edit above.
    – Fontaine
    Commented Jun 19 at 15:06

1 Answer 1

3

This occurs when one of the inputs is unknown to the wallet, for example when participating in a multiparty transaction like a CoinJoin.

What happens is that the wallet checks to see how much value in the inputs it knows about, and if it is nonzero, computes the fee by subtracting the outputs value from it and then negating. The base assumption in this calculation is that all inputs in the transaction belong to the wallet - if any input is known, then the calculated input value will be nonzero, but all inputs must be known for this calculation to be correct.

So what's happened here is that your transaction has two inputs, one of which is known, one not. The known one appears to be the second input of 0.003. Taking that as the "input value", the calculated fee as -(0.003 - 0.00896777) = -(-0.00596777) = 0.00596777.

One thing to notice here is that the fee is given as a positive number, however the wallet is supposed to be reporting it as a negative number. This is an indicator of this particular issue.

3
  • Interesting, yeah, that checks out: 596777+282 = 597059 which is exactly the first input’s amount. Perhaps we’d be able to discover based on a positive fee that the wallet doesn’t have the entire information and prevent the fee from being displayed.
    – Murch
    Commented Jun 18 at 20:56
  • Ah that may be on my end with regards to the negative value being positive, I am formatting the returned value from bitcoin-cli programmatically. Is there any scenario where it would not make sense to total the input values and output values and subtract them to get the fee?
    – Fontaine
    Commented Jun 19 at 14:39
  • 1
    The wallet really shouldn't be returning the fee here since it can't accurately determine it.
    – Ava Chow
    Commented Jun 19 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.