<p>Transactions vary a lot in data size, so it's usually more useful to compare the feerates of transactions rather than absolute fees. For example, a transaction that batches fifty payments may pay the same feerate, but a significantly higher fee, while still having a lower fee per payment than a transaction that performs a single payment.</p>
<p>You may find this block feerate composition graph (via <a href="https://dashboard.bitcoinops.org/d/4Pm4uKFmk/fee-rate-comparison?orgId=1&amp;from=now-30d&amp;to=now" rel="nofollow noreferrer">Bitcoin Optech Group</a>) interesting to get a sense of how feerates changed historically. While the data is a bit noisy for single blocks beyond a day or two, the 12-block average gives a sense of how fee rates change over the course of a day and the week, while the 144-block average may be interesting for bigger timeframes:</p>
<p><a href="https://i.sstatic.net/6Q207.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6Q207.png" alt="Bitcoin Optech Group's block feerate percentile graph" /></a></p>
<p>There is also this <a href="https://anduck.net/bitcoin/fees/144_blocks.php" rel="nofollow noreferrer">graph by Anduck</a> that splits out blocks more precisely, but only for the recent past:</p>
<p><a href="https://i.sstatic.net/nQAPH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nQAPH.png" alt="Anduck's 144-block fee per transaction chart" /></a></p>

CC BY-SA 4.0
2021-03-21T18:36:30.143Z
2021-03-21T18:36:30.143Z
Murch
<p>I think we have exactly the plot you are looking for in our paper <em><a href="https://arxiv.org/abs/2106.08072" rel="nofollow noreferrer">Full Bitcoin Blockchain Data Made Easy</a></em> (Figure 7):</p>
<p><a href="https://i.sstatic.net/NGb5S.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NGb5S.jpg" alt="enter image description here" /></a></p>
<p>This is a <em>cumulative distribution</em>: for each amount on the horizontal axis, we plot the fraction of transactions that have fees lower than or equal to this value.</p>
<p>As suggested by Joseph, we downloaded the whole blockchain and computed the fees (difference between output and input amounts) of each transaction. The figure also displays the fee distribution for the last million transactions, since putting together all fees actually makes little sense, as discussed in comments above.</p>
<p><a href="http://bitcoin.complexnetworks.fr" rel="nofollow noreferrer">Code and data are publicly available.</a> In particular, the 12GB compressed text file <a href="http://data.complexnetworks.fr/bitcoin/blockchain.distilled_amounts.gz" rel="nofollow noreferrer">blockchain.distilled_amounts.gz</a> contains a line per transaction, with its input and output amounts (see the paper for details).</p>

CC BY-SA 4.0
2021-06-16T13:06:39.730Z
Bravo for sharing your hard work and making it available to other interested parties. Great idea to include 'most recent million'. Of those, looks like the vast majority of the fees are between 0.00001 and 0.01 BTC. I'd be extremely curious to see the plot without log x axis and a non-cumulative distribution. Also curious, what is the file size of the 12gb file when uncompressed (e.g. in RAM)?
stevec
CC BY-SA 4.0
2021-06-16T19:11:35.657Z
I uploaded the raw distributions for you at http://latapy.complexnetworks.fr/fees_d and http://latapy.complexnetworks.fr/last_fees_d so you may play with them and try all sorts of scales :) The fees in satoshis are in the first field, then comes the number of occurrences of this fee amount.
Matthieu Latapy
CC BY-SA 4.0
2021-06-16T19:43:13.150Z
Regarding your question on the uncompressed data, the 12GB become 42GB. It is plain text format, though, so not optimized. It lists the amount of each input and each output of each of the 623,483,734 transactions we have, which leads to a total of 3,225,135,853 values; with 32 bit integers, you may store this in slightly more than 12GB RAM, if I am correct.
Matthieu Latapy
CC BY-SA 4.0
2021-06-17T05:40:18.547Z
Amazing. Did you use vanilla python on a large computer (i.e. >42GB ram), or something like spark, or some other tool (e.g. BigQuery) to analyse the uncompressed file? It would be pretty great to place in something like a public BigQuery dataset.
stevec
CC BY-SA 4.0
2021-06-17T05:43:35.043Z
Thanks also for making the raw fee data available. When I get a chance, I'll try to plot them using ggplot or similar, I will provide the plot/code if I do.
stevec
CC BY-SA 4.0
2021-06-17T06:37:19.207Z
:) Our goal was to show that one may quite easily and efficiently handle the full blockchain data with basic tools (small python scripts and command lines). This actually is the most effective way for various processing tasks. Using more advanced technologies for more advanced tasks is a perspective, and we release the data for this. I would love to see what others do with it.
Matthieu Latapy
CC BY-SA 4.0
2021-06-20T02:50:17.463Z
Thanks for the bounty! Please consider accepting this answer too, if you think it does answer your question :)
Matthieu Latapy
CC BY-SA 4.0
2021-06-16T12:53:36.127Z
2021-06-16T12:53:36.127Z
Matthieu Latapy
<p>The transaction fees can be calculated by subtracting each transaction's inputs from its outputs – that difference is the fee. I would guess your best bet is to clone <a href="https://github.com/bitcoin/bitcoin" rel="nofollow noreferrer">Bitcoin Core</a>, download the entire blockchain, and start parsing the data yourself.</p>
<p>If that sounds like too much, I would start <a href="https://bitcoin.org/en/full-node" rel="nofollow noreferrer">here</a> and then ask another question once you get a full node up and running.</p>
<p>Best of luck!</p>

CC BY-SA 4.0
2021-03-21T03:13:56.617Z
+1 Great to know it's possible! I think DIYing it would be marvellous learning, however, do you know if someone would already have attempted it and stored the resulting data somewhere?
stevec
CC BY-SA 4.0
2021-03-21T03:09:58.123Z
2021-03-21T03:09:58.123Z
Joseph Gill
<p>Is there a way to find and plot every transaction fee ever paid on the blockchain/bitcoin?</p>
<h3>Background</h3>
<p>I have read about <a href="https://www.coindesk.com/saving-bitcoin-high-transaction-fees" rel="noreferrer">transaction fees</a>:</p>
<blockquote>
<p>Though the average Bitcoin transaction may be around $25, for example, the median is closer to what most users will likely need to pay.</p>
</blockquote>
<blockquote>
<p>At that rate, if you want to send a transaction right away, the fastest transaction fee is currently around 102 satoshis/byte, according to bitcoinfees.earn. For a median transaction size of 224 bytes, this results in a fee of 22,848 satoshis, or $11. If you don’t mind waiting roughly a half hour, the price would be 83 satoshis/byte, or about $9. The price continues to slide down from there if you’re willing to wait even longer.</p>
</blockquote>
<p>So this gives very useful info, but if I want to see the distribution of all historical transaction fees on the blockchain, how could I do that?</p>
<p>Also, because the value of bitcoin has changed a great deal over the past several years, it would be sensible to measure the transaction fees in USD equivalent (like the article does).</p>
<p>Is this easy to do (or even possible at all)?</p>

<transactions><transaction-fees><mining-reward>
Plot of distribution of all bitcoin transaction fees paid?
stevec
# Plot of distribution of all bitcoin transaction fees paid?

(Asked by: username_0 on 2021-03-21)

Is there a way to find and plot every transaction fee ever paid on the blockchain/bitcoin?

### Background

I have read about [transaction fees](https://www.coindesk.com/saving-bitcoin-high-transaction-fees):

> Though the average Bitcoin transaction may be around $25, for example, the median is closer to what most users will likely need to pay.

> At that rate, if you want to send a transaction right away, the fastest transaction fee is currently around 102 satoshis/byte, according to bitcoinfees.earn. For a median transaction size of 224 bytes, this results in a fee of 22,848 satoshis, or $11. If you don’t mind waiting roughly a half hour, the price would be 83 satoshis/byte, or about $9. The price continues to slide down from there if you’re willing to wait even longer.

So this gives very useful info, but if I want to see the distribution of all historical transaction fees on the blockchain, how could I do that?

Also, because the value of bitcoin has changed a great deal over the past several years, it would be sensible to measure the transaction fees in USD equivalent (like the article does).

Is this easy to do (or even possible at all)?

**Tags:** transactions, transaction-fees, mining-reward


---

## 3 answers

### Answer by username_1 on 2021-03-21. Score: 3

Transactions vary a lot in data size, so it's usually more useful to compare the feerates of transactions rather than absolute fees. For example, a transaction that batches fifty payments may pay the same feerate, but a significantly higher fee, while still having a lower fee per payment than a transaction that performs a single payment.

You may find this block feerate composition graph (via [Bitcoin Optech Group](https://dashboard.bitcoinops.org/d/4Pm4uKFmk/fee-rate-comparison?orgId=1&from=now-30d&to=now)) interesting to get a sense of how feerates changed historically. While the data is a bit noisy for single blocks beyond a day or two, the 12-block average gives a sense of how fee rates change over the course of a day and the week, while the 144-block average may be interesting for bigger timeframes:

[![Bitcoin Optech Group's block feerate percentile graph](https://i.sstatic.net/6Q207.png)](https://i.sstatic.net/6Q207.png)

There is also this [graph by Anduck](https://anduck.net/bitcoin/fees/144_blocks.php) that splits out blocks more precisely, but only for the recent past:

[![Anduck's 144-block fee per transaction chart](https://i.sstatic.net/nQAPH.png)](https://i.sstatic.net/nQAPH.png)


---

### Answer by username_2 on 2021-06-16. Score: 2

I think we have exactly the plot you are looking for in our paper *[Full Bitcoin Blockchain Data Made Easy](https://arxiv.org/abs/2106.08072)* (Figure 7):

[![enter image description here](https://i.sstatic.net/NGb5S.jpg)](https://i.sstatic.net/NGb5S.jpg)

This is a *cumulative distribution*: for each amount on the horizontal axis, we plot the fraction of transactions that have fees lower than or equal to this value.

As suggested by username_3, we downloaded the whole blockchain and computed the fees (difference between output and input amounts) of each transaction. The figure also displays the fee distribution for the last million transactions, since putting together all fees actually makes little sense, as discussed in comments above.

[Code and data are publicly available.](http://bitcoin.complexnetworks.fr) In particular, the 12GB compressed text file [blockchain.distilled\_amounts.gz](http://data.complexnetworks.fr/bitcoin/blockchain.distilled_amounts.gz) contains a line per transaction, with its input and output amounts (see the paper for details).

> **Comments:**
> **username_0**: Bravo for sharing your hard work and making it available to other interested parties. Great idea to include 'most recent million'. Of those, looks like the vast majority of the fees are between 0.00001 and 0.01 BTC. I'd be extremely curious to see the plot without log x axis and a non-cumulative distribution. Also curious, what is the file size of the 12gb file when uncompressed (e.g. in RAM)?  
> **username_2**: I uploaded the raw distributions for you at http://username_2.complexnetworks.fr/fees_d and http://username_2.complexnetworks.fr/last_fees_d so you may play with them and try all sorts of scales :) The fees in satoshis are in the first field, then comes the number of occurrences of this fee amount.  
> **username_2**: Regarding your question on the uncompressed data, the 12GB become 42GB. It is plain text format, though, so not optimized. It lists the amount of each input and each output of each of the 623,483,734 transactions we have, which leads to a total of 3,225,135,853 values; with 32 bit integers, you may store this in slightly more than 12GB RAM, if I am correct.  
> **username_0**: Amazing. Did you use vanilla python on a large computer (i.e. >42GB ram), or something like spark, or some other tool (e.g. BigQuery) to analyse the uncompressed file? It would be pretty great to place in something like a public BigQuery dataset.  
> **username_0**: Thanks also for making the raw fee data available. When I get a chance, I'll try to plot them using ggplot or similar, I will provide the plot/code if I do.  
> **username_2**: :) Our goal was to show that one may quite easily and efficiently handle the full blockchain data with basic tools (small python scripts and command lines). This actually is the most effective way for various processing tasks. Using more advanced technologies for more advanced tasks is a perspective, and we release the data for this. I would love to see what others do with it.  
> **username_2**: Thanks for the bounty! Please consider accepting this answer too, if you think it does answer your question :)  

---

### Answer by username_3 on 2021-03-21. Score: 1

The transaction fees can be calculated by subtracting each transaction's inputs from its outputs – that difference is the fee. I would guess your best bet is to clone [Bitcoin Core](https://github.com/bitcoin/bitcoin), download the entire blockchain, and start parsing the data yourself.

If that sounds like too much, I would start [here](https://bitcoin.org/en/full-node) and then ask another question once you get a full node up and running.

Best of luck!

> **Comments:**
> **username_0**: +1 Great to know it's possible! I think DIYing it would be marvellous learning, however, do you know if someone would already have attempted it and stored the resulting data somewhere?  

---

