Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: flatfly on September 08, 2012, 09:14:21 AM



Title: Get balance of an address using bitcoind
Post by: flatfly on September 08, 2012, 09:14:21 AM
Is there some magic bitcoind RPC call to show the balance of *any* address (not especially one of yours)?


Title: Re: Get balance of an address using bitcoind
Post by: CIYAM on September 08, 2012, 10:33:14 AM
Not using the existing client, however, it may be worth checking into the details of the new RPC commands (certainly I think they at least let you access any tx).

If needing to get the balance in code you could always issue a "system" command that makes a "curl" call such as the following:

Code:
curl http://blockchain.info/q/addressbalance/1ciyam3htJit1feGa26p2wQ4aw6KFTejU

(note that the balance returned is in Satoshis)


Title: Re: Get balance of an address using bitcoind
Post by: dirtycat on September 29, 2012, 01:44:29 PM
Is there some magic bitcoind RPC call to show the balance of *any* address (not especially one of yours)?

this would be very useful to have in bitcoind!  along with showing tx info on any tx.

it would make it so we dont have to rely on sites like blockchain and blockexplorer to get that info

we already have that data locally why not utilize it.


Title: Re: Get balance of an address using bitcoind
Post by: Pieter Wuille on September 29, 2012, 03:05:21 PM
This requires an index (from addresses to all transactions that affect it) which isn't necessary for normal operation.

It's currently not implemented, but adding it wouldn't be that hard. It's not a priority, though.


Title: Re: Get balance of an address using bitcoind
Post by: CIYAM on September 29, 2012, 03:12:37 PM
This requires an index (from addresses to all transactions that affect it) which isn't necessary for normal operation.

It's currently not implemented, but adding it wouldn't be that hard. It's not a priority, though.

I think I would really like to use such a feature rather than relying on a 3rd party service such as blockchain.info (not that I don't trust them but basically because why should I waste the bandwidth when I already have the blockchain?).

I would be willing to put up 10 BTC towards this if that can motivate someone not already flat out to build this (payment would be made to the owner of the accepted pull request that achieves this).


Title: Re: Get balance of an address using bitcoind
Post by: flatfly on September 29, 2012, 03:24:06 PM
This requires an index (from addresses to all transactions that affect it) which isn't necessary for normal operation.

It's currently not implemented, but adding it wouldn't be that hard. It's not a priority, though.

I think I would really like to use such a feature rather than relying on a 3rd party service such as blockchain.info (not that I don't trust them but basically because why should I waste the bandwidth when I already have the blockchain?).

I would be willing to put up 10 BTC towards this if that can motivate someone not already flat out to build this (payment would be made to the owner of the accepted pull request that achieves this).


Would you be interested in a command-line tool that would be able to get this info from any Electrum server? This is something I feel I would be able to deliver rather quickly.

And if you install an Electrum server on your own bitcoind installation, it would make the whole solution local. After all, an Electrum server is just an add-on to bitcoind that makes it easy to query through the Stratum/JSON protocol.


Title: Re: Get balance of an address using bitcoind
Post by: CIYAM on September 29, 2012, 03:29:41 PM
Would you be interested in a command-line tool that would be able to get this info from any Electrum server? This is something I feel I would be able to deliver rather quickly.

And if you install an Electrum server on your own bitcoind installation, it would make the whole solution local. After all, an Electrum server is just an add-on to bitcoind that makes it easy to query through the Stratum/JSON protocol.

That might be something I could look into although I'm not sure that I'd want to run another server just for the one function (but maybe there are some other cool things it does that might convince me to give it a try?).