[Bitcoin-development] Payment Protocol for Face-to-face Payments

Andreas Schildbach andreas at schildbach.de
Thu Mar 20 08:08:45 UTC 2014


On 03/20/2014 03:22 AM, Alex Kotenko wrote:
> Right now, before BIP70, I'm sending BIP21 URI via NFC or QR code, and I
> need to still be able to use it for backwards compatibility. But at the
> same time I want to be able to support BIP70. And also I want to avoid
> using external servers, the concept of my POS is that everything is
> happening between just payer's phone and payee's POS device. This means
> that BIP72 HTTP(S) link inside Bitcoin URI is not suitable for me.

We could use Bluetooth in the "r" parameter, not unlike we use Bluetooth
in the payment_url. However, since multiple devices could access your
machine at the same time, we need some for of adressibility of different
payment requests. Something like
"bt:<btmac>-<random_id_of_payment_request>".

> You're also offering an option to include Base43 encoded PR body right
> inside the Bitcoin URI, but in a way that is not backwards compatible
> with BIP21.

Well, do we need to be compatible? If the dev community decides Base43
PR QR's (or whatever other self-contained format) is the way to go, we
just implement, roll it out and use it.

> I understand your intention behind base43 encoding and noncompatible URI
> - you want to make most possible use of QR codes. But I wonder - did you
> compare this base43 to base64 encoded request in a binary QR code
> format? How much do we actually win in total bytes capacity at a price
> of noncompatibility and increased complexity?

Alphanumeric QR codes have an alphabet of 45 chars, of which I am using
43. I skipped Space and '%' because they're not allowed in URIs. When I
invented the Base43 format back in 2011, wanted it to be URI compatible
so we can use the Android intent dispatcher.

If we let go of the URI requirement, we can use binary QR codes as well.
This means users will always have to manually start their Bitcoin app
first. (Also, there is an implementation issue with the ZXing scanner
I'm using, it returns Strings rather than a byte array so it will choke
on \0 characters.)

> And also maybe we can extend BIP72 to include encoded payment request in
> the URL directly in a backwards compatible way?

I took this into consideration. It would be space inefficient.

The Base58-encoded address from BIP21 forces the QR code into binary
mode. Still you can't encode the payment request extension (probably an
URL parameter) as binary because it needs to stay compatible to the URI
standard (RFC 3986). You could use one of the Base64 variants for the PR
in this case, but still it would be inefficient.






More information about the bitcoin-dev mailing list