Bitcoin Forum
April 25, 2024, 12:35:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: Android wallet balance viewer  (Read 8139 times)
willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 24, 2011, 02:59:06 PM
Last edit: July 10, 2011, 10:06:10 PM by willphase
 #1

Hi,

I've written an android application that allows you to view your wallet balance on your android phone, without having to have a complete wallet stored on it.

It works by exporting your public keys from your bitcoin wallet using a command line tool.  You then place your public addresses in a repository, or on the SD card, then run the application on your android phone - import your public keys, and then goes to blockexplorer and adds up all the transactions to/from those addresses and presents you the result.  No need to wait ages to download blocks, get your wallet balance on any Android phone in seconds!



All the source is provided so you can check I'm not doing anything bad.  I also provide Windows/Linux binaries of the decoder tool.

The source and binaries are:

http://code.google.com/p/bitcoinwallet/

Let me know if you find it useful, or any issues you have - I haven't tested it with large wallets so I'd be interested to hear if people have issues with that.  Please read the FAQ for answers to most questions.

Backup your wallet before using this tool.  I do not accept any liability for wallet corruption caused by this app!!!

Cheers,

Will

1714048557
Hero Member
*
Offline Offline

Posts: 1714048557

View Profile Personal Message (Offline)

Ignore
1714048557
Reply with quote  #2

1714048557
Report to moderator
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714048557
Hero Member
*
Offline Offline

Posts: 1714048557

View Profile Personal Message (Offline)

Ignore
1714048557
Reply with quote  #2

1714048557
Report to moderator
1714048557
Hero Member
*
Offline Offline

Posts: 1714048557

View Profile Personal Message (Offline)

Ignore
1714048557
Reply with quote  #2

1714048557
Report to moderator
1714048557
Hero Member
*
Offline Offline

Posts: 1714048557

View Profile Personal Message (Offline)

Ignore
1714048557
Reply with quote  #2

1714048557
Report to moderator
giszmo
Legendary
*
Offline Offline

Activity: 1862
Merit: 1105


WalletScrutiny.com


View Profile WWW
June 24, 2011, 03:17:21 PM
 #2

I don't see your app particularly useful but I'm interested in the reactions of others as I also thought about doing an app that would require the keys. Actually mine would need some private keys but not necessarily with a balance on them. Guess the crucial part is that the key extraction is open source.

In your case if the extraction is open source and if users compile it from that source, things can be pretty save but expecting many will take the hassle to compile for them self is illusionary.

anyway, i'll stay tuned Wink

ɃɃWalletScrutiny.comIs your wallet secure?(Methodology)
WalletScrutiny checks if wallet builds are reproducible, a precondition for code audits to be of value.
ɃɃ
willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 24, 2011, 03:42:08 PM
 #3

I don't see your app particularly useful but I'm interested in the reactions of others as I also thought about doing an app that would require the keys. Actually mine would need some private keys but not necessarily with a balance on them. Guess the crucial part is that the key extraction is open source.

In your case if the extraction is open source and if users compile it from that source, things can be pretty save but expecting many will take the hassle to compile for them self is illusionary.

anyway, i'll stay tuned Wink

Well I personally have found it pretty useful - I can login from my pool/exchange on my phone and withdraw bitcoins, then wait a few minutes and check my wallet balance, all from my android phone...

yes the key extraction was a pain, once the official bitcoin client support key export then it'll all become a lot easier.  I debated which language to write the extraction utility in, and whether to have lots of dependencies on other libraries (e.g. berkeley database)- but in the end made the decision to make the decoder pretty much standalone so it could compile on as many systems as possible without needing to download tons of libraries and get them installed.

I have code to extract private keys too, and I've imported them into a fully blown bitcoin wallet (like bitcoinj) pretty easily, but until the reference bitcoin implementation supports this as standard, anything like this will remain a pain.  I also didn't want to put bitcoinj in an android app since it's still quite heavyweight at the moment.

Thanks for the interest.

Will

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 26, 2011, 11:11:31 PM
 #4

released v1.0.4 - this fixes some null pointer issues and also makes the progress bar more reliable in low bandwidth scenarios (e.g. when on GPRS)

Let me know if you have any issues e.g. giving wrong balance.  The problem is likely with the way the addresses are exported from the wallet.dat - really need the key export feature to be added to bitcoin!

Also added a FAQ page to answer any questions.

Will

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 27, 2011, 10:26:26 PM
 #5

UPDATES

v1.0.5 of wallet

 * Change default so it loads transactions of 50 keys at a time from blockexplorer (rather than 10).  This should speed up the balance checking.
 * Fix some issues of loading corrupt history

v1.0.1 of decoder

 * Now extracts ALL public keys and not just some of them.  I was trying to be too smart before and only picking some to export (to make the downloads for the wallet smaller) but you do need to export them all since you don't know which ones have been used for change transactions.

Let me know if you find the tool useful.  I'm using it as my main wallet now and store my wallet.dat on encrypted media unless I need to make a payment  - it functions pretty well as a simple read-only balance checker to make sure my pool is paying me reliably.

Will

SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 27, 2011, 10:43:16 PM
 #6

I suppose I would be nervous giving an application access to my wallet file...

I'd also need an android-based phone to use this.  Tongue
willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 27, 2011, 10:54:52 PM
 #7

I suppose I would be nervous giving an application access to my wallet file...

this is why it only exports the public keys - and the tool to export the keys is separate from the android application.  You can run the export tool on a machine with no internet if you worry about it sending keys or data anywhere - or just view the source here or compile it yourself.  Once you have the addresses then you can view your balance (and it will update automatically) from your android phone, with no risk of anyone stealing them and making payments (because you need the private keys, which you can leave secure in your wallet.dat on a usb stick).  I could even argue it's actually more secure using this tool to view your balance, because there's no way anyone could steal your bitcoins from just your public addresses...

I'd also need an android-based phone to use this.  Tongue

Yes, although I'm hoping to get my hands on an iPhone soon then I'll port it to that - the code to actually parse the transactions from blockexplorer should port pretty easily to Objective C.

Will

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 03, 2011, 08:40:48 PM
 #8

Major update to the App!

New features include:

 - Multiple wallet support!
 - Ability to import from the SD card, as well as from a URL
 - Better handling of large address lists, the app now only has to check blockexplorer for transactions that contain your addresses (you can manually override this behavior).
 
I also compiled the decoder for linux x86, you can find it on the downloads page, along with the existing win32 binary.  Unfortunately, until the ability to export addresses is added to the main bitcoin client, you still have to extract the keys using the decoder.

Since this is a major new release, I've placed the app on the Android Market - you can find it here.

Let me know what you think!

Will

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
July 06, 2011, 11:53:03 AM
 #9

I know it's dumb, but I made my wallet keep 1000 addresses in stead of the normal 100, and your decode tool only displays the first 300 or so.  Any way you could make it show up to 1100..Huh

tymothy
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
July 06, 2011, 12:07:13 PM
 #10

Any chance you could pull Mt Gox data and display bitcoin net worth in bitcoins and USD as a widget?
cloon
Sr. Member
****
Offline Offline

Activity: 387
Merit: 250


View Profile
July 06, 2011, 12:11:22 PM
 #11

Great Idea!  We need more people like you!

donations to 13zWUMSHA7AzGjqWmJNhJLYZxHmjNPKduY
willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 07, 2011, 09:03:49 PM
 #12

I know it's dumb, but I made my wallet keep 1000 addresses in stead of the normal 100, and your decode tool only displays the first 300 or so.  Any way you could make it show up to 1100..Huh

this is strange, it should be exporting them all.  When you import the 300 keys into the android wallet, does it display your balance correctly?

Will

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
July 09, 2011, 08:55:49 AM
 #13

I know it's dumb, but I made my wallet keep 1000 addresses in stead of the normal 100, and your decode tool only displays the first 300 or so.  Any way you could make it show up to 1100..Huh

this is strange, it should be exporting them all.  When you import the 300 keys into the android wallet, does it display your balance correctly?

Will

It might just be that I suck with the command prompt and know jack shit about using it.  When I ran the program from cmd.exe and right clicked to "select all" and copy, it only gave me 298, and it also only let me scroll up 298.  But if your program truly does catch all of them, then I just need to know how to tell it to print it's output into a text file.  Is there a way to do that?  I tried the >> /s [file] following it and that didn't work, and that's about the extent of my knowledge of command prompt.

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 09, 2011, 11:48:08 AM
 #14

It might just be that I suck with the command prompt and know jack shit about using it.  When I ran the program from cmd.exe and right clicked to "select all" and copy, it only gave me 298, and it also only let me scroll up 298.  But if your program truly does catch all of them, then I just need to know how to tell it to print it's output into a text file.  Is there a way to do that?  I tried the >> /s [file] following it and that didn't work, and that's about the extent of my knowledge of command prompt.

run:

./decode > keys.txt

then copy the keys.txt file to your sdcard on your phone, and you should be able to import them.

Will

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
July 09, 2011, 09:21:08 PM
 #15

It might just be that I suck with the command prompt and know jack shit about using it.  When I ran the program from cmd.exe and right clicked to "select all" and copy, it only gave me 298, and it also only let me scroll up 298.  But if your program truly does catch all of them, then I just need to know how to tell it to print it's output into a text file.  Is there a way to do that?  I tried the >> /s [file] following it and that didn't work, and that's about the extent of my knowledge of command prompt.

run:

./decode > keys.txt

then copy the keys.txt file to your sdcard on your phone, and you should be able to import them.

Will

That worked brilliantly!  Thank you so very much!!!  (And sorry for bothering you with such a stupid problem!)

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 10, 2011, 10:12:59 AM
Last edit: July 10, 2011, 10:28:26 AM by willphase
 #16

That worked brilliantly!  Thank you so very much!!!  (And sorry for bothering you with such a stupid problem!)

No problem!  I've updated the FAQ to reflect this issue.

I'm hoping to have some time to work on the app today, I'll try and add some features people have been requesting.  Now that there are two separate android bitcoin clients that are able to create and manage their own wallets, I'm going to concentrate on adding value to being able to monitor the transactions/status of you main wallet so you keep it offline unless you absolutely need to send bitcoins using your private keys - e.g. for managing a savings account where you don't want to expose your private keys.

Will

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 10, 2011, 09:59:28 PM
 #17

I've just pushed version 1.2.0 to the Android Market.  It now allows you to view transaction history for each of your wallets.  Let me know if you have any feedback!

Will

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
July 11, 2011, 02:21:29 AM
 #18

This has nothing to do with your program, but I was having trouble importing my keys, and it turned out, out of the 1100 addresses, 6 or 7 were not actually valid addresses.  I'm slightly worried they will be used by my client in the future!  Anyway, thanks for the help and the awesome program!

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 13, 2011, 08:07:45 PM
 #19

Thanks to whomever sent (the one and only!) crash report I've seen so far for the app... If you could PM me that would be cool because I'd like to try and work out why the transactions it's looking for don't exist - do you have generation transactions in your wallet?

Will

willphase (OP)
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
July 16, 2011, 08:50:07 AM
 #20

Just a brief update - I'm hoping to have some time soon (probably next weekend) to add some enhancements to the app- in the meantime please add any suggestions to the issues list here and I'll try and implement as many of them as I can.  The next things I'll probably be adding are live exchange data (display your balance in e.g. USD or EUR), finishing off the widget for your homescreen, and a graph of your wallet balance over time, unless people want other features.

Will

Pages: [1] 2 3 »  All
  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!