Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: tcatm on January 07, 2011, 07:53:10 PM



Title: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 07, 2011, 07:53:10 PM
I've created a JavaScript user interface for bitcoin. It's project page is located at:

http://tcatm.github.com/bitcoin-js-remote/

bitcoin-js-remote is a user interface for Bitcoin written in JavaScript. It works in most modern browsers as well as on Android and iPhones. If run on an Android phone it can scan QR codes containing addreses to send Bitcoins to! If you don't own an Android device, you can still enter raw bitcoin: URIs in a textbox.

For SSL support a small server side script written in Python is required.

  • SSL for secure communication
  • Display QR code with address
  • Scan QR codes (Android only)
  • Supports multiple accounts
  • Android and iPhone support
  • Send and receive Bitcoins
  • List transactions


Title: Re: JavaScript UI for Bitcoin
Post by: mndrix on January 07, 2011, 10:03:01 PM
Well done!


Title: Re: JavaScript UI for Bitcoin
Post by: jimbobway on January 07, 2011, 10:26:37 PM
Nice.


Title: Re: JavaScript UI for Bitcoin
Post by: tcatm on January 08, 2011, 02:57:56 AM
New feature: Display address as QR code and scan QR codes on Android phones. This makes phone2phone transfer of bitcoins possible without having to enter addresses.


Title: Re: JavaScript UI for Bitcoin
Post by: chris200x9 on January 08, 2011, 03:06:47 AM
good job, phone to phone is going to be huge!


Title: Re: JavaScript UI for Bitcoin
Post by: tcatm on January 09, 2011, 12:08:58 AM
Added SSL support (using a small SSL webserver).


Title: Re: JavaScript UI for Bitcoin
Post by: abstraction on January 09, 2011, 01:33:19 PM
i don't know how to get this running yet, but i can tell this is really great already! i have two questions:

1) can you (or anybody capable) put together a step-by-step guide with pictures that shows a person who has never heard of Bitcoin how to get this running? If somebody knows how to make software installers for unix/linux, mac, and windows, that could make this project go viral since you can manage your account from a cell phone.

2) is there a way to use virtualization efficiently and securely such that each person can have bitcoind run on the same physical server? could i run the server service in the cloud and have the data securely encrypted so that nobody could access my wallet.dat file except me? if so, this could be a virtual bank that securely maintains wallet.dat files, with the clients' trust that the virtual bank will keep the wallet.dat file secure and untampered.


Title: Re: JavaScript UI for Bitcoin
Post by: marcusaurelius on January 09, 2011, 05:21:43 PM
here is a qr-code generator for the software to read: http://qr.ma.eatgold.com/ (http://qr.ma.eatgold.com/)
it supports specifying an amount to be sent. the js-software can implement this quite easily.


Title: Re: JavaScript UI for Bitcoin
Post by: tcatm on January 09, 2011, 06:08:21 PM
here is a qr-code generator for the software to read: http://qr.ma.eatgold.com/ (http://qr.ma.eatgold.com/)
it supports specifying an amount to be sent. the js-software can implement this quite easily.

Can we first please stick to one URI scheme? I don't want to parse QR codes for three different possible schemes.

I prefer x-btc.


Title: Re: JavaScript UI for Bitcoin
Post by: marcusaurelius on January 09, 2011, 06:22:23 PM
I think this is about adoption. If you start using xbtc that would count in its favor.

I personally would prefer the shortest possible, as this keeps the qrcodes small. x-btc mandates an action to be specified ("store" or "send" currently) and also mandates the "addr=" part in front of the adress, both which I consider to be redundant.

I like the simplicity of bitcoin:xxxxxxxxxxxxx plus very much approve of its accessibility. Should someone from the outside happen to see such a uri, the protocol name already gives a description. A quick google search should then do the rest. x-btc sounds much more cryptic, the chance that s/1 gooogles that out of curiosity are much slimmer. Also, very likely, what s/he will find are mostly technical specifications. Not a good introduction to bitcoin.


Title: Re: JavaScript UI for Bitcoin
Post by: tcatm on January 09, 2011, 06:24:59 PM
Let's move this discussion over to http://bitcointalk.org/index.php?topic=2705.0 as it fits better there.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 13, 2011, 05:13:09 AM
Added bitcoin: URI support for QR codes (you can even enter raw bitcoin: URIs if you don't have a Android phone!)


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 13, 2011, 03:33:38 PM
One suggestion: I think the license you are using is the MIT license; however neither the files nor the project page mentions, which specific license you are using. Please add the type of the license to your project page and the files.

Fixed (integration branch for now)


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 14, 2011, 10:35:49 PM
v0.3 released.

* faster rendering of transaction list
* more responsive on Android
* reduced bandwidth usage


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 17, 2011, 01:55:41 AM
v0.3.1: fix transaction list on firefox


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: bitcoin2 on January 24, 2011, 06:41:40 PM
I would like insert a private key from QR code. So I could print a wallet on paper and give this paper to another person. He could scan this QR code with an android phone, check the value and transfer the bitcoins to his wallet.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on January 25, 2011, 02:58:37 AM
I would like insert a private key from QR code. So I could print a wallet on paper and give this paper to another person. He could scan this QR code with an android phone, check the value and transfer the bitcoins to his wallet.

First: Please discuss this in another thread. This is only for js-remote!

This is a feature that needs support in bitcoin itself. Once there are RPCs I can add such a feature to js-remote.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on February 21, 2011, 12:49:09 AM
v0.3.2:
added labelsmode (assumes accounts are labels like the wxGUI does)
can create accounts/labels


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: riush on February 21, 2011, 02:57:18 AM
This is really great, the perfect UI for a phone!

I just tested the new version on the demo page and the account handling looks great.
Unfortunately, there seems to be a problem with sending, it always says "Invalid account name"...

Just wanted to let you know. Again, great work, and many thanks, tcatm! :)


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on February 21, 2011, 03:27:14 AM
I just tested the new version on the demo page and the account handling looks great.
Unfortunately, there seems to be a problem with sending, it always says "Invalid account name"...

Fixed. Thanks!


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on February 21, 2011, 02:40:08 PM
Fixed a bug preventing sending in labelsmode in some cases.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: Quip on February 21, 2011, 04:41:25 PM
I can't seem to get this working. Do I have to use your Python SSL server, or can I use Apache? How do I configure it?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on February 21, 2011, 04:44:03 PM
Just create certificates with openssl:

openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout server.pem -out server.cert

and run it with:

python SSLserver.py -r http://localhost:8332/

then connect to https://$IP:8338/


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: Quip on February 21, 2011, 07:04:17 PM
When I try that, the python script repeatedly asks me for the PEM passphrase, and the page never loads. Is it possible for me to host this using Apache?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on February 21, 2011, 07:19:10 PM
Yes, you can host it on Apache, but you need to tell Apache to tunnel the JSON RPC requests to bitcoin. (I don't know how to do that)


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: abstraction on March 19, 2011, 11:07:20 PM
Are there any Bitcoin banks that have integrated this? Are there any banks out there willing to integrate this? I bet they would make good competition for mybitcoin.

tcatm, suppose I wanted to print my bitcoin address on a poster (http://bitcointalk.org/index.php?topic=3143.msg67249#msg67249) in the form of a qr code. How big would the qr code have to be to hold a digitally signed message containing a person's name and their address? Is it theoretically possible for your app to read the qr code, parse out the name and bitcoin address, display them nicely, and present an empty text field with a "send" button?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on March 19, 2011, 11:52:10 PM
Have you tried the example QR codes? You can include a message that is displayed to the user (not signed, though) and where he can either send or cancel the transaction.

I'd like to start a "bank" that uses js-remote as it's frontend, but I'm very busy lately so it might take some months but some backend code is already working.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: abstraction on March 20, 2011, 10:36:44 PM
I have not tried, yet, but that isn't my concern. I think I need to describe two scenarios to illustrate the point I'm trying to get across. Try to see yourself in each situation. If anyone else can boil this down to the important points, I will appreciate it greatly.

Scenario 1: Person (me) to Person (Fred)
For whatever reason, I am transferring bitcoins to Fred. He has tcatm's js-remote and generates a qr code for me. I trust that the qr-code containing a bitcoin address is Fred's because Fred is the one who generated it for me and I watched him do it. Therefore, I don't need to see a digitally signed message in order to trust that my bitcoins will go to Fred.

Scenario 2: Person (me) to Employee (Fred)*
Fred makes sandwiches at a local sandwich shop. The owner of the shop posted a poster on the wall that has pictures of all the employees on the wall and their corresponding qr-codes underneath each person. How do I know that my bitcoins will go to Fred? For all I know, the boss could own the bitcoin addresses and take all the tips. Fred doesn't really understand what Bitcoin is, but he understands that he can get tips with it, so he trusts his boss to manage the tips for him. WHY? He can manage them himself. All Fred needs to do is give his boss a qr-code with a signed message containing his Bitcoin address and his name. All his boss needs to do is display an image resembling Fred's and Fred's qr-code. Any patron who scans the code can easily verify two things: the picture on the wall looks like Fred, and, the name in the qr-code says "Fred".

My concern is that a qr-code with a signed message will be really big, but that's ok because it will be displayed on a big poster. Any smart phone should be able to resolve the qr image since it is so big. But, the tools to parse the payload from the signed message don't exist yet, or so I understand. If someone can develop these tools, I think a lot more posters will go up. And a lot more people will start to use their phones to tip people in bitcoins using the js-remote and the open source bitcoin bank that will eventually exist (hint, hint to developers looking for a good project).



* This should go in a new topic for more depth, but eventually, there won't be employers and employees. There will be people pursuing their passions. The current passion of the "employer" is to serve excellent sandwiches to his guests. He will let butchers bring in various types of meats, bakers bring in various types of bread, farmers bring in various types of vegetables, and people contribute their sandwich making skills. Patrons won't be patrons. They will be people looking to have a good sandwich experience. If they like the product that everybody combined to make (a sandwich at a nice place to eat sandwiches), they will tip the contributors accordingly or else they will be seen as stingy and ungrateful within the community (which runs the risk of being ostracized / booted out / ban hammered / eighty-sixed). The "employer" will decide who's posters will appear on the wall. Think of it as a wall of fame. Placement and rank has to be earned by producing something valuable first. Quality goes up, cost goes down.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: TiagoTiago on March 24, 2011, 06:16:43 PM
do i have to run the ssl server to use it locally?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: ryepdx on March 24, 2011, 07:09:57 PM
And a lot more people will start to use their phones to tip people in bitcoins using the js-remote and the open source bitcoin bank that will eventually exist (hint, hint to developers looking for a good project).

I'm presently working on this. I'll post again once I have something working up on github. I'm actually kinda surprised nobody has use js-remote in this way yet.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: Hal on March 24, 2011, 07:47:47 PM
do i have to run the ssl server to use it locally?
The js-remote script implements a ssl web server, fully self contained. You don't need apache. Just run SSLserver.py, open up port 8338 for incoming, and connect with your mobile browser to https://yourhost.com:8338. Then you can access your wallet from anywhere, check balance, make payments, etc.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: TiagoTiago on March 24, 2011, 08:41:24 PM
wait, for connecting to bitcoind running on the same machine, do i need to run the python  server or just loading the html page sets everything up?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on March 24, 2011, 10:12:44 PM
Because of Cross-Site Scripting protection in most browsers you need the python server.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: TiagoTiago on March 25, 2011, 12:37:34 AM
I see, thanx


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: abstraction on March 25, 2011, 04:25:57 AM
And a lot more people will start to use their phones to tip people in bitcoins using the js-remote and the open source bitcoin bank that will eventually exist (hint, hint to developers looking for a good project).

I'm presently working on this. I'll post again once I have something working up on github. I'm actually kinda surprised nobody has use js-remote in this way yet.

I created a new topic to discuss application of tcatm's project here (http://bitcointalk.org/index.php?topic=4918).


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: TiagoTiago on March 26, 2011, 04:01:14 PM
Hm, what version of Python does it need?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: tcatm on May 25, 2011, 11:45:24 PM
v0.3.5:
* support for subcent values


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: omar on June 21, 2012, 06:40:26 AM
I have setup bitcoin-js-remote 0.3.6. https://github.com/tcatm/bitcoin-js-remote

It communicates with bitcoind nicely and provides a great interface for sending and receiving bitcoins.

However when I have bitcoind encrypt the wallet file and then try to send bitcoins, I get the message:

  Error: Please enter the wallet passphrase with walletpassphrase first.

However on the form to send bitcoins there is no field to enter the wallet passphrase. I also checked in the Settings/Server Info and there was no field for wallet passphrase there either.

Since bitcoind supports wallet encryption with a passphrase, it would be great if the form to send bitcoins allowed the wallet passphrase to be entered.


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: omar on June 24, 2012, 07:42:11 AM
I had come across bitcoin-js-remote about a year ago and wanted to use it. But since bitcoind did not encrypt the wallet file at the time, I decided not to. Now that bitcoind does encrypt the wallet, bitcoin-js-remote would be a great way to access that wallet. However, it just needs to support the new RPC commands to send the wallet passphrase. tcatm, are you still interested in this project?


Title: Re: JavaScript UI for Bitcoin, QR code, bitcoin: URIs
Post by: omar on June 30, 2012, 06:16:06 AM
I modified my copy of bitcoin-js-remote to accept a wallet passphrase and allow sending from an encrypted wallet. If any wants a copy just PM me.