<p><a href="https://bitcointalk.org/index.php?topic=267618.0" rel="noreferrer">This guy</a> wanted to do the same thing. You can find a solution there.</p>
<blockquote>
<p>in short:</p>
<ul>
<li>get a Linux Box/VM with &gt;=8GB RAM</li>
<li>download <a href="https://github.com/znort987/blockparser" rel="noreferrer">blockparser</a></li>
<li>compile it</li>
<li>run &quot;./parser allBalances  -w 250000 &gt;allBalances.txt&quot;</li>
</ul>
<p>the parser run take around 2 minutes on my vSphere VM (2x3Ghz Xeon, 16GB of RAM)</p>
<p>now you have a list of the top 250.000 adresses sorted by BTC amount.</p>
<p>add some sed/awk/cut magic to make a csv and you are done.</p>
</blockquote>

CC BY-SA 3.0
2018-01-05T22:29:26.130Z
how to get ALL "nonzero" balances?
Denis Leonov
CC BY-SA 3.0
2018-01-06T15:00:25.217Z
I am sorry, I don't remember. It was 4 years ago
Maciej Mączko
CC BY-SA 4.0
2021-07-04T16:44:37.700Z
That's a brilliant answer. You might taken hours to test it out. Thanks and here's an up vote for your hard-working Maciej M.
Lakshitha Kanchana
CC BY-SA 3.0
2013-12-03T23:11:01.970Z
2015-12-20T03:14:26.180Z
2020-06-16T11:10:03.350Z
Maciej Mączko
<p>You can use <a href="https://github.com/graymauser/btcposbal2csv" rel="nofollow noreferrer"><code>btcposbal2csv.py</code> script</a> to export the list to CSV.</p>
<blockquote>
<p>To get current addresses with positive balance, let the full node client sync with the network. Stop the bitcoin-core client before running this utility. If you not stop the client, the database might get corrupted.</p>
</blockquote>
<blockquote>
<p>Then run this program with path to chainstate directory (usually <code>$HOME/.bitcoin/chainstate</code>).</p>
</blockquote>
<p>For example, the following will read from <code>~/.bitcoin/chainstate</code>, and write result to <code>~/addresses_with_balance.csv</code>:</p>
<pre><code>./btcposbal2csv.py /home/USER/.bitcoin/chainstate /home/USER/addresses_with_balance.csv
</code></pre>
<p>Notes:</p>
<blockquote>
<ul>
<li>That the output may not be complete as there are some transactions which are not understood by the decoding lib, or that which do not have &quot;address&quot; at all. Such transactions are not processed. Number of them and the total ammount is displayed after the analysis.</li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>The output csv file only reflects the chainstate leveldb at your disk. So it will always be few blocks behind the network as you need to stop the bitcoin-core client.</li>
</ul>
</blockquote>
<hr />
<p>Other dumps:</p>
<ul>
<li><a href="https://bitkeys.work/download.php" rel="nofollow noreferrer">https://bitkeys.work/download.php</a></li>
</ul>

CC BY-SA 4.0
2020-07-05T00:02:42.777Z
2022-02-22T21:49:38.567Z
2022-02-22T21:49:38.567Z
kenorb
<p>I'm looking for a way to retrieve all address balances of addresses with a non-zero balance in the blockchain.</p>

<p>Is there a software tool that can calculate the balances in an accessible format?
Or perhaps I can download them somewhere?</p>

<p>With an accessible format I mean that it can be interpreted by a computer. Either in a database-structure or in parseable text format.</p>

CC BY-SA 3.0
2015-12-19T19:33:41.770Z
Possible duplicate of [All Bitcoin Public Keys with non-zero balance](http://bitcoin.stackexchange.com/questions/37291/all-bitcoin-public-keys-with-non-zero-balance)
e-sushi
CC BY-SA 3.0
2015-12-21T13:52:27.923Z
Rather the other one would be a duplicate of this one, this one is almost two years older.
Murch
<blockchain><address><raw-data><balance>
How to retrieve all addresses with non-zero balance and their balances?
Steven Roose
# How to retrieve all addresses with non-zero balance and their balances?

(Asked by: username_0 on 2013-12-03)

I'm looking for a way to retrieve all address balances of addresses with a non-zero balance in the blockchain.

Is there a software tool that can calculate the balances in an accessible format?
Or perhaps I can download them somewhere?

With an accessible format I mean that it can be interpreted by a computer. Either in a database-structure or in parseable text format.

**Tags:** blockchain, address, raw-data, balance

> **Comments:**
> **username_1**: Possible duplicate of [All Bitcoin Public Keys with non-zero balance](http://bitcoin.stackexchange.com/questions/37291/all-bitcoin-public-keys-with-non-zero-balance)  
> **username_2**: Rather the other one would be a duplicate of this one, this one is almost two years older.  

---

## 2 answers

### Answer by username_3 on 2013-12-03. Score: 12

[This guy](https://bitcointalk.org/index.php?topic=267618.0) wanted to do the same thing. You can find a solution there.

> in short:
>
> * get a Linux Box/VM with >=8GB RAM
> * download [blockparser](https://github.com/znort987/blockparser)
> * compile it
> * run "./parser allBalances -w 250000 >allBalances.txt"
>
> the parser run take around 2 minutes on my vSphere VM (2x3Ghz Xeon, 16GB of RAM)
>
> now you have a list of the top 250.000 adresses sorted by BTC amount.
>
> add some sed/awk/cut magic to make a csv and you are done.

> **Comments:**
> **username_4**: how to get ALL "nonzero" balances?  
> **username_3**: I am sorry, I don't remember. It was 4 years ago  
> **username_5**: That's a brilliant answer. You might taken hours to test it out. Thanks and here's an up vote for your hard-working Maciej M.  

---

### Answer by username_6 on 2020-07-05. Score: 0

You can use btcposbal2csv.py script to export the list to CSV.

To get current addresses with positive balance, let the full node client sync with the network. Stop the bitcoin-core client before running this utility. If you not stop the client, the database might get corrupted.


Then run this program with path to chainstate directory (usually $HOME/.bitcoin/chainstate).

For example, the following will read from ~/.bitcoin/chainstate, and write result to ~/addresses_with_balance.csv:
./btcposbal2csv.py /home/USER/.bitcoin/chainstate /home/USER/addresses_with_balance.csv

Notes:


That the output may not be complete as there are some transactions which are not understood by the decoding lib, or that which do not have "address" at all. Such transactions are not processed. Number of them and the total ammount is displayed after the analysis.




The output csv file only reflects the chainstate leveldb at your disk. So it will always be few blocks behind the network as you need to stop the bitcoin-core client.



Other dumps:

https://bitkeys.work/download.php


---

