Bitcoin Forum

Bitcoin => Wallet software => Topic started by: mav on March 20, 2014, 10:00:48 AM



Title: totalReceived is inconsistent - help improve it
Post by: mav on March 20, 2014, 10:00:48 AM
I've been interfacing with a lot of third-party blockchain APIs lately, and have found an inconsistency regarding the 'total received' value.

It's easiest to give an example:

Here's a list for totalReceived for the address 173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

Blockchain.info: 462477517
https://blockchain.info/q/getreceivedbyaddress/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

BlockExplorer: 8.35757472
https://blockexplorer.com/q/getreceivedbyaddress/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

blockr.io: 4.62477517
https://blockr.io/address/info/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

live.bitcore.io: 8.35757472
http://live.bitcore.io/address/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

biteasy.com: 4.62477517
https://www.biteasy.com/blockchain/addresses/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ

Helloblock: 835757472
https://mainnet.helloblock.io/v1/addresses/173MjkFkm1iCYTkW7fBZj5EoPHb5JWhyYJ
Although this seems to have recently changed and is no longer reporting totalReceived

Another address with the same issue is 1RckWiDzbdNEfRuTG1zStNpCYRUWaLJkr (0.9795 vs 1.929), but there are many cases. Mycelium sends change back to the same address so pretty-much every Mycelium transaction will be subject to this issue.

The value reported depends whether amounts sent from the address to itself are counted as received amounts or not. Some services count it, some don't.

Neither approach is necessarily 'right' or 'wrong'. My personal opinion is that amounts sent from the address to itself should not be counted in totalReceived, and in this case 462477517 would be the better value.

It would be good to see some discussion around which option should be chosen, so that some kind of standard can be reached and we don't have two different values for what should be the same value. Maybe there's a need to be more explicit and have both values reported, although I have no idea what naming convention you'd use to differentiate them.

Please post suggestions about which direction you think is most appropriate to take on this issue. Once a clear and logical decision has been reached regarding which value is most appropriate, any blockchain data providers with the conflicting value can be contacted and asked to update. This way the value will hopefully end up consistent across all data sources.

Also if you know of other sources of blockchain data please post them and I will add it to this list.


Title: Re: totalReceived is inconsistent - help improve it
Post by: kjj on March 20, 2014, 04:26:37 PM
In my opinion, this topic belongs in Alternative Clients (https://bitcointalk.org/index.php?board=37.0), not here.


Title: Re: totalReceived is inconsistent - help improve it
Post by: mav on March 27, 2014, 11:08:29 PM
This is being discussed in bitpay/insight-api

https://github.com/bitpay/insight-api/issues/31 (https://github.com/bitpay/insight-api/issues/31)