MEP 4
Title Remove Google ProtoBuf Encoding From The Protocol
Status Accepted
Created 2014-11-18
Author Otto Allmendinger

Remove Google ProtoBuf Encoding From The Protocol

Abstract

In general, all messages sent between Client and Notary should be human-readable. This helps developers understand and debug message content, and is necessary in cases where messages or message content needs to be audited by third parties in case of a dispute.

The protocol should also be as simple as possible and use as few encoding schemes as necessary.

This MEP suggests the removal of the encoding defined by the Google ProtoBuf library in order to increase human readability and simplify the protocol.

Current status

Open-Transactions uses four different encodings:

Strictly speaking, the use of ProtoBuf is dependent on a compile-time flag that allows using another "packer" instead of ProtoBuf. This is not used in practice. Allowing for different packers would make the description of the protocol even more difficult.

(Side-note: The use of ASCII-Armoring for embedding plain-text data eliminates human readability and dramatically increases file size after compression. Due to the difficulty of changing that in the current code, it will be dealt with in a future MEP)

Drawbacks

The Google ProtoBuf library is a dependency for any component that wants to read or write messages or documents in Open-Transactions. Using the library requires the definitions of the particular data types that are encoded and decode. This makes reading and writing protocol messages significantly more complex.

ProtoBuf encodes data types into byte sequences, which are not human-readable and must be radix-encoded when embedded inside an XML document.

ProtoBuf in ASCII-Armoring

Here, Protocol Buffers are used to encode a byte sequence into another byte sequence. This is essentially a NOOP that serves no discernible purpose.

ProtoBuf for Structured Data

Only Section-Format and XML can be described as human-readable. In the case of binary data (hash values and signature data), radix encoding cannot be avoided and improve human readability, like base64 encoding of signatures and base58 encoding of hash values. In all other cases, radix encoding decreases human readability. By encoding structured data using ProtoBuf instead of XML, armoring must be used and human readability is lost.

Enhancement

The removal of the ProtoBuf from protocol simplifies the complexity of the protocol and improves human readability in some cases.

Remove ProtoBuf from ASCII-Armoring

This simplifies the decoding and encoding algorithms for "ASCII-Armored" data.

Replace ProtoBuf with XML for Structured Data

This increases human readability of protocol messages and simplifies encoding and decoding of document types.

Impact