From mboxrd@z Thu Jan 1 00:00:00 1970 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 1W7Xl2-0006wl-Py for bitcoin-development@lists.sourceforge.net; Sun, 26 Jan 2014 22:00:48 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.214.180 as permitted sender) client-ip=209.85.214.180; envelope-from=mh.in.england@gmail.com; helo=mail-ob0-f180.google.com; Received: from mail-ob0-f180.google.com ([209.85.214.180]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1W7Xl1-0003Qg-DQ for bitcoin-development@lists.sourceforge.net; Sun, 26 Jan 2014 22:00:48 +0000 Received: by mail-ob0-f180.google.com with SMTP id wp4so5659978obc.39 for ; Sun, 26 Jan 2014 14:00:42 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.29.33 with SMTP id g1mr43017obh.59.1390773642002; Sun, 26 Jan 2014 14:00:42 -0800 (PST) Sender: mh.in.england@gmail.com Received: by 10.76.99.112 with HTTP; Sun, 26 Jan 2014 14:00:41 -0800 (PST) In-Reply-To: References: Date: Sun, 26 Jan 2014 23:00:41 +0100 X-Google-Sender-Auth: zY7K-xGioqxMUC6CRZOyvVV8wlQ Message-ID: From: Mike Hearn To: Andreas Schildbach Content-Type: multipart/alternative; boundary=001a11c2b8b2e505df04f0e6b866 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: 1W7Xl1-0003Qg-DQ 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 22:00:49 -0000 --001a11c2b8b2e505df04f0e6b866 Content-Type: text/plain; charset=UTF-8 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 > --001a11c2b8b2e505df04f0e6b866 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think for "binding" the payment protocol to th= ose 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 fa= r as I know though we're trying to ship 0.9rc1 soonish .....


On Sun, Jan 2= 6, 2014 at 10:32 PM, Andreas Schildbach <andreas@schildbach.de>= wrote:
Bluetooth, Wifi Direct, HTTP request/respons= es 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 NF= C tags nor
> QR codes.
>
>
> On Sun, Jan 26, 2014 at 10:11 PM, Andreas Schildbach
> <andreas@schildbach.de <mailto:andreas@schildbach.de>> wrote:
>
> =C2=A0 =C2=A0 I'm experimenting with BIP70/71 (payment protocol) u= sage in face to face
> =C2=A0 =C2=A0 payments (more on that soon).
>
> =C2=A0 =C2=A0 I've excountered an issue with the protobuf format. = Protobufs are not
> =C2=A0 =C2=A0 self-delimiting. That means if you're reading from a= n undelimited
> =C2=A0 =C2=A0 stream, you will read endlessly because you don't kn= ow how much to read.
>
> =C2=A0 =C2=A0 The current BIP70 implementations probably work because = they're reading
> =C2=A0 =C2=A0 either from a file or from an HTTP resource which sets t= he
> =C2=A0 =C2=A0 Content-Length header. Trouble is the Content-Length hea= der is optional,
> =C2=A0 =C2=A0 and also there are many kinds of streams that don't = have this built-in
> =C2=A0 =C2=A0 delimiting mechanism.
>
> =C2=A0 =C2=A0 The Java protobuf API solves this by offering delimited = I/O, like
>
> =C2=A0 =C2=A0 payment.writeDelimitedTo(os);
>
> =C2=A0 =C2=A0 This writes the size of the message as a varint before w= riting the data.
> =C2=A0 =C2=A0 I don't know about protobuf implementations for othe= r languages but I'd
> =C2=A0 =C2=A0 expect them to offer something compatible.
>
> =C2=A0 =C2=A0 However, this leading varint is an incompatible change a= nd would need to
> =C2=A0 =C2=A0 be added to the spec.
>
> =C2=A0 =C2=A0 I specifically encountered this with PaymentMessage and = PaymentACK, but
> =C2=A0 =C2=A0 it might be a good idea to apply this to all messages if= any. Open for
> =C2=A0 =C2=A0 discussion.
>
>
> =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&g= t;
> =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

--001a11c2b8b2e505df04f0e6b866--