Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WQfcg-00014Q-IG for bitcoin-development@lists.sourceforge.net; Thu, 20 Mar 2014 16:15:14 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; envelope-from=alexy.kot.all@gmail.com; helo=mail-ve0-f172.google.com; Received: from mail-ve0-f172.google.com ([209.85.128.172]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1WQfcf-0005xA-1G for bitcoin-development@lists.sourceforge.net; Thu, 20 Mar 2014 16:15:14 +0000 Received: by mail-ve0-f172.google.com with SMTP id jx11so1204137veb.3 for ; Thu, 20 Mar 2014 09:15:07 -0700 (PDT) X-Received: by 10.52.163.236 with SMTP id yl12mr3888709vdb.39.1395332107282; Thu, 20 Mar 2014 09:15:07 -0700 (PDT) MIME-Version: 1.0 Sender: alexy.kot.all@gmail.com Received: by 10.59.0.38 with HTTP; Thu, 20 Mar 2014 09:14:27 -0700 (PDT) In-Reply-To: References: From: Alex Kotenko Date: Thu, 20 Mar 2014 16:14:27 +0000 X-Google-Sender-Auth: 73EpT1gwg-lbl6ChwCgtWUm0rbY Message-ID: To: Andreas Schildbach Content-Type: multipart/alternative; boundary=001a11c2c93299635604f50c127b X-Spam-Score: -0.6 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (alexy.kot.all[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1WQfcf-0005xA-1G Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] Payment Protocol for Face-to-face Payments X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 16:15:14 -0000 --001a11c2c93299635604f50c127b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2014-03-20 8:08 GMT+00:00 Andreas Schildbach : > 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:- > =E2=80=8B=E2=80=8B > ". =E2=80=8BI guess this would be best option=E2=80=8B. I'm also worried about= potential QR code capacity, since as I imagine we can encounter device that has your Wallet installed and bluetooth enabled, but no NFC available, so we will have to operate via onscreen QR codes + bluetooth. Hmm, if we're inventing an URI for bluetooth, I'd rather follow existing URI's patterns. BT is strictly point-to-point connection, so BT MAC should be considered as server address, and payment request ID can be considered as request path. Probably "bt:/=E2=80=8B" would be more usual and easily understandable. Really I don't think my PoS will now support multiple simultaneous payments, but it's good to have this thing in place for the time I will need it. I wonder how complex it would be to implement HTTP-over-Bluetooth. Not like I'm willing to do that now, but HTTP is well known and proven to be quite good for tasks like this, so in theory it would be handy to have such capacities in here. > > 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. > My PoS needs to be compatible with BIP21, as when I'm presenting QR code or sending NFC message - I have no way to tell what wallet/phone is =E2=80=8B= =E2=80=8Bon the accepting side, so I have to be compatible to existing widely supported technologies. > I understand your intention behind base43 encoding and noncompatible URI > > - you want to make most possible use of QR codes. But I wonder - did yo= u > > 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 i= n > > 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. =E2=80=8BWell, yes, it would be less efficient than base43. But did you cal= culate how much less? =E2=80=8BIt's a compatible and already widely used way and l= oosing compatibility needs to have serious reasons, so would be great to know exact figures here. I can find out base64 size, but I don't have a working base43 implementation (since the only existing is in Java, and I don't speak it). Can you give me a sample uncompressed PR file of moderate size and a base43 encoded version of it? And I'll convert it into base64 and compare. ---------------------------------------------------------------------------= --- > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and thei= r > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > --001a11c2c93299635604f50c127b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2014-03-20 8:08 GMT+00:00 Andreas Schildbach <= span dir=3D"ltr" style=3D"font-family:arial;color:rgb(34,34,34)"><andreas@schildbach.de<= /a>>:
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>-
=E2=80=8B= =E2=80=8B
<random_id_of_payment_request>".
=E2=80=8BI guess this would be best option=E2=80=8B. I'm also worried a= bout potential QR code capacity, since as I imagine we can encounter device= that has your Wallet installed and bluetooth enabled, but no NFC available= , so we will have to operate via onscreen QR codes + bluetooth.
Hmm, if we're inventing an URI for bluetooth,= I'd rather follow existing URI's patterns. BT is strictly point-to= -point connection, so BT MAC should be considered as server address, and pa= yment request ID can be considered as request path. Probably "bt:<b= t-mac>/=E2=80=8B<random_id_of_payment_request>" would be more= usual and easily understandable.
Really I don't think my PoS will now support = multiple=C2=A0simultaneous payments, but it's good to have this thing i= n place for the time I will need it.
I wonder how complex it would be to implement HTT= P-over-Bluetooth. Not like I'm willing to do that now, but HTTP is well= known and proven to be quite good for tasks like this, so in theory it wou= ld be handy to have such capacities in here.

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

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


> I understand your intention behind base43 encoding and noncompatible U= RI
> - you want to make most possible use of QR codes. But I wonder - did y= ou
> 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 usi= ng
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.)
=C2=A0
&= gt; And also maybe we can extend BIP72 to include encoded payment request i= n
> 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.
=E2=80=8BWell, yes, it would be less efficient than b= ase43. But did you calculate how much less? =E2=80=8BIt's a compatible = and already widely used way and loosing compatibility needs to have serious= reasons, so would be great to know exact figures here.

I can fi= nd out base64 size, but I don't have a working base43 implementation (s= ince the only existing is in Java, and I don't speak it). Can you give = me a sample uncompressed PR file of moderate size and a base43 encoded vers= ion of it? And I'll convert it into base64 and compare. =C2=A0


--001a11c2c93299635604f50c127b--