Querying external balances

+1 vote

An important feature of what I’m trying to achieve is for a node to be able to query the balance of any wallet. As far as I understand, this is only possible by iterating through the blockchain using a combination of getblockhash, getblock, and getrawtransaction. I just wanted to confirm whether there are any shortcuts that might help?

asked Sep 17, 2015 by anonymous

1 Answer

0 votes
In general this is correct. For now if you want to know what's going on for addresses that are not specifically watched by the wallet, you need to parse the blockchain (and possibly the memory pool if you're concerned about unconfirmed transactions) in full. However there is the ability to add specific 'watch only' addresses to a node, which allow you to query what's going on with those addresses. For an example of doing this in Bitcoin Core, see:

http://bitcoin.stackexchange.com/a/36151

Alternatively you'll probably find that you can adapt an open source bitcoin blockchain explorer like Insight (https://github.com/bitpay/insight) or BlockCypher (https://github.com/blockcypher/explorer) to work with MultiChain, because MultiChain's API is backwards compatible with Bitcoin Core's. You'll have to manually handle the asset information by reading the various pieces of metadata involved, but it'll get you most of the way there.
answered Sep 17, 2015 by MultiChain
...