Git Product home page Git Product logo

btc-dumper's Introduction

Find Bitcoin addresses with a positive balance

Simple utility to list all bitcoin addresses with a positive balance.

The approach is analyzes all current unspent transaction output (UTXO) sets and aggregates the outputs to same addresses together. It then writes the result to a CSV file or an SQLite database.

Getting started

Install Docker and you're ready to go.

docker build -t btc-dumper .
docker run -v $(pwd):/build btc-dumper python main.py result.csv --database sqlite3.db

Or, if you do not want to install Docker, install the dependencies with pip on your host system manually:

pip install -r requirements.txt

Chainstate database

You will need local copy of the BTC chainstate database. This can be created by Bitcoin core after the client has been synced with the Bitcoin network.

To get an up to date collection of transactions, refresh it using bitcoind. Wait until the daemon has fetched all the latest blocks from the network, which you can check with bitcoin-cli getblockchaininfo. Then stop bitcoind, using bitcoin-cli stop, before running this utility.

Usage:

To write each address balance to result.csv you can run the snippet below:

./main.py --outputFile result.csv

If you instead want to save the results to a SQLite database instead of a file, you can instead run this snippet:

./main.py --database sqlite.db

CLI flags

Use ./main.py -h to print the options and flags available.

  • chainstate: If you do not have a chainstate file in $HOME/.bitcoin/chainstate, then you can specify another path the --chainstate flag.
  • outputFile: Path to file to write address balances to.
  • database: Path to SQLite database to store address balances to.

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

Acknowledgement

This repo is based on Graymauser's btcposbal2csv. This repo is merely a refactor of that repo.

Another acknowledgement goes to bitcoin_tools, which is the basis for utils.py, which does all the heavy lifting.

Support

If you like this utility, please consider supporting and starring both btcposbal2csv and bitcoin_tools.

To support bitcoin_tools you can send BTC to 1srgihPwqtNkY3MWDNu6sxgCFcmp5Ne8n.

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.