<p>I haven't read any papers trying to analyze the amount of unspent outputs. More often, people are interested in the distribution of address' balances. This could be interesting because it reflects how evenly distributed bitcoin is. </p>

<p>I did find this article: <a href="http://www.coindesk.com/what-block-chain-analysis-tells-bitcoin/" rel="nofollow noreferrer">http://www.coindesk.com/what-block-chain-analysis-tells-bitcoin/</a>, which seems like it might be of interest to you and is related to the distribution of UTXOs. </p>

<p>If you call <code>gettxoutsetinfo</code> with the Bitcoin Core RPC calls, it tells some basic info about the UTXO set. I just did this and got:</p>

<pre><code>{
    "height" : 338396,
    "bestblock" : "000000000000000009f32437cb28d54ff600ec020778c8ce84ecf93b99d5218c",
    "transactions" : 4525842,
    "txouts" : 16217914,
    "bytes_serialized" : 566046691,
    "hash_serialized" : "1ad2172e4d37ce21291c116580f5b527e4c302b9c2ce4e88a91c0c00f748fb8d",
    "total_amount" : 13709764.78496462
}
</code></pre>

<p>So it seems that the average amount of an UTXO is:</p>

<blockquote>
  <p>13709764.78496462 / 16217914 = 0.84534699</p>
</blockquote>

<hr>

<p>To analyze the amount of outputs (note, this is not <em>only</em> UTXOs), I wrote up this quick script:</p>

<pre><code>&lt;?php

require_once 'jsonRPCClient.php';

$bitcoin = new jsonRPCClient('http://{username}:{password}@127.0.0.1:8332/');

$info = $bitcoin-&gt;getinfo();

$height = $info['blocks'];
$numTrials = 1000;
$includeCoinbase = false;


$cutoffs = array();

for ($i = 0; $i &lt; 10; $i++) { $cutoffs[] = $i; }
for ($i = 1; $i &lt; 10; $i++) { $cutoffs[] = 10*$i; }
for ($i = 1; $i &lt; 10; $i++) { $cutoffs[] = 100*$i; }
for ($i = 1; $i &lt; 10; $i++) { $cutoffs[] = 1000*$i; }

function GetRange($value) 
{
    global $cutoffs;
    for ($i = 0; $i &lt; count($cutoffs)-1; $i++)
    {
        if ($cutoffs[$i] &lt;= $value &amp;&amp; $value &lt; $cutoffs[$i+1])
            return $cutoffs[$i] . " - " . $cutoffs[$i+1];
    }
    return $cutoffs[count($cutoffs)-1] . " - ...";
}

$sum = 0;
$distribution = array();

for ($i = 0; $i &lt; $numTrials; $i++) 
{

    $blockhash = $bitcoin-&gt;getblockhash(rand(1, $height));
    $block = $bitcoin-&gt;getblock($blockhash);

    $randTxIndex = rand(0, count($block['tx'])-1);

    if ($randTxIndex == 0 &amp;&amp; !$includeCoinbase) {
        $i--;
        continue;
    }

    $randTxHash = $block['tx'][$randTxIndex];

    $randTx = $bitcoin-&gt;getrawtransaction($randTxHash, 1);

    $numOutputs = count($randTx['vout']);
    $randOutput = $randTx['vout'][rand(0, $numOutputs-1)];

    $value = $randOutput['value'];

    $sum += $value;
    $distribution[GetRange($value)] += 1;
}

echo (json_encode($distribution, JSON_PRETTY_PRINT) . "\n");
echo "average: " . ($sum / $numTrials) . "\n";
</code></pre>

<p>And the results are (after being cleaned up a little):</p>

<pre><code>average: 89.55518291596

START   END     COUNT
0       1       636
1       2       73
2       3       18
3       4       20
4       5       14
5       6       11
6       7       8
7       8       8
8       9       11
9       10      12
10      20      36
20      30      26
30      40      15
40      50      16
50      60      29
60      70      5
70      80      5
80      90      4
90      100     3
100     200     29
200     300     4
300     400     4
400     500     1
500     600     1
600     700     1
700     800     1
800     900     3
900     1000    0
1000    2000    2
2000    3000    1
3000    4000    0
4000    5000    0
5000    6000    1
6000    7000    0
7000    8000    0
8000    9000    0
9000    ...     2
</code></pre>

<p>Which, when plotted, gives:</p>

<p><img src="https://i.sstatic.net/B9vPs.png" alt="enter image description here"></p>

<p>And since the 0-1 outputs make the rest go out of scale, this is a plot without the smallest outputs:</p>

<p><img src="https://i.sstatic.net/11dyy.png" alt="enter image description here"></p>

CC BY-SA 3.0
2015-11-05T23:14:37.170Z
The Start and End figures, is that satoshis or bitcoins? Thank you for your hard work!
Murch
CC BY-SA 3.0
2015-01-10T21:05:05.210Z
2015-01-10T21:05:05.210Z
morsecoder
<p>I am working on a simulation to explore the usefulness of a patch for the <a href="https://bitcoin.stackexchange.com/a/29962/5406">CoinSelection</a> behaviour of BitcoinCore. To that end, I am looking for statistics on the distribution of unspent outputs respective to their value in satoshi. </p>

<p>So far, I haven't found much on the topic beside an outdated <a href="https://bitcoin.stackexchange.com/q/3524/5406">number of unspent transaction outputs</a>, as likely search terms collide with a lot of unrelated topics.</p>

<p>Are there any papers or other sources that discuss:</p>

<ul>
<li>How can one realistically model the distribution of the value (in satoshi) of all UTXO (unspent transaction outputs)? </li>
<li>What type of curve best approximates the distribution?</li>
<li>What are mean, standard deviation, and variance of the network's UTXOs' values?</li>
<li>Bonus: How did the distribution of UTXO' values change over time?</li>
</ul>

<p>Clarification: I am interested in modelling the number of satoshi held in UTXO.</p>

CC BY-SA 3.0
2014-10-03T12:55:45.217Z
All of those questions would be answerable from the block chain. I would plot it as a histogram with x being the value of the UTXOs and y being the number of them.
Tyler
CC BY-SA 3.0
2014-10-19T12:41:08.420Z
There's multiple properties related to UTXO that come to my mind (e.g. index number, amount, script, txid, age...) - distribution of what quantity do you mean? Try to be more specific please.
knaperek
CC BY-SA 3.0
2014-10-19T13:06:53.727Z
@JozefKnaperek: Thanks, I was too much in the topic to realize that you could read it in so many different ways. I hope it is clearer now.
Murch
CC BY-SA 3.0
2014-10-19T13:07:34.070Z
@Tyler: Yeah, I am aware of that. However, my question was, whether I have to do that work, or if someone else already has.
Murch
CC BY-SA 3.0
2014-10-19T14:09:15.977Z
OK, makes sense to me now. But I haven't seen such analysis so far; I've found some [nice online charts](http://btc.blockr.io/charts), but none of them does seem to be exactly what you're looking for. You can contact them though and they might add it (i.e. do the work for you :-)). Otherwise I guess you're on your own.
knaperek
CC BY-SA 3.0
2014-10-19T22:44:31.013Z
UTXO's are stored in the Chainstate. Something like [Levelhud](https://github.com/ricardobeat/levelhud) to make navigating it better.
KJ O
<academic-research><utxo>
How can one realistically model the distribution of the network's unspent transaction outputs?
Murch
# How can one realistically model the distribution of the network's unspent transaction outputs?

(Asked by: username_0 on 2014-10-03)

I am working on a simulation to explore the usefulness of a patch for the [CoinSelection](https://bitcoin.stackexchange.com/a/29962/5406) behaviour of BitcoinCore. To that end, I am looking for statistics on the distribution of unspent outputs respective to their value in satoshi.

So far, I haven't found much on the topic beside an outdated [number of unspent transaction outputs](https://bitcoin.stackexchange.com/q/3524/5406), as likely search terms collide with a lot of unrelated topics.

Are there any papers or other sources that discuss:

* How can one realistically model the distribution of the value (in satoshi) of all UTXO (unspent transaction outputs)?
* What type of curve best approximates the distribution?
* What are mean, standard deviation, and variance of the network's UTXOs' values?
* Bonus: How did the distribution of UTXO' values change over time?

Clarification: I am interested in modelling the number of satoshi held in UTXO.

**Tags:** academic-research, utxo

> **Comments:**
> **username_1**: All of those questions would be answerable from the block chain. I would plot it as a histogram with x being the value of the UTXOs and y being the number of them.  
> **username_2**: There's multiple properties related to UTXO that come to my mind (e.g. index number, amount, script, txid, age...) - distribution of what quantity do you mean? Try to be more specific please.  
> **username_0**: @JozefKnaperek: Thanks, I was too much in the topic to realize that you could read it in so many different ways. I hope it is clearer now.  
> **username_0**: @username_1: Yeah, I am aware of that. However, my question was, whether I have to do that work, or if someone else already has.  
> **username_2**: OK, makes sense to me now. But I haven't seen such analysis so far; I've found some [nice online charts](http://btc.blockr.io/charts), but none of them does seem to be exactly what you're looking for. You can contact them though and they might add it (i.e. do the work for you :-)). Otherwise I guess you're on your own.  
> **username_3**: UTXO's are stored in the Chainstate. Something like [Levelhud](https://github.com/ricardobeat/levelhud) to make navigating it better.  

---

## 1 answers

### Answer by username_4 on 2015-01-10. Score: 3 | Accepted answer

I haven't read any papers trying to analyze the amount of unspent outputs. More often, people are interested in the distribution of address' balances. This could be interesting because it reflects how evenly distributed bitcoin is. 
I did find this article: http://www.coindesk.com/what-block-chain-analysis-tells-bitcoin/, which seems like it might be of interest to you and is related to the distribution of UTXOs. 
If you call gettxoutsetinfo with the Bitcoin Core RPC calls, it tells some basic info about the UTXO set. I just did this and got:
{
    "height" : 338396,
    "bestblock" : "000000000000000009f32437cb28d54ff600ec020778c8ce84ecf93b99d5218c",
    "transactions" : 4525842,
    "txouts" : 16217914,
    "bytes_serialized" : 566046691,
    "hash_serialized" : "1ad2172e4d37ce21291c116580f5b527e4c302b9c2ce4e88a91c0c00f748fb8d",
    "total_amount" : 13709764.78496462
}

So it seems that the average amount of an UTXO is:

13709764.78496462 / 16217914 = 0.84534699


To analyze the amount of outputs (note, this is not only UTXOs), I wrote up this quick script:
getinfo();

$height = $info['blocks'];
$numTrials = 1000;
$includeCoinbase = false;


$cutoffs = array();

for ($i = 0; $i < 10; $i++) { $cutoffs[] = $i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 10*$i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 100*$i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 1000*$i; }

function GetRange($value) 
{
    global $cutoffs;
    for ($i = 0; $i < count($cutoffs)-1; $i++)
    {
        if ($cutoffs[$i] <= $value && $value < $cutoffs[$i+1])
            return $cutoffs[$i] . " - " . $cutoffs[$i+1];
    }
    return $cutoffs[count($cutoffs)-1] . " - ...";
}

$sum = 0;
$distribution = array();

for ($i = 0; $i < $numTrials; $i++) 
{

    $blockhash = $bitcoin->getblockhash(rand(1, $height));
    $block = $bitcoin->getblock($blockhash);

    $randTxIndex = rand(0, count($block['tx'])-1);

    if ($randTxIndex == 0 && !$includeCoinbase) {
        $i--;
        continue;
    }

    $randTxHash = $block['tx'][$randTxIndex];

    $randTx = $bitcoin->getrawtransaction($randTxHash, 1);

    $numOutputs = count($randTx['vout']);
    $randOutput = $randTx['vout'][rand(0, $numOutputs-1)];

    $value = $randOutput['value'];

    $sum += $value;
    $distribution[GetRange($value)] += 1;
}

echo (json_encode($distribution, JSON_PRETTY_PRINT) . "\n");
echo "average: " . ($sum / $numTrials) . "\n";

And the results are (after being cleaned up a little):
average: 89.55518291596

START   END     COUNT
0       1       636
1       2       73
2       3       18
3       4       20
4       5       14
5       6       11
6       7       8
7       8       8
8       9       11
9       10      12
10      20      36
20      30      26
30      40      15
40      50      16
50      60      29
60      70      5
70      80      5
80      90      4
90      100     3
100     200     29
200     300     4
300     400     4
400     500     1
500     600     1
600     700     1
700     800     1
800     900     3
900     1000    0
1000    2000    2
2000    3000    1
3000    4000    0
4000    5000    0
5000    6000    1
6000    7000    0
7000    8000    0
8000    9000    0
9000    ...     2

Which, when plotted, gives:

And since the 0-1 outputs make the rest go out of scale, this is a plot without the smallest outputs:

> **Comments:**
> **username_0**: The Start and End figures, is that satoshis or bitcoins? Thank you for your hard work!  

---

