7

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.

11

This guy wanted to do the same thing. You can find a solution there.

in short:

  • get a Linux Box/VM with >=8GB RAM
  • download 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.

| improve this answer | |
  • how to get ALL "nonzero" balances? – Denis Leonov Jan 5 '18 at 22:29
  • I am sorry, I don't remember. It was 4 years ago – Maciej Mączko Jan 6 '18 at 15:00
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.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.