Bitcoin Forum
May 06, 2024, 10:49:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Checking Bitcoin Address Balance Without download entire blockchain  (Read 667 times)
Bitcoin_BOy$ (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 503


|| Web developer ||


View Profile
October 28, 2017, 07:12:09 PM
 #1

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
1714992548
Hero Member
*
Offline Offline

Posts: 1714992548

View Profile Personal Message (Offline)

Ignore
1714992548
Reply with quote  #2

1714992548
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714992548
Hero Member
*
Offline Offline

Posts: 1714992548

View Profile Personal Message (Offline)

Ignore
1714992548
Reply with quote  #2

1714992548
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 28, 2017, 09:46:09 PM
 #2

Are you asking for someone to do this for you or are you asking how you should go about doing this?

pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
October 28, 2017, 09:52:47 PM
 #3

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...
Bitcoin_BOy$ (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 503


|| Web developer ||


View Profile
October 28, 2017, 10:53:35 PM
 #4

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.
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
October 29, 2017, 06:08:24 AM
Merited by ABCbits (1)
 #5

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.

Quickseller
Copper Member
Legendary
*
Offline Offline

Activity: 2870
Merit: 2298


View Profile
October 29, 2017, 07:01:46 AM
Merited by ABCbits (1)
 #6

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.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
October 29, 2017, 10:19:29 AM
 #7

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

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Bitcoin_BOy$ (OP)
Hero Member
*****
Offline Offline

Activity: 854
Merit: 503


|| Web developer ||


View Profile
October 29, 2017, 04:43:21 PM
 #8

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!