<p>Bitcoin transaction fees are implied by <code>sum(vin) - sum(vout)</code>. The daemon doesn't display fee information on transactions you did not create because the value of the inputs isn't retained after they have been spent. </p>

<p>Block explorers show information that takes an additional set of indexes, it's not fair to compare the information shown by one and that returned by a very light weight full node. If you need more information like this on a regular basis you can use a middle layer like <a href="https://github.com/bitpay/insight-api" rel="nofollow">Bitpays Insight</a> which will maintain a comprehensive index of this sort of information for you externally. </p>

CC BY-SA 3.0
2015-08-27T00:01:33.577Z
2015-08-27T00:01:33.577Z
Claris
<p>I performed a bitcoin payment in the testnet, here is what I get when I execute <code>bitcoin-cli gettransaction "11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e"</code>, as you can see the info doesn't include the fee charged in the transaction:</p>

<pre><code>{
    "amount" : 0.20000000,
    "confirmations" : 2148,
    "blockhash" : "0000000086bd0907763b02e8bcd45b18d9320441b7ffe7c019e9c95795c35cd9",
    "blockindex" : 3,
    "blocktime" : 1439865905,
    "txid" : "11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e",
    "walletconflicts" : [
    ],
    "time" : 1439865606,
    "timereceived" : 1439865606,
    "details" : [
        {
            "account" : "",
            "address" : "mn2dMSfAX7s77ZD5jY3k8kjcuwtPLgu1Yi",
            "category" : "receive",
            "amount" : 0.20000000,
            "vout" : 1
        }
    ],
    "hex" : "..................."
}
</code></pre>

<p>But on <a href="https://www.blocktrail.com/tBTC/tx/11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e" rel="nofollow noreferrer">blocktrail.com</a> I can see the Fee for this same transaction:</p>

<p><a href="https://i.sstatic.net/IeQxX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IeQxX.png" alt="detail of the transaction on blocktrail.com"></a></p>

<client><json-rpc><transaction-fees>
How can I get the Fee involved in a Bitcoin transaction using RPC client (bitcoin-cli)?
Diego vDev
# How can I get the Fee involved in a Bitcoin transaction using RPC client (bitcoin-cli)?

(Asked by: username_0 on 2015-08-26)

I performed a bitcoin payment in the testnet, here is what I get when I execute `bitcoin-cli gettransaction "11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e"`, as you can see the info doesn't include the fee charged in the transaction:

```
{
    "amount" : 0.20000000,
    "confirmations" : 2148,
    "blockhash" : "0000000086bd0907763b02e8bcd45b18d9320441b7ffe7c019e9c95795c35cd9",
    "blockindex" : 3,
    "blocktime" : 1439865905,
    "txid" : "11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e",
    "walletconflicts" : [
    ],
    "time" : 1439865606,
    "timereceived" : 1439865606,
    "details" : [
        {
            "account" : "",
            "address" : "mn2dMSfAX7s77ZD5jY3k8kjcuwtPLgu1Yi",
            "category" : "receive",
            "amount" : 0.20000000,
            "vout" : 1
        }
    ],
    "hex" : "..................."
}

```

But on [blocktrail.com](https://www.blocktrail.com/tBTC/tx/11b8d5f89793e83e9e10b7ee51fa1b3445f6029f7d7efe4c82b3b261ec513a0e) I can see the Fee for this same transaction:

[![detail of the transaction on blocktrail.com](https://i.sstatic.net/IeQxX.png)](https://i.sstatic.net/IeQxX.png)

**Tags:** client, json-rpc, transaction-fees


---

## 1 answers

### Answer by username_1 on 2015-08-27. Score: 1 | Accepted answer

Bitcoin transaction fees are implied by `sum(vin) - sum(vout)`. The daemon doesn't display fee information on transactions you did not create because the value of the inputs isn't retained after they have been spent.

Block explorers show information that takes an additional set of indexes, it's not fair to compare the information shown by one and that returned by a very light weight full node. If you need more information like this on a regular basis you can use a middle layer like [Bitpays Insight](https://github.com/bitpay/insight-api) which will maintain a comprehensive index of this sort of information for you externally.


---

