Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1W7YiG-0001Ah-Ae for bitcoin-development@lists.sourceforge.net; Sun, 26 Jan 2014 23:02:00 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.219.50 as permitted sender) client-ip=209.85.219.50; envelope-from=mh.in.england@gmail.com; helo=mail-oa0-f50.google.com; Received: from mail-oa0-f50.google.com ([209.85.219.50]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1W7YiE-0006cl-R9 for bitcoin-development@lists.sourceforge.net; Sun, 26 Jan 2014 23:02:00 +0000 Received: by mail-oa0-f50.google.com with SMTP id n16so5924452oag.23 for ; Sun, 26 Jan 2014 15:01:53 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.44.42 with SMTP id b10mr102024oem.70.1390777313436; Sun, 26 Jan 2014 15:01:53 -0800 (PST) Sender: mh.in.england@gmail.com Received: by 10.76.99.112 with HTTP; Sun, 26 Jan 2014 15:01:53 -0800 (PST) In-Reply-To: References: Date: Mon, 27 Jan 2014 00:01:53 +0100 X-Google-Sender-Auth: wESWnUY3KlwohKwGwbw1JRdxh84 Message-ID: From: Mike Hearn To: Andreas Schildbach Content-Type: multipart/alternative; boundary=001a11c30a04baab7404f0e7932b X-Spam-Score: -0.5 (/) 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 (mh.in.england[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message 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: 1W7YiE-0006cl-R9 Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] BIP70/71 issue, RFD 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: Sun, 26 Jan 2014 23:02:00 -0000 --001a11c30a04baab7404f0e7932b Content-Type: text/plain; charset=UTF-8 To be more accurate, the embedded messages already have length prefixes :-) On Sun, Jan 26, 2014 at 11:14 PM, Andreas Schildbach wrote: > Just keep in mind that if it turns out we need to retrofit messages with > length prefixes I fear we will have to restart with new mime-types. The > nature of prefixes being always at the start means this rules out simply > incrementing a protocol version number. > > Correcting myself: > > > it might be a good idea to apply this to all messages if any. > > Of course I only mean the "root" messages, namely PaymentRequest, > Payment, and PaymentACK. The embedded messages don't need length prefixes. > > > On 01/26/2014 11:00 PM, Mike Hearn wrote: > > I think for "binding" the payment protocol to those transports we should > > indeed use protobuf varint length prefixes. But it's unnecessary for all > > cases. Unless Gavin feels it'd be better to be consistent everywhere and > > is willing to change the spec and code - as far as I know though we're > > trying to ship 0.9rc1 soonish ..... > > > > > > On Sun, Jan 26, 2014 at 10:32 PM, Andreas Schildbach > > > wrote: > > > > Bluetooth, Wifi Direct, HTTP request/responses via broken proxies, > smoke > > signals... basically anything that is a stream rather than a file. > > > > Right, NFC NDEF and QR codes are not affected, so we can skip the > > delimiter for these mediums. > > > > > > On 01/26/2014 10:24 PM, Mike Hearn wrote: > > > Which medium is this an issue for? As you note, for files and HTTP > > > responses it's not a problem in practice. i'd guess nor for NFC > > tags nor > > > QR codes. > > > > > > > > > On Sun, Jan 26, 2014 at 10:11 PM, Andreas Schildbach > > > > > >> > wrote: > > > > > > I'm experimenting with BIP70/71 (payment protocol) usage in > > face to face > > > payments (more on that soon). > > > > > > I've excountered an issue with the protobuf format. Protobufs > > are not > > > self-delimiting. That means if you're reading from an > undelimited > > > stream, you will read endlessly because you don't know how > > much to read. > > > > > > The current BIP70 implementations probably work because > > they're reading > > > either from a file or from an HTTP resource which sets the > > > Content-Length header. Trouble is the Content-Length header is > > optional, > > > and also there are many kinds of streams that don't have this > > built-in > > > delimiting mechanism. > > > > > > The Java protobuf API solves this by offering delimited I/O, > like > > > > > > payment.writeDelimitedTo(os); > > > > > > This writes the size of the message as a varint before writing > > the data. > > > I don't know about protobuf implementations for other > > languages but I'd > > > expect them to offer something compatible. > > > > > > However, this leading varint is an incompatible change and > > would need to > > > be added to the spec. > > > > > > I specifically encountered this with PaymentMessage and > > PaymentACK, but > > > it might be a good idea to apply this to all messages if any. > > Open for > > > discussion. > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > > Critical Workloads, Development Environments & Everything In > > Between. > > > Get a Quote or Start a Free Trial Today. > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > _______________________________________________ > > > Bitcoin-development mailing list > > > Bitcoin-development@lists.sourceforge.net > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > > Critical Workloads, Development Environments & Everything In > Between. > > > Get a Quote or Start a Free Trial Today. > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > > > > > > > > > _______________________________________________ > > > Bitcoin-development mailing list > > > Bitcoin-development@lists.sourceforge.net > > > > > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > > > > > > > > > > > ------------------------------------------------------------------------------ > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > Critical Workloads, Development Environments & Everything In Between. > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > _______________________________________________ > > Bitcoin-development mailing list > > Bitcoin-development@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > > > > > > > > > > ------------------------------------------------------------------------------ > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > Critical Workloads, Development Environments & Everything In Between. > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > Bitcoin-development mailing list > > Bitcoin-development@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > > > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > --001a11c30a04baab7404f0e7932b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To be more accurate, the embedded messages already have le= ngth prefixes :-)


On Sun, Jan 26, 2014 at 11:14 PM, Andreas Schildbach <andrea= s@schildbach.de> wrote:
Just keep in mind that if it turns out we ne= ed to retrofit messages with
length prefixes I fear we will have to restart with new mime-types. The
nature of prefixes being always at the start means this rules out simply incrementing a protocol version number.

Correcting myself:

> it might be a good idea to apply this to all messages if any.

Of course I only mean the "root" messages, namely PaymentRe= quest,
Payment, and PaymentACK. The embedded messages don't need length prefix= es.


On 01/26/2014 11:00 PM, Mike Hearn wrote:
> I think for "binding" the payment protocol to those transpor= ts we should
> indeed use protobuf varint length prefixes. But it's unnecessary f= or all
> cases. Unless Gavin feels it'd be better to be consistent everywhe= re and
> is willing to change the spec and code - as far as I know though we= 9;re
> trying to ship 0.9rc1 soonish .....
>
>
> On Sun, Jan 26, 2014 at 10:32 PM, Andreas Schildbach
> <a= ndreas@schildbach.de <mailto:andreas@schildbach.de>> wrote:
>
> =C2=A0 =C2=A0 Bluetooth, Wifi Direct, HTTP request/responses via broke= n proxies, smoke
> =C2=A0 =C2=A0 signals... basically anything that is a stream rather th= an a file.
>
> =C2=A0 =C2=A0 Right, NFC NDEF and QR codes are not affected, so we can= skip the
> =C2=A0 =C2=A0 delimiter for these mediums.
>
>
> =C2=A0 =C2=A0 On 01/26/2014 10:24 PM, Mike Hearn wrote:
> =C2=A0 =C2=A0 > Which medium is this an issue for? As you note, for= files and HTTP
> =C2=A0 =C2=A0 > responses it's not a problem in practice. i'= ;d guess nor for NFC
> =C2=A0 =C2=A0 tags nor
> =C2=A0 =C2=A0 > QR codes.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > On Sun, Jan 26, 2014 at 10:11 PM, Andreas Schildbac= h
> =C2=A0 =C2=A0 > <andrea= s@schildbach.de <mailto:and= reas@schildbach.de>
> =C2=A0 =C2=A0 <mailto:andreas@schildbach.de <mailto:andreas@schildbach.de>>> wrote: > =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 I'm experimenting with BIP70/71 (= payment protocol) usage in
> =C2=A0 =C2=A0 face to face
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 payments (more on that soon).
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 I've excountered an issue with th= e protobuf format. Protobufs
> =C2=A0 =C2=A0 are not
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 self-delimiting. That means if you= 9;re reading from an undelimited
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 stream, you will read endlessly becau= se you don't know how
> =C2=A0 =C2=A0 much to read.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 The current BIP70 implementations pro= bably work because
> =C2=A0 =C2=A0 they're reading
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 either from a file or from an HTTP re= source which sets the
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Content-Length header. Trouble is the= Content-Length header is
> =C2=A0 =C2=A0 optional,
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 and also there are many kinds of stre= ams that don't have this
> =C2=A0 =C2=A0 built-in
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 delimiting mechanism.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 The Java protobuf API solves this by = offering delimited I/O, like
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 payment.writeDelimitedTo(os);
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 This writes the size of the message a= s a varint before writing
> =C2=A0 =C2=A0 the data.
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 I don't know about protobuf imple= mentations for other
> =C2=A0 =C2=A0 languages but I'd
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 expect them to offer something compat= ible.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 However, this leading varint is an in= compatible change and
> =C2=A0 =C2=A0 would need to
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 be added to the spec.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 I specifically encountered this with = PaymentMessage and
> =C2=A0 =C2=A0 PaymentACK, but
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 it might be a good idea to apply this= to all messages if any.
> =C2=A0 =C2=A0 Open for
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 discussion.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 --------------------------------------------------------= ----------------------
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 CenturyLink Cloud: The Leader in Ente= rprise Cloud Services.
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Learn Why More Businesses Are Choosin= g CenturyLink Cloud For
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Critical Workloads, Development Envir= onments & Everything In
> =C2=A0 =C2=A0 Between.
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Get a Quote or Start a Free Trial Tod= ay.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 http://pubads.g.= doubleclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk > =C2=A0 =C2=A0 > =C2=A0 =C2=A0 _____________________________________= __________
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Bitcoin-development mailing list
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 Bitcoin-development@lists.sourceforge.net
> =C2=A0 =C2=A0 <mailto:Bitcoin-development@lists.sourceforge.net>
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 <mailto:Bitcoin-development@lists.so= urceforge.net
> =C2=A0 =C2=A0 <mailto:Bitcoin-development= @lists.sourceforge.net>>
> =C2=A0 =C2=A0 > =C2=A0 =C2=A0 https://lists.sou= rceforge.net/lists/listinfo/bitcoin-development
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 --------------------------------------------------------= ----------------------
> =C2=A0 =C2=A0 > CenturyLink Cloud: The Leader in Enterprise Cloud S= ervices.
> =C2=A0 =C2=A0 > Learn Why More Businesses Are Choosing CenturyLink = Cloud For
> =C2=A0 =C2=A0 > Critical Workloads, Development Environments & = Everything In Between.
> =C2=A0 =C2=A0 > Get a Quote or Start a Free Trial Today.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 http://pubads.g.= doubleclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk > =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > _______________________________________________
> =C2=A0 =C2=A0 > Bitcoin-development mailing list
> =C2=A0 =C2=A0 > Bitcoin-development@lists.sourceforge.net
> =C2=A0 =C2=A0 <mailto:Bitcoin-development@lists.sourceforge.net>
> =C2=A0 =C2=A0 > https://lists.sourceforge.net/l= ists/listinfo/bitcoin-development
> =C2=A0 =C2=A0 >
>
>
>
> =C2=A0 =C2=A0 --------------------------------------------------------= ----------------------
> =C2=A0 =C2=A0 CenturyLink Cloud: The Leader in Enterprise Cloud Servic= es.
> =C2=A0 =C2=A0 Learn Why More Businesses Are Choosing CenturyLink Cloud= For
> =C2=A0 =C2=A0 Critical Workloads, Development Environments & Every= thing In Between.
> =C2=A0 =C2=A0 Get a Quote or Start a Free Trial Today.
> =C2=A0 =C2=A0 http://pubads.g.= doubleclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk > =C2=A0 =C2=A0 _______________________________________________
> =C2=A0 =C2=A0 Bitcoin-development mailing list
> =C2=A0 =C2=A0 Bitcoin-development@lists.sourceforge.net
> =C2=A0 =C2=A0 <mailto:Bitcoin-development@lists.sourceforge.net>
> =C2=A0 =C2=A0 https://lists.sourceforge.net/lists/= listinfo/bitcoin-development
>
>
>
>
> ----------------------------------------------------------------------= --------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Betwe= en.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.ne= t/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-d= evelopment@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitco= in-development
>



---------------------------------------------------------------------------= ---
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gam= pad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
_______________________________________________
Bitcoin-development mailing list
Bitcoin-develo= pment@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-de= velopment

--001a11c30a04baab7404f0e7932b--