Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: LoweryCBS on July 24, 2012, 05:34:59 PM



Title: Is there a simple app to scan a QR and return a balance?
Post by: LoweryCBS on July 24, 2012, 05:34:59 PM
Napkin-backing some point-of-sale ideas, and wondering if there's a simple Android app that will scan a QR of the address and return the balance?



Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: casascius on July 24, 2012, 05:42:54 PM
No, but such a thing should be simple to create and somebody should create it.  It could be created for iPhone without being a "bitcoin app", and would merely do the following:

1. scan QR code
2. extract bitcoin address out of it, removing any other URL components
3. direct the web browser to http://blockchain.info/address/ADDRESSGOESHERE

Any open-source QR code scanner could be modified to do such a thing and it would work great.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: Stephen Gornick on July 24, 2012, 05:49:29 PM
Napkin-backing some point-of-sale ideas, and wondering if there's a simple Android app that will scan a QR of the address and return the balance?

I asked essentially the same question and nobody had a solution so it probably doesn't yet exist.  But there is definitely a need for it.
 - http://bitcoin.stackexchange.com/q/4107/153


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: tbcoin on July 24, 2012, 09:36:40 PM
Vote:
http://blockchain.uservoice.com/forums/152743-general-ideas/suggestions/3024674-function-to-scan-the-qr-of-the-address-and-return-


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: unclemantis on July 24, 2012, 11:42:37 PM
I have a bookmark in my blackberry that points to my cold storage address and gives me my balance in Satoshi. Yes. I am geeky like that and besides it makes me look like i have a 100 million more than I really do!


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: bg002h on July 25, 2012, 01:00:26 AM
I have my addresses in an iOS app I wrote...it's simple, but it works for me. More info in my signature.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 05:55:38 AM
As per LoweryCBS and casascius requirements,

Here is a simple Bitcoin Balance checker which simply does as follows:
1. Scan QR Code - Must be of form bitcoin:<address> or <address>
2. Forward to http://blockexplorer.com/address/<address>

Google Play
https://play.google.com/store/apps/details?id=com.londontrustmedia.bitcoinbalance
 (https://play.google.com/store/apps/details?id=com.londontrustmedia.bitcoinbalance)

It was built using Titanium Appcelerator for quickness and ease, and the snippet of code is available via GIST(github) at:
https://gist.github.com/3174001

You can also use this on iOS by building it yourself.  Please enjoy.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: davout on July 25, 2012, 06:38:06 AM
It also exists for iOS and it's free to download on the appstore.

See : http://itunes.apple.com/en/app/scanbook-bitcoin-address-utility/id536215208?mt=8&ign-mpt=uo%3D2


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 06:39:35 AM
It also exists for iOS and it's free to download on the appstore.

See : http://itunes.apple.com/en/app/scanbook-bitcoin-address-utility/id536215208?mt=8&ign-mpt=uo%3D2

That's very cool!  ;D


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: LoweryCBS on July 25, 2012, 11:45:14 AM
As per LoweryCBS and casascius requirements,

Here is a simple Bitcoin Balance checker which simply does as follows:
1. Scan QR Code - Must be of form bitcoin:<address> or <address>
2. Forward to http://blockexplorer.com/address/<address>

Google Play
https://play.google.com/store/apps/details?id=com.londontrustmedia.bitcoinbalance
 (https://play.google.com/store/apps/details?id=com.londontrustmedia.bitcoinbalance)

It was built using Titanium Appcelerator for quickness and ease, and the snippet of code is available via GIST(github) at:
https://gist.github.com/3174001

You can also use this on iOS by building it yourself.  Please enjoy.

Too cool for school, yo!

The name "Bitcoin Balance Checker" is ok I guess, but if asked I would have suggested:

"The Magic Computer Money Fancy Anonymous Cryptographic Coin Balance-Checker-Outer"


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 02:53:19 PM
Too cool for school, yo!

The name "Bitcoin Balance Checker" is ok I guess, but if asked I would have suggested:

"The Magic Computer Money Fancy Anonymous Cryptographic Coin Balance-Checker-Outer"


Haha - you can definitely rebuild/repackage the app and post it on the Google Play store with this name as well if you would like -- I like the name! :-)



Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: casascius on July 25, 2012, 04:41:00 PM
I haven't tested any of these apps, but wanted to make sure the apps were coded in such a way that they will resist a malicious QR code that contained a fully qualified URL that led to a fake website.

Example: I am an attacker, and I print a QR code on a note that encodes the following URL: http://my-nifty-attack-site.tk/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

When browsed, the attack site shows a mockup of blockexplorer / blockchain.info that shows a big balance that is not really there, which allows me to deceive someone into thinking I paid them when I really haven't.

The app should never send the smartphone browser there, but instead be smart enough to strip the bitcoin address out, and formulate the correct complete URL on its own: e.g. http://blockchain.info/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: Winterfrost on July 25, 2012, 04:53:57 PM
I haven't tested any of these apps, but wanted to make sure the apps were coded in such a way that they will resist a malicious QR code that contained a fully qualified URL that led to a fake website.

Example: I am an attacker, and I print a QR code on a note that encodes the following URL: http://my-nifty-attack-site.tk/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

When browsed, the attack site shows a mockup of blockexplorer / blockchain.info that shows a big balance that is not really there, which allows me to deceive someone into thinking I paid them when I really haven't.

The app should never send the smartphone browser there, but instead be smart enough to strip the bitcoin address out, and formulate the correct complete URL on its own: e.g. http://blockchain.info/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

I tested Bitcoin Balance on a random URL. It takes whatever you put and tacks it onto https://blockexplorer.com/address/. So if I read a QR code for http://google.com, then the app sends me to https://blockexplorer.com/address/http://google.com.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 05:15:38 PM
I haven't tested any of these apps, but wanted to make sure the apps were coded in such a way that they will resist a malicious QR code that contained a fully qualified URL that led to a fake website.

Example: I am an attacker, and I print a QR code on a note that encodes the following URL: http://my-nifty-attack-site.tk/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

When browsed, the attack site shows a mockup of blockexplorer / blockchain.info that shows a big balance that is not really there, which allows me to deceive someone into thinking I paid them when I really haven't.

The app should never send the smartphone browser there, but instead be smart enough to strip the bitcoin address out, and formulate the correct complete URL on its own: e.g. http://blockchain.info/address/128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

Hi Mike

Hope you are doing well!  I am loving my casascius coins!

As of now, the way it works is as follows:
http://blockexplorer.com/address/(unescape(e.result).match(/([^\?]*)/)[1].replace("bitcoin:",""))

What this means is:
1. It is safe from the malicious attack that you have provided above in terms of http://my-nifty-attack...
2. However, it will only accept QR codes that have the following form:
128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L
bitcoin:128jxLBCaS1MZpCtXEzN8TmwcetBHibP9L

As per Winterfrost:
I tested Bitcoin Balance on a random URL. It takes whatever you put and tacks it onto https://blockexplorer.com/address/. So if I read a QR code for http://google.com, then the app sends me to https://blockexplorer.com/address/http://google.com.

They will simply get some kind of 404 or Address not found I presume.  Please checkout that tiny snippet on GIST -- that is the entirety of what this is as I simply made this quickly in an effort to give back to the bitcoin community which I have really come to value greatly.  As Erik Voorhees had once mentioned, you guys (bitcoin community) are truly amazing.

With that said, if you think the reader needs to be able to read other types of addresses aside from the "#2" listed above, please let me know.

Cheers,
rasengan



Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: casascius on July 25, 2012, 05:37:34 PM
If using regex, then why not just use regex to snip out the first contiguous group of say 28-34 characters starting with '1' and the rest matching the base58 alphabet?  This would make it highly universal without adding any complexity.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 05:54:49 PM
If using regex, then why not just use regex to snip out the first contiguous group of say 28-34 characters starting with '1' and the rest matching the base58 alphabet?  This would make it highly universal without adding any complexity.

Brilliant!  I will get on it in a few moments.  I have an appointment for a haircut real quick, and then I will change it as per your suggestion thereafter.

Thanks again, you always have the brightest ideas casascius.


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: rasengan on July 25, 2012, 09:29:55 PM
casascius,

Here is your suggestion:
https://gist.github.com/3178816
/([1][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{27,34})/

I have tried it with several strangely formulated QR codes and it seems to work well.  When a QR is not matched to the match expression, the app will just exit.

I'm uploading to Android Market (Google Play) now and it should be available within an hour.

Thanks again,
rasengan

edit: Hope this is what you meant. ;)


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: Stephen Gornick on August 10, 2013, 10:45:41 PM
wondering if there's a simple Android app that will scan a QR of the address and return the balance?

Here's a new one:

Bitcoin Balance Scanner
by Beyondem Inc.
 - https://play.google.com/store/apps/details?id=com.beyondem.bitcoinbalance
 - http://www.reddit.com/r/Bitcoin/comments/1k3ws2


Title: Re: Is there a simple app to scan a QR and return a balance?
Post by: TheButterZone on August 10, 2013, 10:59:38 PM
It also exists for iOS and it's free to download on the appstore.

See : http://itunes.apple.com/en/app/scanbook-bitcoin-address-utility/id536215208?mt=8&ign-mpt=uo%3D2

Android too:
https://play.google.com/store/apps/details?id=paymium.paytunia.scanbook