Git Product home page Git Product logo

Comments (4)

alecalve avatar alecalve commented on August 30, 2024

To get unspent outputs you basically need to go through the blockchain and recreate the UTXO set at the point at which you want the balances.

The naive way would be to go through all blocks in historical order and maintain an internal set of unspent outputs, updating it at every block. However, this is not really practical as it is quite slow and memory intensive (last time I tried, I couldn't do it this way on a 16GB RAM machine).

A smarter way would be to chunk the blockchain into manageable size pieces, and for each :

  • create a chunk-level UTXO set
  • maintain a list of outputs that were spent in that chunk not created in it

Once all the chunks have been processed this way, you just need to combine all the chunk-level UTXO sets into a global UTXO set and then remove from it the lists of spent outputs. This can be done on disk instead of in memory.

from python-bitcoin-blockchain-parser.

skorokithakis avatar skorokithakis commented on August 30, 2024

How is this possible to do if you can't get the input addresses? I'm trying to do the same but I can't find the input address anywhere, only the output addresses.

from python-bitcoin-blockchain-parser.

agoora avatar agoora commented on August 30, 2024

How can i get list of all addresses and hash160, having positive balance ?

from python-bitcoin-blockchain-parser.

educob avatar educob commented on August 30, 2024

You have to go through every block and decode the scriptPubKey script to find the address behind it.
No easy task.

from python-bitcoin-blockchain-parser.

Related Issues (20)

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.