The bug is with https://bitcoinchain.com
Before I report it I would like to see if I can gain any additional clues as to what might be going on in order to assist their developers to get to the root of the problem quickly.
If I call their API like so:
then add up all of the utxo.amounts they gave me for the wallet in question I get
But if you examine the wallet here https://blockchain.info/address/1KZnzTTfuxiyHUJdLqn3UnHyTVDN2UgeHU
you see that it really holds
With a little digging I see at least two of the utxos txid/hash(s) where they have incorrectly got the wrong output:
they have picked the wrong wallet address
they have picked the wrong wallet addess
Not every utxo has this mistake, so it could be ruled out that they are always picking the first output.
I would have thought that they should just be asking if the output address matches the queried address but if they were doing that then surely this bug would not exist!
What other factors could cause this?