Re: The "CBOR Everywhere" Project

On Wed, Dec 14, 2022 at 8:20 PM Anders Rundgren <
anders.rundgren.net@gmail.com> wrote:

> For me it is obvious that developers of new designs should seriously
> consider CBOR as an alternative to JSON and XML:
>
> https://github.com/cyberphone/cbor-everywhere


Here is my own list of answers for "Why CBOR?":

Why CBOR?

The Concise Binary Object Representation, or CBOR, was chosen as the
foundational data structure for Gordian specifications such as Envelope and
URs for a variety of reasons. These include:

* IETF Standardization. CBOR is a mature open international IETF standard.
* IANA Registration. CBOR is further standardized by the registration of
common data types through IANA.
* Fully Extensible. Beyond that, CBOR is entirely extensible with any data
types desired, such as our own listing of UR tags.
* Self-describing Descriptions. Data is self-describing, so there are no
requirements for pre-defined schemas nor more complex descriptions such as
those found in ASN.1.
* Streaming Friendly. CBOR works well with streaming without requirements
for extra memory; its tagging system allows for data to be skipped if it is
irrelevent or unknown.
* Constraint Friendly. CBOR is built to be frugal with CPU and memory, so
it works well in constrained environments such as on cryptographic silicon
chips.
* Unambiguous Encoding. Our use of Deterministic CBOR, combined with our
own specification rules, such as the sorting of Envelopes by hash, results
in a singular, unambiguous encoding.
* Multiple Implementations. Implementation are available in a variety of
languages.
Compact Implementations. Compactness of encoding and decoding is one of
CBOR's core goals; implementations are built on headers or snippets of
code, and do not require any external tools.

See also:
* a comparison to protobuffers:
https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md#qa
* a comparison to Flatbuffers
https://stackoverflow.com/questions/47799396/flatbuffers-vs-cbor)
* a comparison to other binary formats
https://www.rfc-editor.org/rfc/rfc8949#name-comparison-of-other-binary-

-- Christopher Allen

Received on Thursday, 15 December 2022 09:06:08 UTC