Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: glitch003 on September 06, 2012, 09:39:37 PM



Title: Best way to check the balance of an address without the private key
Post by: glitch003 on September 06, 2012, 09:39:37 PM
So I want to do bitcoin transactions on my server and I installed bitcoind on it only to discover that it requires the private key of an address to get the balance.  I need to get the balance for a bitcoin account but I'm not putting my private keys on my server for security reasons.

So what's the best way to get the balance of an address without the private key?  I want to avoid using external services like blockchain.info because they could go down or go out of business or even worse get compromised and then people could get everything on my site for free.

Should I run an electrum server?  What's my best option here?  Literally the only functionality I need is checking the balance of an account.  I'm generating the pub/priv keys offline en masse using vanitygen and then importing the public keys into the server database. 

Thanks everyone!


Title: Re: Best way to check the balance of an address without the private key
Post by: ChipGeek on September 06, 2012, 09:43:26 PM
You can put the PUBLIC key in a wallet (at least on blockchain.info wallet) and it will show you the balance for that address.


Title: Re: Best way to check the balance of an address without the private key
Post by: DeathAndTaxes on September 06, 2012, 09:49:00 PM
One option:

Use an offline computer.
Expand the keypool to a large enough number to ensure you won't need to make a new backup in the near future.
Make a copy of your wallet.dat.
On the COPY: change the encryption password to a 256 bit random number.  Don't record the password anywhere.

Put this copy with unknown passphrase on the server and you essentially have full bitcoind access except for functions which require the wallet to be unlocked.  Technically the private key is in the wallet but since it can't be unlocked that copy of the private key is lost forever.




Title: Re: Best way to check the balance of an address without the private key
Post by: cypherdoc on September 06, 2012, 09:57:55 PM
Armory


Title: Re: Best way to check the balance of an address without the private key
Post by: Boussac on September 06, 2012, 10:03:05 PM
scanbook app on iPhone (in AppStore)


Title: Re: Best way to check the balance of an address without the private key
Post by: bg002h on September 07, 2012, 02:22:19 PM
i wrote an an iphone app to keep track of my offline addresses...see the link in my signature...


Title: Re: Best way to check the balance of an address without the private key
Post by: fivemileshigh on September 07, 2012, 05:45:53 PM
scanbook app on iPhone (in AppStore)

Excellent app!



Title: Re: Best way to check the balance of an address without the private key
Post by: etotheipi on September 07, 2012, 06:47:55 PM
I made Armory for doing exactly this.  Create the full wallet offline, create a watching-only copy to put online (main computer and/or webserver).  The watching-only wallet only has public keys.  And it can generate an infinite number of new public keys, for which the offline computer has the private keys.  And using the interface, you can manually execute transactions using a USB key to take a transaction to the offline computer for signing.  It takes about 60 seconds to move the coins.

There's more information about using Armory via python scripts in this thread (https://bitcointalk.org/index.php?topic=92496.0).
And more information about offline wallets on the website. (http://bitcoinarmory.com/index.php/using-offline-wallets-in-armory)

There's lot of other great benefits, such as being able to print off a backup once that protects your wallets forever (no matter how many addresses you generate).  Please PM if you have questions.  This use-case was my inspiration for making Armory.


Title: Re: Best way to check the balance of an address without the private key
Post by: sunnankar on January 02, 2013, 02:37:35 AM
Since Blockchain.info does not have a sitemap; does anyone have the URL for where you can check multiple address balances?


Title: Re: Best way to check the balance of an address without the private key
Post by: payb.tc on January 02, 2013, 02:57:03 AM
Since Blockchain.info does not have a sitemap; does anyone have the URL for where you can check multiple address balances?

it spits out quite a bit of info that you probably don't need, but here's the URL:

Code:
http://blockchain.info/multiaddr?active=$address|$address (Multiple addresses divided by |)

( source: http://blockchain.info/api/blockchain_api )


Title: Re: Best way to check the balance of an address without the private key
Post by: sunnankar on January 02, 2013, 03:37:28 AM
it spits out quite a bit of info that you probably don't need, but here's the URL:

Code:
http://blockchain.info/multiaddr?active=$address|$address (Multiple addresses divided by |)

( source: http://blockchain.info/api/blockchain_api )

That does spit out the info needed. However, there is a particular URL on Blockchain.info, which I forgot, that is much prettier and displays the current balances of all the wallet addresses. Basically, it lets you check a bunch of addresses via URL and sums them all, etc.

I have people I am introducing to Bitcoin and this would be a good way for them to be OCD about their balances without having to login all the time and thus increase their security if traveling and not using trusted computers.


Title: Re: Best way to check the balance of an address without the private key
Post by: BkkCoins on January 03, 2013, 10:31:23 AM
I wrote a small python script called coinwatch which checks each block as it happens against a database of addresses and updates account balances with any amount received. It allows you to set a confirmation count for low and high value payments.

But it uses blockchain.info block-height / getblockcount calls. I wanted it to be lightweight and not have to run bitcoind. The worst that happens if blockchain goes down is that receipts are delayed. It could be easily modified to use a backup like blockexplorer except I don't think blockexplorer has a block-height call.

Or I could look at modifying it to use an alternate block source. I did look at using bitcoind but it doesn't seem to offer a getblock api with json output. It will give a list of transaction ids but then you can't check those because it only seems to provide transaction details for it's own accounts.

Anyway, coinwatch is in my "misc" repo in my sig. It runs as a super lightweight daemon on a server. If anyone can suggest another source for new block data I'd be happy to update it so it doesn't depend only on blockchain.info.

The advantage to checking each block as it occurs is that you can have a huge number of addresses in the database, and the overhead doesn't change (much) as the number increases.


Title: Re: Best way to check the balance of an address without the private key
Post by: TheButterZone on January 03, 2013, 07:59:14 PM
Put http://bitcoinbox.ru/display/graph.php?btcaddress=1TBZYXjrGjXCEN1SprpF66Jzy5uN3GiLS&type=balance in an image tag.


Title: Re: Best way to check the balance of an address without the private key
Post by: Seal on February 20, 2013, 08:00:59 PM
it spits out quite a bit of info that you probably don't need, but here's the URL:

Code:
http://blockchain.info/multiaddr?active=$address|$address (Multiple addresses divided by |)

( source: http://blockchain.info/api/blockchain_api )

That does spit out the info needed. However, there is a particular URL on Blockchain.info, which I forgot, that is much prettier and displays the current balances of all the wallet addresses. Basically, it lets you check a bunch of addresses via URL and sums them all, etc.

I have people I am introducing to Bitcoin and this would be a good way for them to be OCD about their balances without having to login all the time and thus increase their security if traveling and not using trusted computers.

https://blockchain.info/q

From the site:

addressbalance/Address - Get the balance of an address (in satoshi) Do not use to process payments without the confirmations parameter

I believe you should be able to divide multiple addresses by |

Give it a go and let me know


Title: Re: Best way to check the balance of an address without the private key
Post by: bowen151 on February 20, 2013, 08:59:40 PM
Armory



Title: Re: Best way to check the balance of an address without the private key
Post by: juancho on December 23, 2013, 03:28:53 PM
I've made the coolest app at the moment to check your balances:

www.wonderwallets.com.ar


With only your public keys, of course.


Title: Re: Best way to check the balance of an address without the private key
Post by: BookLover on December 23, 2013, 04:26:42 PM
8)