I’m trying to figure out how to list all non-zero wallet addresses and their balances from the blockchain using Python. Would love to include extra info like last transactions if possible. Seems like a common project, similar to those old rich list websites. I’ve got my Bitcoin Core synced with RPC on, but hitting a wall here. Any ideas?
How to list non-zero wallet addresses and balances in Python?
4 replies 391 views
Addresses, not wallets. Just sayin'. And I really doubt using RPC is efficient for this. If your node is synced, why not just read the data directly from the disk? Also, be careful with your code. Using >= in some places can mess things up. Standard script lengths are fixed, like P2PKH is 25 bytes. Anything else might be non-standard or worse.
For real-time updates, have you looked into running an Electrum server? They have an address index, and you can either access the database or use Electrum’s protocol. Just a thought. Makes it easier, I think.
Wow, thanks! That’s what I needed. Kinda bummed I couldn’t crack it myself, though. Definitely gonna dig more into it.
I’ve seen tools for exporting UTXO lists, but never used them myself. There's bitcoin-utxo-dump, for example. Use it at your own risk, and do your research first.