Skip to main content

Canonical Encoding

p2panda requires a canonical encoding format to guarantee that hashing a value produces the same result across all implementations.

CBOR

🌩️Requirement EN1

All CBOR values need to be encoded in canonical format and "strict mode" as per CBOR specification.

Operations

🌩️Requirement EN2

All array values and map keys whose order is not semantic MUST be encoded in lexicographically sorted order and can not contain any duplicates.

Arrays without semantic meaning are:

  • any document view id
    • including those in a schema id or pinned_relation
  • previous array in an operation