From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1W7ba1-0007No-CN for bitcoin-development@lists.sourceforge.net; Mon, 27 Jan 2014 02:05:41 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.216.171 as permitted sender) client-ip=209.85.216.171; envelope-from=gavinandresen@gmail.com; helo=mail-qc0-f171.google.com; Received: from mail-qc0-f171.google.com ([209.85.216.171]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1W7bZz-0004Vx-H5 for bitcoin-development@lists.sourceforge.net; Mon, 27 Jan 2014 02:05:41 +0000 Received: by mail-qc0-f171.google.com with SMTP id n7so7169020qcx.2 for ; Sun, 26 Jan 2014 18:05:34 -0800 (PST) X-Received: by 10.140.88.180 with SMTP id t49mr36997834qgd.97.1390788334063; Sun, 26 Jan 2014 18:05:34 -0800 (PST) Received: from [10.165.164.175] (194.sub-70-215-28.myvzw.com. [70.215.28.194]) by mx.google.com with ESMTPSA id b18sm21828315qaw.0.2014.01.26.18.05.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 18:05:32 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-45212873-56A4-403A-93A5-2FE59B616A8C Mime-Version: 1.0 (1.0) From: Gavin X-Mailer: iPhone Mail (11B554a) In-Reply-To: Date: Sun, 26 Jan 2014 21:05:31 -0500 Content-Transfer-Encoding: 7bit Message-Id: <05783109-EFFB-4DA9-97F8-924223F7FF33@gmail.com> References: To: Mike Hearn 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 (gavinandresen[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message 0.0 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars -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: 1W7bZz-0004Vx-H5 Cc: Bitcoin Dev , Andreas Schildbach 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: Mon, 27 Jan 2014 02:05:41 -0000 --Apple-Mail-45212873-56A4-403A-93A5-2FE59B616A8C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message encoding and length (or terminator or checksum or error correction o= r...) should be part of the transport protocol, in my humble opinion. -- Gavin Andresen > On Jan 26, 2014, at 6:01 PM, Mike Hearn wrote: >=20 > To be more accurate, the embedded messages already have length prefixes :-= ) >=20 >=20 >> 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. >>=20 >> Correcting myself: >>=20 >> > it might be a good idea to apply this to all messages if any. >>=20 >> Of course I only mean the "root" messages, namely PaymentRequest, >> Payment, and PaymentACK. The embedded messages don't need length prefixes= . >>=20 >>=20 >> On 01/26/2014 11:00 PM, Mike Hearn wrote: >> > I think for "binding" the payment protocol to those transports we shoul= d >> > indeed use protobuf varint length prefixes. But it's unnecessary for al= l >> > cases. Unless Gavin feels it'd be better to be consistent everywhere an= d >> > 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, s= moke >> > 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 HTT= P >> > > 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 >> > > >> > >> wrot= e: >> > > >> > > 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 undelim= ited >> > > 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 i= s >> > 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, l= ike >> > > >> > > payment.writeDelimitedTo(os); >> > > >> > > This writes the size of the message as a varint before writin= g >> > 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=3D119420431&iu=3D/414= 0/ostg.clktrk >> > > _______________________________________________ >> > > Bitcoin-development mailing list >> > > Bitcoin-development@lists.sourceforge.net >> > >> > > > > > >> > > https://lists.sourceforge.net/lists/listinfo/bitcoin-developm= ent >> > > >> > > >> > > >> > > >> > > >> > -------------------------------------------------------------------= ----------- >> > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. >> > > Learn Why More Businesses Are Choosing CenturyLink Cloud For >> > > Critical Workloads, Development Environments & Everything In Betw= een. >> > > Get a Quote or Start a Free Trial Today. >> > > >> > http://pubads.g.doubleclick.net/gampad/clk?id=3D119420431&iu=3D/414= 0/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 Betwee= n. >> > Get a Quote or Start a Free Trial Today. >> > http://pubads.g.doubleclick.net/gampad/clk?id=3D119420431&iu=3D/414= 0/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=3D119420431&iu=3D/4140/os= tg.clktrk >> > >> > >> > >> > _______________________________________________ >> > Bitcoin-development mailing list >> > Bitcoin-development@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/bitcoin-development >> > >>=20 >>=20 >>=20 >> -------------------------------------------------------------------------= ----- >> 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=3D119420431&iu=3D/4140/ostg= .clktrk >> _______________________________________________ >> Bitcoin-development mailing list >> Bitcoin-development@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bitcoin-development >=20 > --------------------------------------------------------------------------= ---- > 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=3D119420431&iu=3D/4140/ostg.= clktrk > _______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development --Apple-Mail-45212873-56A4-403A-93A5-2FE59B616A8C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Message encoding and length (or termin= ator or checksum or error correction or...) should be part of the transport p= rotocol, in my humble opinion.

--
Gavin Andresen


On Jan 26, 2014, at 6:01 PM, Mike Hearn <mike@plan99.net> wrote:

To be more accurate, the embedded mess= ages already have length prefixes :-)

On Sun, Jan 26, 2014 at 11:14 PM, Andreas Schil= dbach <andreas@schildbach.de> 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 shoul= d
> indeed use protobuf varint length prefixes. But it's unnecessary for al= l
> cases. Unless Gavin feels it'd be better to be consistent everywhere an= d
> is willing to change the spec and code - as far as I know though we're<= br> > trying to ship 0.9rc1 soonish .....
>
>
> On Sun, Jan 26, 2014 at 10:32 PM, Andreas Schildbach
> <an= dreas@schildbach.de <mailto:= andreas@schildbach.de>> wrote:
>
>     Bluetooth, Wifi Direct, HTTP request/responses via broken= proxies, smoke
>     signals... basically anything that is a stream rather tha= n a file.
>
>     Right, NFC NDEF and QR codes are not affected, so we can s= kip 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 f= iles and HTTP
>     > responses it's not a problem in practice. i'd guess n= or for NFC
>     tags nor
>     > QR codes.
>     >
>     >
>     > On Sun, Jan 26, 2014 at 10:11 PM, Andreas Schildbach=
>     > <andreas= @schildbach.de <mailto:andre= as@schildbach.de>
>     <mailto:andreas@schildbach.de <mailto:andreas@schildbach.de>>> wrote:
>     >
>     >     I'm experimenting with BIP70/71 (payme= nt protocol) usage in
>     face to face
>     >     payments (more on that soon).
>     >
>     >     I've excountered an issue with the pro= tobuf format. Protobufs
>     are not
>     >     self-delimiting. That means if you're r= eading from an undelimited
>     >     stream, you will read endlessly becaus= e you don't know how
>     much to read.
>     >
>     >     The current BIP70 implementations prob= ably work because
>     they're reading
>     >     either from a file or from an HTTP res= ource which sets the
>     >     Content-Length header. Trouble is the C= ontent-Length header is
>     optional,
>     >     and also there are many kinds of strea= ms that don't have this
>     built-in
>     >     delimiting mechanism.
>     >
>     >     The Java protobuf API solves this by o= ffering 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 implementa= tions for other
>     languages but I'd
>     >     expect them to offer something compati= ble.
>     >
>     >     However, this leading varint is an inc= ompatible change and
>     would need to
>     >     be added to the spec.
>     >
>     >     I specifically encountered this with P= aymentMessage and
>     PaymentACK, but
>     >     it might be a good idea to apply this t= o all messages if any.
>     Open for
>     >     discussion.
>     >
>     >
>     >
>     ---------------------------------------------------------= ---------------------
>     >     CenturyLink Cloud: The Leader in Enter= prise Cloud Services.
>     >     Learn Why More Businesses Are Choosing= CenturyLink Cloud For
>     >     Critical Workloads, Development Enviro= nments & Everything In
>     Between.
>     >     Get a Quote or Start a Free Trial Toda= y.
>     >
>     http://pubads.g.doub= leclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
>     >     ______________________________________= _________
>     >     Bitcoin-development mailing list
>     >     Bitcoin-development@lists.sourceforge.net
>     <mailto:Bitcoin-development@lists.sourceforge.net>
>     >     <mailto:Bitcoin-development@lists.sour= ceforge.net
>     <mailto:Bitcoin-development@l= ists.sourceforge.net>>
>     >     https://lists.sourc= eforge.net/lists/listinfo/bitcoin-development
>     >
>     >
>     >
>     >
>     >
>     ---------------------------------------------------------= ---------------------
>     > CenturyLink Cloud: The Leader in Enterprise Cloud Se= rvices.
>     > Learn Why More Businesses Are Choosing CenturyLink C= loud For
>     > Critical Workloads, Development Environments & E= verything In Between.
>     > Get a Quote or Start a Free Trial Today.
>     >
>     http://pubads.g.doub= leclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
>     >
>     >
>     >
>     > _______________________________________________
>     > Bitcoin-development mailing list
>     > Bitcoin-development@lists.sourceforge.net
>     <mailto:Bitcoin-development@lists.sourceforge.net>
>     > https://lists.sourceforge.net/lis= ts/listinfo/bitcoin-development
>     >
>
>
>
>     ---------------------------------------------------------= ---------------------
>     CenturyLink Cloud: The Leader in Enterprise Cloud Service= s.
>     Learn Why More Businesses Are Choosing CenturyLink Cloud = For
>     Critical Workloads, Development Environments & Everyt= hing In Between.
>     Get a Quote or Start a Free Trial Today.
>     http://pubads.g.doub= leclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
>     _______________________________________________
>     Bitcoin-development mailing list
>     Bitcoin-development@lists.sourceforge.net
>     <mailto:Bitcoin-development@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/li= stinfo/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 Betwee= n.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/= gampad/clk?id=3D119420431&iu=3D/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-de= velopment@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=3D119420431&iu=3D/4140/ostg.clktrk
_______________________________________________
Bitcoin-development mailing list
Bitcoin-develop= ment@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-deve= lopment

--------------------= ----------------------------------------------------------
C= enturyLink Cloud: The Leader in Enterprise Cloud Services.
L= earn 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=3D119420431&am= p;iu=3D/4140/ostg.clktrk
_______________________________________________
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.n= et
https://lists.sourceforge.net/lists/listinfo/bitcoin= -development
= --Apple-Mail-45212873-56A4-403A-93A5-2FE59B616A8C--