7

I am building an application and that will involve large set of bitcoin wallets and need to keep on checking for balance. I don't want to use any third party APIs as they all have hourly/secondly limits.

Is there any way I can check bitcoin wallets balance without any API? I am not sure is Bitcoin Demon and Bitcoin Core is for this purpose. Can anyone please suggest me the best way to verify bitcoin balances and transactions without any limits.

7

If you are not going to use a 3rd party API, you'll need to run a node and add each address you want to query as a watch only address. If you are looking to create a database with all addresses, similar to a block explorer website, you'll need to parse the blockchain using something like abe, and then continually update your database for each new transaction. There's also the painful approach of turning on txindex=1 in your bitcoin.conf, and then going through every single block since genesis, that checks all txs outputs and then keeps a record of all addresses and transactions.

2

This actually might be harder than it seems.

The blockchain does not store addresses and their corresponding balances. The blockchain stores transactions. So if someone were to look for the final balance of an address, he/she would have to iterate through every transaction(inputs/outputs) that a particular address was involved in starting from the beggining of the blockchain and calculate the final balance for that address.

1

You could craft the query as an HTML POST or GET message sent to a blockchain-explorer's website and parse the output received.

  • 1
    Doesn't it again calling a third-party website blockchain.info?? – lock Feb 29 '16 at 4:56
  • It would be calling a third party website but avoid using APIs – cbinrva Mar 2 '16 at 16:50
  • 1
    yes, like this: blockchain.info/address/… – Gianluca Ghettini Aug 8 '16 at 15:53
1

As suggested you can run your own node , and run a service like abe to index transactions. You could also run copay wallet along with the node. Though this is not recommended as it would take lot of time and would consume lot of resources(150 GB HDD/ 4 GB RAM).

You could also try blockonomics - wallet watcher . They are optimized for checking balance of large number of addresses at once. The free plan is restricted to 50 address, you can easily upgrade to upto 1000 addresses. Their API can be used to add/delete addressees.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.