Bitcoin Forum

Other => Beginners & Help => Topic started by: jabetizo on December 26, 2012, 06:03:06 PM



Title: check balance of address without trusting block explorer
Post by: jabetizo on December 26, 2012, 06:03:06 PM
How can one check the "balance" of an address without using a block explorer site - for example to verify if a paper wallet was funded successfully?


Title: Re: check balance of address without trusting block explorer
Post by: Stephen Gornick on December 26, 2012, 07:34:31 PM
How can one check the "balance" of an address without using a block explorer site - for example to verify if a paper wallet was funded successfully?

If the address (and private key) are in the wallet, there are RPC calls to provide this info.  For a paper wallet, you wouldn't have the address (and private key) in your wallet, so those calls won't help you in that instance.

The Bitcoin-Qt client (v0.7 and above) provides Raw Transactions (getrawtransaction, decoderawtransaction) that will give you this information but you need to know the transaction hash.
 - http://en.bitcoin.it/wiki/Raw_Transactions

You can build a database with all the transactions by processing the transactions from the blocks of the longest chain  (getblockhash and getblock) plus the valid but unconfirmed transactions in the memory pool (listsinceblock), but that is not a trivial task. [Edit: There is also the monitortx patch that will help with this.]

There are other tools that can help as well.  Armory provides easy access to blockchain data, see the "Extras" folder.   Also libBitcoin might provide this to you as might ABE blockchain explorer source.    Or now there is libccoin even that might be useful:
 - http://bitcointalk.org/index.php?topic=128055.0

If you are willing to use the Block Explorer to obtain the transaction hashes but then use your local bitcoind to obtain the amounts that might be a hybrid solution that works for you -- depending on the reasons you didn't want to use a hosted blockchain service.

There are other services providing this information as well:
 - http://btcbalance.net
 - http://bitcoinmonitor.net
 - http://blockchain.info/address-balance-sheet