Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (26 loc) · 1.3 KB

dag-cbor.md

File metadata and controls

41 lines (26 loc) · 1.3 KB

Specification: DagCBOR

Status: Descriptive - Draft

DagCBOR supports the full IPLD Data Model.

CBOR already natively supports all IPLD Data Model Kinds.

Format

The CBOR IPLD format is called DagCBOR to disambiguate it from regular CBOR. Most CBOR objects are valid DagCBOR. The only hard restriction is that any field with the tag 42 must be a valid CID.

Link Format

As with all IPLD formats, DagCBOR must be able to encode Links. In DagCBOR, links are CIDs encoded using the raw-binary identity Multibase. That Multibase prefix (0x00) must not be omitted. They are stored as byte-string type (major type 2), with the tag 42.

(the inclusion of the Multibase exists for historical reasons)

Map Key Restriction

In DagCBOR, map keys must be strings.

Canonical DagCBOR

Canonical DagCBOR must:

  1. Use no tags other than the CID tag (42). Other tags may be lost in conversion.
  2. Use the canonical CBOR encoding.