Giter Site home page Giter Site logo

btcposbal2csv's Introduction

Dump Bitcoin addresses with positive balance

Simple utility to list all bitcoin addresses with positive balance. It works by analysing the current unspent transaction output set (UTXO), aggregating outputs to same addresses together and write them to csv file.

Prequisities:

python 2.7
pip

To install:

run pip install -r requirements.txt

or install following packages with pip manualy

  • hashlib
  • plyvel
  • base58
  • sqlite3

Usage

To use you will need copy of chainstate database as created by bitcoin core client. I've not tried different clients.

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 (usualy $HOME/.bitcoin/chainstate).

Show help

python btcposbal2csv.py -h

Example:

Following will read from /home/USER/.bitcoin/chainstate, and write result to /home/USER/addresses_with_balance.csv.

python btcposbal2csv.py /home/USER/.bitcoin/chainstate /home/USER/addresses_with_balance.csv
Notice
  • 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.

Converting to RIPEMD160

Per request, I'm adding script which is able to convert BTC address to RIPEMD160 representation. BTC address must be in fist column, RIPEMD160 is added to csv. Output goes to stdout.

Example:

python convert2ripemd160.py /home/USER/addresses_with_balance.csv

Acknowledgement

This utility builds on very nice bitcoin_tools lib, which does the UTXO parsing.

Support

If you like this utility, please consider supporting the bitcoin_tools library which does all the heavy lifting.

If this particular functionality made your life easier you can support coffee consumption in BTC 1FxC1mgJkad63beJcECfZMRaFSf4PBLr2f.

btcposbal2csv's People

Contributors

graymauser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.