What is Nostr?
Tom [ARCHIVE] /
npub1h39ā€¦z4k5
2023-06-07 17:53:27
in reply to nevent1qā€¦57x8

Tom [ARCHIVE] on Nostr: šŸ“… Original date posted:2016-09-21 šŸ“ Original message:On Wednesday 21 Sep 2016 ...

šŸ“… Original date posted:2016-09-21
šŸ“ Original message: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.
Author Public Key
npub1h394c0pkdum0jw4rufslt3ur9m9c2ym4x7a0t68spfpjr6zlq3msu8z4k5