@smallcircles @mauve @silverpill Good points.

The rational for choosing Borsh is that we want a simple, binary serialization that has only one canonical byte representation for any given data.

This "one canonical representation" feature ensures that two components/schemas/etc. with the same data will get exactly the same hash, maximizing deduplication for data across the network.

I really like how simple Borsh is, but I should verify that CBOR doesn't already do what we need, too. 👍️

Follow

@zicklag @smallcircles @silverpill If you want stability in serialization you may be interested at looking at IPLD and soecifically the dag-cbor codec.

@mauve @smallcircles @silverpill So it looks like CBOR by itself doesn't have the canonical propery we need. DAG-CBOR adds that canonical property, along with the concept of CID links.

In our case we don't use CIDs, so we can't directly use either CBOR or DAG-CBOR without either adding our own specification/modifications on top or having extra stuff that we don't need.

So it seems like Borsh is still the simplest option.

@mauve @smallcircles @silverpill After thinking more about it I realized that CBOR isn't really an option anyway because we specifically want a non-self-describing format.

This allows the description of the data to be stored separately in immutable Schemas, that Components reference by hash.

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.