Bitcoin Forum
May 21, 2024, 01:50:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Check BTC balance programmatically on: January 31, 2024, 10:01:26 PM
Hi,

I've got a list (200 million+) of bitcoin and ethereum addresses I need to check the balance for.

For ethereum, I'm running a geth + prysm node and I can simply check the balance for a specific address by calling `provider.getBalance(address)`.

For bitcoin, I initially assumed that this was possible in the same way by using bitcoin-core, so I synced the blocks but then find out this is not possible (I can use `client.importAddress(address, '', false)` but then I will have to rescan the blocks and it doesn't seem a viable solution considering the amount of addresses I have to check).

I also looked into bitcoin-abe and it seems that it will import all blocks in a database so then I may be able to query the data to check the balance (I probably will have to calculate it by summing up all unspent transaction outputs associated with each address).

I was wondering if anyone knew a better way of doing this or had any suggestion.

Thanks!

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!