<p>The sizes you give don't match the paper. I can't even find mention of the sizes you give in the paper itself. Those sizes are incredibly wrong and way too large. They seem to be for <em>input</em> sizes, not output sizes. Input sizes are irrelevant to the UTXO set.</p>

<p>P2PKH are 21 bytes, P2SH are 21 bytes, P2PK are 33 bytes, everything else is their actual script size.</p>

<ul>
<li>P2PKH = 1.147 GB</li>
<li>P2SH = 0.2393 GB</li>
</ul>

<p>I've decided to omit the other outputs types because there are so few of them that their size is negligible.</p>

<p>The amounts are at most 0.5328 GB. However the amounts are compressed, so that should actually be smaller.</p>

<p>The outpoints (txids and output indexes) are at most 2.398 GB.</p>

<p>So in total the serialized UTXO set is approximately 4.3171 GB which is close to what we actually observe.</p>

<p>There are some more bytes due to the omitted scripts and because of the LevelDB's overhead, but there shouldn't be much (and certainly not several GB). Additionally the amounts and the output indexes are compressed which significantly reduces the serialized size. So in total, it's ~4 GB. My node reports 3.9 GB.</p>

CC BY-SA 4.0
2020-04-17T11:14:44.037Z
https://eprint.iacr.org/2017/1095.pdf .Look at table 3. I think I misunderstood the paper.
Cisco Mmu
CC BY-SA 4.0
2020-04-17T17:09:08.577Z
Table 3 is for *input* sizes. The UTXO set contains *outputs*. You want the output sizes which, AFAICT, are not listed in the paper.
Ava Chow
CC BY-SA 4.0
2020-04-18T06:06:03.680Z
ok TQ TQ, Noted.  The table put p2pK and the sigscript on the same row. I mistaken it as  P2pk size. Sorry.
Cisco Mmu
CC BY-SA 4.0
2020-04-25T12:18:40.363Z
1. Each UTXO entry must add 8 bytes for bitcoin amount in satoshi.  2. P2PK got 2 format compressed is 34 bytes(~50%), uncompressed is 67 bytes (~50%).  Just finish manually decoding few bitcoin TX to understand it better.
Cisco Mmu
CC BY-SA 4.0
2020-04-17T02:30:50.873Z
2020-04-17T02:30:50.873Z
Ava Chow
<p>According to S. Delgado-Segura, C. Pérez-Sola, G. Navarro-Arribas, J. Herrera-Joancomartí, "Analysis of the Bitcoin UTXO set", Financial Cryptography and Data Security, pp. 78-91, 2019, the distribution of the UTXO set as of 2017 was:</p>

<pre><code>No of UTXO                  52,543,649   100%      Size
Pay-to-PubkeyHash (P2PKH)   43,079,604    81.99%   147-179 bytes
Pay-to-ScriptHash(P2SH)      8,987,799    17.11%   40 - ? bytes
Pay-to-Pubkey(P2PK)             66,759     0.1%    113 bytes
Others                         409,487     0.8%    114-1483 bytes
</code></pre>

<p>There are 66.6 million UTXO in April 2020. Assuming the same distribution, the size of UTXO set should be approximately:</p>

<pre><code>No of UTXO: 66.6 million = 100%
Pay-to-PubkeyHash (P2PKH)   81.99%    147-179 bytes   7.475712318GB
Pay-to-ScriptHash(P2SH)     17.11%    40 - ? bytes    0.424506515GB
Pay-to-Pubkey(P2PK)          0.1%     113 bytes       0.007008947GB
Others                       0.8%     114-1483bytes   0.056567788GB
Total                                                 7.963795569GB
</code></pre>

<p>Per <a href="https://statoshi.info/dashboard/db/unspent-transaction-output-set" rel="nofollow noreferrer">statoshi.info</a> the serialized UTXO set is 4GB as off April 2020. </p>

<p>I understand UTXO data does not have lot of leading zeros. How can the serialized UTXO set be compressed to 4GB? </p>

<storage-footprint><utxo-set>
How can the compressed UTXO set be stored in just 4GB?
Cisco Mmu
# How can the compressed UTXO set be stored in just 4GB?

(Asked by: username_0 on 2020-04-17)

According to S. Delgado-Segura, C. Pérez-Sola, G. Navarro-Arribas, J. Herrera-Joancomartí, "Analysis of the Bitcoin UTXO set", Financial Cryptography and Data Security, pp. 78-91, 2019, the distribution of the UTXO set as of 2017 was:

```
No of UTXO                  52,543,649   100%      Size
Pay-to-PubkeyHash (P2PKH)   43,079,604    81.99%   147-179 bytes
Pay-to-ScriptHash(P2SH)      8,987,799    17.11%   40 - ? bytes
Pay-to-Pubkey(P2PK)             66,759     0.1%    113 bytes
Others                         409,487     0.8%    114-1483 bytes

```

There are 66.6 million UTXO in April 2020. Assuming the same distribution, the size of UTXO set should be approximately:

```
No of UTXO: 66.6 million = 100%
Pay-to-PubkeyHash (P2PKH)   81.99%    147-179 bytes   7.475712318GB
Pay-to-ScriptHash(P2SH)     17.11%    40 - ? bytes    0.424506515GB
Pay-to-Pubkey(P2PK)          0.1%     113 bytes       0.007008947GB
Others                       0.8%     114-1483bytes   0.056567788GB
Total                                                 7.963795569GB

```

Per [statoshi.info](https://statoshi.info/dashboard/db/unspent-transaction-output-set) the serialized UTXO set is 4GB as off April 2020.

I understand UTXO data does not have lot of leading zeros. How can the serialized UTXO set be compressed to 4GB?

**Tags:** storage-footprint, utxo-set


---

## 1 answers

### Answer by username_1 on 2020-04-17. Score: 3 | Accepted answer

The sizes you give don't match the paper. I can't even find mention of the sizes you give in the paper itself. Those sizes are incredibly wrong and way too large. They seem to be for *input* sizes, not output sizes. Input sizes are irrelevant to the UTXO set.

P2PKH are 21 bytes, P2SH are 21 bytes, P2PK are 33 bytes, everything else is their actual script size.

* P2PKH = 1.147 GB
* P2SH = 0.2393 GB

I've decided to omit the other outputs types because there are so few of them that their size is negligible.

The amounts are at most 0.5328 GB. However the amounts are compressed, so that should actually be smaller.

The outpoints (txids and output indexes) are at most 2.398 GB.

So in total the serialized UTXO set is approximately 4.3171 GB which is close to what we actually observe.

There are some more bytes due to the omitted scripts and because of the LevelDB's overhead, but there shouldn't be much (and certainly not several GB). Additionally the amounts and the output indexes are compressed which significantly reduces the serialized size. So in total, it's ~4 GB. My node reports 3.9 GB.

> **Comments:**
> **username_0**: https://eprint.iacr.org/2017/1095.pdf .Look at table 3. I think I misunderstood the paper.  
> **username_1**: Table 3 is for *input* sizes. The UTXO set contains *outputs*. You want the output sizes which, AFAICT, are not listed in the paper.  
> **username_0**: ok TQ TQ, Noted.  The table put p2pK and the sigscript on the same row. I mistaken it as  P2pk size. Sorry.  
> **username_0**: 1. Each UTXO entry must add 8 bytes for bitcoin amount in satoshi.  2. P2PK got 2 format compressed is 34 bytes(~50%), uncompressed is 67 bytes (~50%).  Just finish manually decoding few bitcoin TX to understand it better.  

---

