Author

Topic: get external addresses balance in bitcoind (Read 5947 times)

legendary
Activity: 3472
Merit: 4801
June 11, 2014, 07:26:01 AM
#5
The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.

Um...where can I input the address that i'm interested in?

I'm not sure what you're asking.

If you are asking how you can add an address to the bitcoin daemon, then you need to have the private key.  You can then issue the importprivkey command and the daemon will add the private key to its own list of private keys and calculate the bitcoin address.
newbie
Activity: 13
Merit: 0
The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.

Um...where can I input the address that i'm interested in?
legendary
Activity: 3472
Merit: 4801
The answer in this sub-forum is the same as it was in the other sub-forum where you asked the exact same question:

As far as I'm aware, you'd have to process the entire blockchain using commands such as getblockhash, getblock, and getrawtransaction to search for any and all unspent transaction outputs associated with the address you are interested in.  Then you'd have to add up all the unspent outputs to arrive at a total balance.

To avoid having to repeatedly scan the entire blockchain, you'd probably be better off scanning it once and building a database table with the complete UTXO set.  Then you'd want to use blocknotify to update your UTXO table everytime a new block is created.  That way you could just query your UTXO table to find address balances.
legendary
Activity: 1358
Merit: 1001
https://gliph.me/hUF
You mean an address that is not part of your wallet? That is not possible with bitcoind. That's why we have all those blockr.io, blockexplorer, blockchain.info etc. There's also some projects to parse the locally stored blockchain, I guess it could be achieved that way too.
newbie
Activity: 13
Merit: 0
Hi,
I just installed bitcoin daemon on my server. Now I only can get address balance from my wallet.
Is that possible to get external addresses balance in my bitcoin daemon (PHP)?

(I don't want to use something like blockchain api ...)
(getreceivedbylabel is not working for me  Huh)

Cheers,
J
Jump to: