Bitcoin Forum
July 25, 2017, 06:50:59 AM *
News: BIP91 seems stable: there's probably only slightly increased risk of confirmations disappearing. You should still prepare for Aug 1.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Getting Address Balance On BlockExplorer/BlockChain  (Read 2381 times)
jimbobway
Legendary
*
Offline Offline

Activity: 1397



View Profile
March 18, 2012, 03:19:57 AM
 #1

I want to get the balance of a bitcoin address but the description of the web call on blockexplorer says this:

Quote
addressbalance - shows received BTC minus sent BTC for an address. Do not use this unless you know what you are doing: it does not do what you might expect.

This is the same as subtracting /q/getsentbyaddress from /q/getreceivedbyaddress.
Using this data is almost always a very bad idea, as the amount of BTC sent
by an address is usually very different from the amount of BTC sent by the
person owning the address.
/q/addressbalance/address

Why does it say that it is a bad idea?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1050


View Profile WWW
March 18, 2012, 03:23:40 AM
 #2

Because addresses do not correspond exactly to wallets: if you do not know how change addresses work, these numbers will give you a wrong impression.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
dooglus
Legendary
*
Offline Offline

Activity: 2226



View Profile
March 18, 2012, 04:53:47 PM
 #3

Why does it say that it is a bad idea?

If you send 10 BTC to a new address that I generate, then I send 1 BTC back to you, block explorer will show a balance of 0 BTC on my address, not 9 BTC like you might expect.

The other 9 BTC will have been sent as 'change' to a new address in my wallet.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
bitlotto
Hero Member
*****
Offline Offline

Activity: 672


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
March 23, 2012, 08:57:19 PM
 #4

What exactly do you need to do? Just know how much BTC was sent to it? q/getreceivedbyaddress works great.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!