public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Tom <tomz@freedommail•ch>
To: bitcoin-dev@lists•linuxfoundation.org,
	Andreas Schildbach <andreas@schildbach•de>
Subject: Re: [bitcoin-dev] Requesting BIP assignment; Flexible Transactions.
Date: Wed, 21 Sep 2016 14:58:02 +0200	[thread overview]
Message-ID: <58983644.DvMMf90VdX@garp> (raw)
In-Reply-To: <nrtsok$lp5$1@blaine.gmane.org>

On Wednesday 21 Sep 2016 14:00:23 Andreas Schildbach via bitcoin-dev wrote:
> Just glancing over your BIP, I wonder if we should use Protobuf. It uses
> this "flexible" format already and is quite compact/binary. We use
> Protobuf already for the payment protocol, and there is very good tool
> support.

There is a lot of overlap between different binary formats. Looking through 
the on-the-wire protocol you'll see that my spec is very similar. Practically 
all the advantages of protobuf are present in CMF. I can write you a java 
parser if you want, it should be easy to port from Qt/C++ code :)
https://github.com/bitcoinclassic/transactions

CMF: 
https://github.com/bitcoinclassic/documentation/blob/master/spec/compactmessageformat.md

There is no tool support needed, just one or two classes. Which personally I 
think is an advantage.


Some advantages of CMF over protobuf from the top of my head;

* It reuses the var-int parsing that Bitcoin uses (which is itself slightly 
different from others).

* zero-copy support (not relevant for this bip, though).

* Additional values addition (i.e. adding new data) is .. tricky in protobuf.
https://developers.google.com/protocol-buffers/docs/proto#updating

* In my experience parsing a message manually (like a SOX parser) is much 
better in reporting errors and detecting wrong usages than auto-generated code 
(but personally I'm not much a fan of auto-generated APIs) at all...

* Generated parsing/writing code will not be as fast as we can make it.

* CMF is more compact (uses less bytes) for its messages.


Protobuf is something I've used before and I think we can do better. I think 
that CMF together with some support classes can do this better.


  reply	other threads:[~2016-09-21 12:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 17:15 Tom
2016-09-20 21:31 ` Luke Dashjr
2016-09-21  9:32   ` Tom
2016-09-20 21:56 ` Peter Todd
2016-09-21  9:32   ` Tom
2016-09-22 18:26     ` Peter Todd
2016-09-22 18:47       ` Tom
2016-09-21 12:00 ` Andreas Schildbach
2016-09-21 12:58   ` Tom [this message]
     [not found] ` <CAAS2fgSpnshZhS7N5R3Qsw_8=NN8sjYGwrnUpdwGzu2TG0-Qgw@mail.gmail.com>
2016-09-21 18:01   ` Gregory Maxwell
2016-09-22  8:56     ` Tom
2016-09-22 11:10       ` Christian Decker
2016-09-22 12:09         ` Tom
2016-09-23 11:42           ` Christian Decker
2016-09-23 13:17             ` Tom
2016-09-21 22:45 adiabat
2016-09-22  8:47 ` Tom
2016-09-22 18:27   ` Peter Todd
2016-09-22 18:37     ` Tom
2016-09-22 19:59       ` Jonas Schnelli
2016-09-22 20:07         ` Tom
2016-09-23 11:55       ` Christian Decker
2016-09-23 13:13         ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58983644.DvMMf90VdX@garp \
    --to=tomz@freedommail$(echo .)ch \
    --cc=andreas@schildbach$(echo .)de \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox