Author

Topic: Bitcoin Payment Request mime type (instead of bitcoin:URI) (Read 3840 times)

sr. member
Activity: 502
Merit: 251
that URI is bitcoin:15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC, the forum software is truncating it and adding http://
Not if you leave out quotes, so NOT this:
Code:
[url="bitcoin:
"]
[/url]
but this:
Code:
[url=bitcoin:
]
[/url]
hero member
Activity: 574
Merit: 507
Quote
If I want to create a new mimetype to be handled by a cross-platform application that I am writing and to work across a variety of linux desktop environments, where would be a good place to start learning?
necrodearia: maybe the XDG specification?
necrodearia: freedesktop.org maybe
legendary
Activity: 1652
Merit: 2216
Chief Scientist
RE: hippich XML/JSON:
XML ain't gonna happen, and I think JSON is overkill for this.  Using the same format as the bitcoin.conf file is the right answer, I think (easy to implement, human-readable, comments allowed in the file, easy to extend as necessary).  That's what I mocked up at skypaint.com.

RE: nimnul http://localhost:.../
If you've never installed bitcoin, or bitcoin isn't running already, you get an unhelpful error message.  One advantage of a "payment request file" is many users will understand that you need something called "Bitcoin" to open a "Bitcoin Payment Request" file.

RE: mizerydearia Linux support:
In my research I briefly an across a reference to a KDE startup file to associate mime types with applications, so I think it would work nicely cross-platform if you've already installed bitcoin. (UPDATE: cross-desktop spec here)

RE: nimnul clipboard monitoring:
Seems to me that's a feature for geeks, because only geeks would happen to know that if you highlight a bitcoin address when bitcoin was running you could automatically launch bitcoin.  And there's no way that would be turned on by default.  And it also seems to me clipboard monitoring is perfect for a standalone, general-purpose utility ("if selection matches any of THESE regepxs, launch THAT applications with arguments "beginpayment %{address} %{amount}" ... ).

RE: mizerydearia portable devices:
I've never programmed for Android or iPhone; anybody know how they handle non-standard MIME types?  Can apps register themselves as content handlers?



Thinking about actually implementing this, the hard part is getting a running (or just launched) Bitcoin's attention in a cross-platform way.  Using the existing command-line control (which uses JSON-RPC under the covers) would be the most straightforward, but that requires that you set a rpcuser/rpcpassword in the bitcoin.conf file AND run bitcoind or bitcoin -server.  Yuck.

I suppose, as a special case, payment request JSON-RPC calls could be allowed with no rpcpassword, and -server could be made the default.  Makes me a little nervous, though.

Running  bitcoin /path/to/browser/cache/with/payment_request_file  (which is what the web browsers will do) should:
 IF bitcoin isn't running:  launch it, and wait until it is ready to receive payment request messages
 Send running bitcoin (...somehow...) "Hey, we got a payment request here for you to deal with" messgae.
hero member
Activity: 574
Merit: 507
Yet another solution is clipboard monitoring. E.g. pop up when client copies "Send XXX bitcoins to 1e30430430843989UIURIUE".

That may be difficult to implement across variety of operating systems, especially if Bitcoin client were to be implemented on portable devices.
LZ
legendary
Activity: 1722
Merit: 1072
P2P Cryptocurrency
Clipboard monitoring? If a browser plugin/extension will do it - then ok, but if a client - so it is bad idea.
sr. member
Activity: 252
Merit: 250
Yet another solution is clipboard monitoring. E.g. pop up when client copies "Send XXX bitcoins to 1e30430430843989UIURIUE".
hero member
Activity: 574
Merit: 507
A user can manually associate an application with a mime type: http://support.mozilla.com/en-US/kb/Options+window+-+Applications+panel?style_mode=inproduct&as=u

However, I am uncertain how a linux application can pre-install mime types to be handled by firefox or other browsers such as konqueror, chromium, galeon, seamonkey, midori, opera, etc.

It will be nice when a user can click to confirm a transaction using Bitcoin as payment method and then to trigger bitcoin client to present the user with a dialog to confirm sending a specific bitcoin amount to a specific address; two clicks.
sr. member
Activity: 252
Merit: 250
Yet another idea is http://localhost:48321/?to=1e394893roewjrk&amount=3009.00 (it is actually used by one of WebMoney clients)

But it's hard to implement securely
hero member
Activity: 546
Merit: 500
good idea IMHO. Another MHO - format for this payment request file should be in XML (or JSON?) for both debugging purposes and extensibility.

legendary
Activity: 1652
Merit: 2216
Chief Scientist
The bitoin URI thread has died down, but bitcoinmarket and MtGox's spiffy "click to pay" features prompted me to think some more about payment links on web pages.

The problem with the MtGox/Bitcoinmarket solutions is that they still require you to copy&paste an address if you want to pay directly from the bitcoin client running on your machine.  My computer-phobic relatives just won't be able to do that (I can hear them saying "...BUT I DON'T HAVE A COPY BUTTON...").

But a bitcoin: URI has problems, too:
 1. It is hard to implement-- every browser has a different way of registering protocol handlers.
 2. If you don't have the protocol handler installed, clicking on the link doesn't give you any help on what to do to make it work.  (try it here)
 3. Looks like some software (like this forum) don't like bitcoin URIs: Donate to the Faucet (that URI is bitcoin:15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC, the forum software is truncating it and adding http://).

Maybe a bitcoin payment request MIME type would work better; you click on a link and the web server returns a little file of type "application/bitcoin-payment-request".  Like this. Or the links on this page.

If you're running Firefox, you get this dialog box if it doesn't know about application/bitcoin-payment-requests:


On PCs, an app can add stuff to the registry to associate itself with a mime type (anybody know if browsers other than IE pay attention to those registry settings?).

Macs are similar (although I don't know the details; gotta set the mime type in the App's Info.plist, I believe...).  Anybody know about Linux?

Teaching the Bitcoin application to read the bitcoin-payment-request file would be easy, and it shouldn't be terribly hard to get it to ask an already-running Bitcoin to popup a "Send Payment To..." dialog box with fields filled in (OR get it to start itself running and then popup the dialog box).

So: whaddya think?
Jump to: