Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: citboin on September 08, 2013, 04:13:37 AM



Title: Checking balance of another address from daemon?
Post by: citboin on September 08, 2013, 04:13:37 AM
Hey all,

I am looking to check the balance of an address I don't own (e.g. 1HtUGfbDcMzTeHWx2Dbgnhc6kYnj1Hp24i) from the daemon, is this possible using an existing command? I have tried getreceivedbyaddress and listreceivedbyaddress but they do not seem to work.

Thanks for your help!


Title: Re: Checking balance of another address from daemon?
Post by: Stephen Gornick on September 08, 2013, 05:28:16 AM
I have tried getreceivedbyaddress and listreceivedbyaddress but they do not seem to work.

It can be done with the Raw Transactions API but not easily.  You'ld use listunspent to get a list of transactions and filter that for the address you are checking on.  [Update: See jgarzik's response below.]
 - http://en.bitcoin.it/wiki/Raw_Transactions

if you weren't needing bitcoind specifically for this then know that other clients including BitcoinJ, Armory, etc., provide access to this info in a different way.


Title: Re: Checking balance of another address from daemon?
Post by: jgarzik on September 08, 2013, 05:32:48 AM
It can be done with the Raw Transactions API but not easily.  You'ld use listunspent to get a list of transactions and filter that for the address you are checking on.
 - http://en.bitcoin.it/wiki/Raw_Transactions

That will not work for "an address I don't own" -- listunspent looks in the wallet.



Title: Re: Checking balance of another address from daemon?
Post by: jgarzik on September 08, 2013, 05:36:00 AM
Hey all,

I am looking to check the balance of an address I don't own (e.g. 1HtUGfbDcMzTeHWx2Dbgnhc6kYnj1Hp24i) from the daemon, is this possible using an existing command? I have tried getreceivedbyaddress and listreceivedbyaddress but they do not seem to work.

The easiest way currently is to visit http://blockchain.info/ or http://blockexplorer.com/

There are a couple features under development which will enable this facility in a decentralized fashion, for anyone using Bitcoin-Qt or bitcoind:

1) An optional address index is being added, for searches such as these

2) A pull request exists for "watch only address" support.  A watch-only address is an address in your bitcoin wallet for which you do not have the private key.  With this feature, bitcoind will dutifully watch for any transactions on the watched addresses, just like a normal bitcoin address you control.



Title: Re: Checking balance of another address from daemon?
Post by: tgerring on September 08, 2013, 06:07:46 AM
Hey all,

I am looking to check the balance of an address I don't own (e.g. 1HtUGfbDcMzTeHWx2Dbgnhc6kYnj1Hp24i) from the daemon, is this possible using an existing command? I have tried getreceivedbyaddress and listreceivedbyaddress but they do not seem to work.

Thanks for your help!

Would you be interested in a service that delivered such notifications to your application via Webhooks?


Title: Re: Checking balance of another address from daemon?
Post by: grau on September 08, 2013, 05:07:44 PM
Is a cake using BOP API. You might even register a listener for the address.


Title: Re: Checking balance of another address from daemon?
Post by: samson on February 03, 2014, 12:45:53 AM
Hey all,

I am looking to check the balance of an address I don't own (e.g. 1HtUGfbDcMzTeHWx2Dbgnhc6kYnj1Hp24i) from the daemon, is this possible using an existing command? I have tried getreceivedbyaddress and listreceivedbyaddress but they do not seem to work.

The easiest way currently is to visit http://blockchain.info/ or http://blockexplorer.com/

There are a couple features under development which will enable this facility in a decentralized fashion, for anyone using Bitcoin-Qt or bitcoind:

1) An optional address index is being added, for searches such as these

2) A pull request exists for "watch only address" support.  A watch-only address is an address in your bitcoin wallet for which you do not have the private key.  With this feature, bitcoind will dutifully watch for any transactions on the watched addresses, just like a normal bitcoin address you control.



Is this going to be available any time soon ?



Title: Re: Checking balance of another address from daemon?
Post by: maaku on February 03, 2014, 07:15:03 AM
There are a couple features under development which will enable this facility in a decentralized fashion, for anyone using Bitcoin-Qt or bitcoind:

1) An optional address index is being added, for searches such as these

2) A pull request exists for "watch only address" support.  A watch-only address is an address in your bitcoin wallet for which you do not have the private key.  With this feature, bitcoind will dutifully watch for any transactions on the watched addresses, just like a normal bitcoin address you control.

Is this going to be available any time soon ?

I can't speak to the "watch only addresses", but I'm one of the developers working on an address index. It's a nontrivial undertaking, but finally in the implementation phase. The draft BIP and Python prototype implementation are about a week away from finishing (just need to implement and document some last minute changes).. although it's been "a week away" for the past three weeks as I work on other, higher priority tasks. It might take a little bit of time to be finished. The C++ implementation is only about 50% complete, and that needs to get finished before we can even think about finalizing the spec and deployment.

To really make efficient and secure use of an index requires a soft-fork, and it is less clear when that might occur. Look at how long it took for P2SH to happen, and that was a considerably simpler change originating from the core developers (I'd still count myself as an outsider). In the mean time though it might be usable as a merged-mined side chain.