Bitcoin Forum
November 14, 2018, 11:08:52 PM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Checking Bitcoin Address Balance Without download entire blockchain  (Read 554 times)
Bitcoin_BOy$
Hero Member
*****
Offline Offline

Activity: 756
Merit: 500

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

Posts: 1542236932

View Profile Personal Message (Offline)

Ignore
1542236932
Reply with quote  #2

1542236932
Report to moderator
1542236932
Hero Member
*
Offline Offline

Posts: 1542236932

View Profile Personal Message (Offline)

Ignore
1542236932
Reply with quote  #2

1542236932
Report to moderator
1542236932
Hero Member
*
Offline Offline

Posts: 1542236932

View Profile Personal Message (Offline)

Ignore
1542236932
Reply with quote  #2

1542236932
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1582
Merit: 1739


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


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
Full Member
***
Offline Offline

Activity: 256
Merit: 239


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

Activity: 756
Merit: 500

|| 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: 1078
Merit: 1000



View Profile WWW
October 29, 2017, 06:08:24 AM
 #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: 1596
Merit: 1202

in 2 min-groin injury, dildo on field, & 6-9 score


View Profile WWW
October 29, 2017, 07:01:46 AM
 #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.

3PjXm2XYDKLV5mN3oiKzNTyVvSkqP3ujeq <-- tipping address Advertise here
HCP
Hero Member
*****
Offline Offline

Activity: 784
Merit: 951

<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

Bitcoin_BOy$
Hero Member
*****
Offline Offline

Activity: 756
Merit: 500

|| 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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!