0

I am coding a website to get BTC balance from explorer using the following url:

https://blockexplorer.com/api/addr/3CyZgGhkhE3z2WY8E5ztPMRYCDdg1hdD7g/balance

The problem is that the balance appeared using this url (explorer) is totally different from what in my wallet (nicehash).

Explorer balance for this address: 0.00946525 BTC

Wallet balance for this address: 0.01642334 BTC

What is the cause of this? and how to show the real balance in explorer exactly as in wallet?

1

The 3CyZ... address has a balance of 0.00946525 BTC, so it appears that your nicehash wallets includes some other addresses as well.

In general, a bitcoin wallet will include a collection of addresses: the more you use the wallet the more addresses it will generate. Best practices include only using each receiving address once (if you search 'address reuse' you'll find the reasoning behind this), so every time you send or receive a transaction the number of addresses you wallet controls will increase.

So to get an accurate account of your wallet balance, you'll need to sum the balance of all of the addresses the wallet controls, not just the 3CyZ.. address.

| improve this answer | |
  • I know that Bitcoin wallet is a hierarchical deterministic wallet,but i want to know how to get the exact balance(as in wallet that holds multiple addresses) from explorer for using one address only . – Mohamed Amin May 1 '18 at 22:57
  • 1
    @MohamedAmin that is not possible, using one address will return the balance for that one address. A block explorer has no way of knowing which addresses are related by HD wallet derivation, as an HD-derived address is indistinguishable from any other address. – chytrik May 1 '18 at 23:53

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.