I'm looking to scrape the blockchain to create a list of all wallets that have a balance greater than zero, and maybe add some extra info like last transaction in/out, and public keys if that’s possible. Seems like a pretty standard project. Kind of like those old bitcoin rich list websites where you could sort by different columns and had more options than what we have now.
I was hoping some of you could share how you’d tackle this or at least point me to some resources.
I’ve got a fully synced Bitcoin Core running with the RPC server set up.
Here’s what I’ve tried in Python so far, just to show I’m not coming here empty-handed.
Creating a list of non-zero wallets and their balances using Python
4 replies 344 views
Not wallets, but addresses.
I don't think RPC is the most efficient way of doing that. If the node is synched then you should try to manually read the files from disk and parse them instead.
You used >= in a couple of places like this which is wrong. The length of standard output scripts is fixed. Like P2PKH which is 25 bytes (50 hex). If the length is anything else then it is non-standard and there is no address equivalent for it and they may even be unspendable.
If I understood your code correctly, you are fetching each block then processing them creating a database. Your full node has already done that and created a database of UTXOs named chainstate. You have to check bitcoin core to see how this file is stored. As I said before, you should read this file and parse that if you want the current balance of each addresses instead of processing all blocks from #1 yourself fetching them from RPC one by one.
... or you can skip all that and get the same result you are looking for from here: https://bitcointalk.org/index.php?topic=5254914.0
If you need real-time update, how about running one of Electrum server implementation? All of them have address index. You just need to either access their database directly or communicate with it using Electrum protocol[1].
[1] https://electrumx-spesmilo.readthedocs.io/en/latest/protocol.html
Thank you that topic seems to be what I'm looking for. A bit disappointing I couldn't figure out how to do it myself though.
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#5Jul 6, 2026, 04:11 PM
I've seen several options to export the UTXO list, but never had to use them myself. Bitcoin-utxo-dump for instance (use at your own risk, do your own research).
?Reply
Sign in to reply to this topic
Related topics
- Restoring wallets from pre-fork days 7
- Using two different Bitcoin versions without messing up blockchain data 3
- Using Electrum to Transfer from BRD Wallet with HPS Address 8
- Best practices for securely storing newly generated wallets programmatically 14
- Ukraine plans to restrict crypto wallets for illegal funds, says finance minister 9
- What Should I Know About Multisig Wallets? 13