Author

Topic: Checking Bitcoin Address Balance Without download entire blockchain (Read 697 times)

hero member
Activity: 854
Merit: 503
|| Web developer ||
You will have difficult downloading new blocks without initially downloading/validating the blockchain because you will not know if a received block is valid or not.

You will want to create a DB with the UTXO set that will update with each block received. You can query the DB when you want to check the balance of an address.
Thank you everyone, All replies are helpful. I do understand the problem will be validating the blockchain. So maybe the solution will be to contact an API provider to increase the
rate limit.

Thanks for your replies
HCP
legendary
Activity: 2086
Merit: 4363
The only way to scan the Blockchain to check if addresses have been used in transactions and/or have a current balance is to have a copy of the Blockchain or use an API like blockcypher (the API service provider is then effectively maintaining and indexing the Blockchain for you)

Unless you mean, you've don't care about old blocks as the new addresses should not have been used, so old blocks don't matter. In that case,  maybe you could use an SPV wallet like Electrum and use CLI options (only available on Linux and Mac I believe, CLI doesn't work on windows) to check addresses... The Electrum servers would do the heavy lifting.

As a side note, I believe you can "buy" different levels of service with most API providers if you want to avoid rate limits
copper member
Activity: 2996
Merit: 2374
You will have difficult downloading new blocks without initially downloading/validating the blockchain because you will not know if a received block is valid or not.

You will want to create a DB with the UTXO set that will update with each block received. You can query the DB when you want to check the balance of an address.
legendary
Activity: 1442
Merit: 1186
Are you asking for someone to do this for you or are you asking how you should go about doing this?
The question is: Check recently created bitcoin addresses balance without downloading old blocks.


Do you mean without having to reindex? Unless you want to roll your own way of keeping track of transactions using a 3rd party websocket stream and a db or something, I think one solution is to run a pruned node and just generate addresses on the fly with the JSON RPC. You'll still have that one-time IBD, but the old blocks will be purged as it catches up. As long as these are new addresses you are generating with bitcoind it won't have to reindex since theoretically new addresses shouldn't have any prior transactions. Then you can use walletnotify to keep a running balance for each address on a db so you don't have to query bitcoind every time.
hero member
Activity: 854
Merit: 503
|| Web developer ||
Are you asking for someone to do this for you or are you asking how you should go about doing this?
I'm asking if there's some work already made, or an advice on what I should do.

The question is: Check recently created bitcoin addresses balance without downloading old blocks.

@pebwindkraft thanks, but as you described api have rate limits and that's exactly what I want to avoid.
sr. member
Activity: 257
Merit: 343
You can use block explorers. And in unix like systems you can go with kind of a shell script:

wget -q -O - https://blockchain.info/de/q/addressbalance/$bitcoin_address_1
wget -q -O - https://blockchain.info/de/q/addressbalance/$bitcoin_address_2
wget -q -O - https://blockchain.info/de/q/addressbalance/$bitcoin_address_3
...
wget -q -O - https://blockchain.info/de/q/addressbalance/$bitcoin_address_n

this avoids to download a blockchain.
I think these block explorers have a limit, so you may need to pause between the addresses...
staff
Activity: 3458
Merit: 6793
Just writing some code
Are you asking for someone to do this for you or are you asking how you should go about doing this?
hero member
Activity: 854
Merit: 503
|| Web developer ||
First of all, I want to check balance of some address that I created recently, So that mean they're not in old blocks,
My local server do not have enough storage for the entire blockchain (60 GB). Which I won't use it all.
So my question is: Create a tool that check bitcoin address balance by looking into new blocks that are downloaded automatically and escape old blocks
Jump to: