Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ripper234 on December 02, 2012, 08:50:41 PM



Title: The bitcoin URL scheme doesn't include "web+" prefix
Post by: ripper234 on December 02, 2012, 08:50:41 PM
This is a clickable Bitcoin URI: 1BitcoinEaterAddressDontSendf59kuE (bitcoin:1BitcoinEaterAddressDontSendf59kuE)

According to MDN, custom URI prefixes must start with "web+". If Blockchain.info/My Wallet wanted to register as a handler for all bitcoin: links via navigator.registerProtocolHandler (https://developer.mozilla.org/en-US/docs/DOM/navigator.registerProtocolHandler), they wouldn't be able to.

To fix this, the standard Bitcoin URI prefix should be "web+bitcoin:" instead of "bitcoin:"

Thoughts? Was this discussed when BPI 20 (https://en.bitcoin.it/wiki/URI_Scheme) was accepetd?

(The above is based on about 5 minutes of reading, I've never implemented protocol handlers myself ... but at least Chrome seems to need the "web+" prefix (http://updates.html5rocks.com/2011/06/Registering-a-custom-protocol-handler))


Title: Re: The bitcoin URL scheme doesn't include "web+" prefix
Post by: Peter Todd on December 03, 2012, 12:31:05 AM
The web+ prefix is meant to designate that a website has registered that protocol handler; Bitcoin isn't a website. The origin of this limitation is probably security concerns, for instance registering protocol handlers for protocols that have no reason at all to go to a website. Note how chrome has a few exceptions like mailto: for where it is agreed that websites should be able to register protocol handlers. Chrome can eventually add bitcoin: to this list if the chrome developers think it is a good idea. In addition it looks like Firefox does not have this limitation.


Title: Re: The bitcoin URL scheme doesn't include "web+" prefix
Post by: ripper234 on December 03, 2012, 01:21:03 AM
The web+ prefix is meant to designate that a website has registered that protocol handler; Bitcoin isn't a website. The origin of this limitation is probably security concerns, for instance registering protocol handlers for protocols that have no reason at all to go to a website. Note how chrome has a few exceptions like mailto: for where it is agreed that websites should be able to register protocol handlers. Chrome can eventually add bitcoin: to this list if the chrome developers think it is a good idea. In addition it looks like Firefox does not have this limitation.

Hmm, I read the Mozilla page and saw "web+" mentioned there as a security constraint, so I thought the protocol aims for this to be a global restriction. In fact, it's just listed as an implementation detail in Chrome, so it's too specific to consider.

/thread