Bitcoin Forum
November 13, 2024, 10:12:23 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Checking balance of another address from daemon?  (Read 1223 times)
citboin (OP)
Newbie
*
Offline Offline

Activity: 58
Merit: 0


View Profile
September 08, 2013, 04:13:37 AM
 #1

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!
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
September 08, 2013, 05:28:16 AM
Last edit: September 10, 2013, 08:49:30 PM by Stephen Gornick
 #2

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.

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
September 08, 2013, 05:32:48 AM
 #3

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.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
September 08, 2013, 05:36:00 AM
 #4

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.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
September 08, 2013, 06:07:46 AM
 #5

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?

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1030


bits of proof


View Profile WWW
September 08, 2013, 05:07:44 PM
 #6

Is a cake using BOP API. You might even register a listener for the address.
samson
Legendary
*
Offline Offline

Activity: 2097
Merit: 1070


View Profile
February 03, 2014, 12:45:53 AM
 #7

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 ?

maaku
Legendary
*
expert
Offline Offline

Activity: 905
Merit: 1012


View Profile
February 03, 2014, 07:15:03 AM
 #8

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.

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
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!