Bitcoin Forum
May 08, 2024, 01:41:54 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Getting Address Balance On BlockExplorer/BlockChain  (Read 2533 times)
jimbobway (OP)
Legendary
*
Offline Offline

Activity: 1304
Merit: 1014



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?
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715132514
Hero Member
*
Offline Offline

Posts: 1715132514

View Profile Personal Message (Offline)

Ignore
1715132514
Reply with quote  #2

1715132514
Report to moderator
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


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.

I do Bitcoin stuff.
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1330



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
Merit: 500


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!