Summary: I propose that each wallet developer include a custom root cert in the set of roots they accept for the payment protocol and that we establish our own mini PKI / X.509 extensions for the Bitcoin early adopter community.
Backgroundbitcoinj 0.11 will soon be ready for release. Just before we release it I'm planning to merge some initial support for the BIP 70 payment protocol, though it won't be very sophisticated. In particular it won't support generating payment requests, only consuming them. But ... after a bit more work to do such as adding support to the wallet-tool command line app (the bitcoinj equivalent of sx) and ensuring that we can load the key store on every supported platform, we'll be ready.
One of the criticisms levelled at the design of the payment protocol is that it uses the PKI, a system of certificate authorities that validate ownership of "identities" (arbitrary small pieces of text, actually) and charge money for the privilege.
These days you can get free certificates for email addresses and domain names. Comodo has a very simple and easy to use way to get them
based on HTML5: you just provide your email address and name, which isn't validated so it can be fake, and then your browser generates the private key locally and stores it. Then you click the verification link delivered to your email address, and the process completes with the fully signed cert being installed by the browser into your operating system keystore. It's as easy as signing up for a website and after doing that, if you use a desktop mail client like Apple Mail.app, Thunderbird etc then you can sign your mails and receive encrypted mails from other people without PGP. The same certificate can be used to sign payment requests. Try it out, it won't take long. The keygen tag actually works for any website.
Issues with the current systemAlthough getting an email address or domain cert is easy and free these days, there are still some inadequacies here:
- There are over a hundred CA's, of which only two issue free certs (Comodo and StartCom). Others also did in the past but they tended to get bought by Symantec which then discontinued the free services. Free is important to get wide usage.
- Often people communicate using identities which are not email addresses, like forum/reddit handles/social network profiles/IM network handles/etc. CA's do not issue certificates for these kinds of identity.
- Even for a free Comodo email address cert, you have to sign up via a web browser. There's no API to do it from apps.
What stops someone simply setting up a new CA as part of the existing system and adding all these features? In theory, nothing. In practice, a lot. Existing users of the PKI are things like operating systems and web browsers, all of which get distributed to hundreds of millions or even billions of people. Often, CA certs are put inside embedded devices like cameras or TV sets. Update cycles are slow. This makes the cost of a leaked root private key astronomically large - potentially billions of devices must be updated and millions of identities revoked and reissued.
Because the PKI system is so large, and the cost of root cert revocation so huge, browser and OS makers require a high degree of professionalism before they'll consider adding you as a root CA. Reducing risk means expensive measures are taken to preserve security:
- Root keys are stored offline and used only to sign intermediate certificates. This is a bit like a "cold wallet".
- Intermediate keys are stored in dedicated tamper-proof hardware security modules.
- CAs must allow users to mark their certs as revoked so when users get hacked or lose their private keys, people automatically stop trusting those keys. That means servers have to be funded and run to serve real-time revocation data via OCSP. The bandwidth and CPU's for this is a cost of business.
- Employees must be background checked and business processes put in place to stop rogue employees issuing fake certs to themselves.
- All the above is too hard for Mozilla/Chrome/Apple/Microsoft/Debian/etc to check themselves, so they outsource verification to professional auditing firms, who of course don't work for free.
- Because all the above is costly, CAs tend to charge for their certificates, which in turn means people expect tech support and other expensive things, raising the cost still further.
The above requirements are just a flavour of what it takes to get into the Mozilla or Windows/MacOS root cert stores. That's why you can't do it, and if you did, you'd end up charging money and selling out to Symantec as well.
An alternativeIs all the above really necessary for every use case? Sometimes the answer is definitely yes - if you see your Trezor say, "Pay 5 BTC to Overstock, Inc of Salt Lake City, USA" you want that statement to actually be meaningful and hard to forge, and Overstock can easily swallow the cost of paying someone to verify who they are. The PKI and existing CAs get us that functionality.
On the other hand, for a message like "Pay 0.5 BTC to bitcointalk user satoshi" you don't really need that level of security. You know that bitcointalk is just a web forum that gets hacked from time to time and that forum handles don't mean much, but you're probably OK with that for small purchases. And if all your communication was on this forum with a particular user handle, then seeing an email address or a real name doesn't actually help because that's not the identity you're expecting and have built trust in.
There is no way in hell that Mozilla is going to accept a root authority run by Theymos for a couple of reasons: bitcointalk has a terrible security track record so it'd be very likely to get revoked, and forum names don't mean anything to a web browser anyway. But nothing stops wallet app authors from trusting Theymos for this purpose.
What does this mean in practice? Let's say that when bitcoinj 0.11 rolls around it checks all the OS provided root certs, AND also a set of custom root certs for various providers that the Bitcoin community uses a lot like this forum, or reddit, or the Bitcoin Foundation, etc. A final root cert owned by the wallet author (or possibly me in this case) can also be added so new providers can come online without waiting for wallet users to upgrade.
These certificates are regular X.509 certs but with a new extension field that indicates how subcerts should be displayed to the user, for instance:
walletRenderExtension: "bitcointalk user $TOKEN$"
Now when this forum issues someone a cert with CN=satoshi, wallet software knows to display it in the UI like this:
Pay 0.5 BTC to bitcointalk user satoshi?
Verified by bitcointalk.org
... same for reddit, #bitcoin-otc, localbitcoins, etc.
What does this look like for the user?
Try it out and see. For a browser like Chrome or Safari, when the browser installs the cert it does so into a global keystore that is accessible to wallet apps too, so that's all that's required to install it.
This would upgrade the security for many common payment scenarios without much cost. Of course the chances of hacks/screwups and global revocations are pretty high, but we're still a small community mostly made up of tech-savvy enthusiasts so we can tolerate that for now.
The nice thing about making minor extensions to X.509 rather than trying to support a second PKI is that we get to reuse all the infrastructure, software and protocols built to support the existing system. For instance, if the bitcointalk admins are handling people who get their accounts hacked and helping them restore access then they could also start running an OCSP server so any certificates issued during the time the account was hacked get automatically revoked. From the perspective of wallet devs and site admins it just requires reusing existing software, so it's a small amount of extra work.