DRISL — Deterministic Representation for Interoperable Structures & Links
date | 2025-06-25 |
---|---|
editors | Robin Berjon <robin@berjon.com> Juan Caballero <bumblefudge@learningproof.xyz> |
issues | list, new |
abstract | DRISL is a serialization format that is deterministic (so that the same data will have the same CID) and that features native support for using CIDs as links. It is based on CBOR, using a narrow profile of CBOR's "Core" featureset called "[cborc-42]", specified formally in this IETF document. |
Introduction
Deterministic encodings that produce the same stream of bytes for any given data with the same semantics are particularly useful in a content-addressed context. DRISL provides that, compactly encoded as CBOR. Additionally, it supports CBOR's Tag 42 to compactly encode CIDs ([cid]) as bytestreams. This CID can be used for content-addressed linking between DRISL documents (such as MASL documents), or to resources (best wrapped in MASL documents where renderability as web documents or web apps is desired).
DRISL does not fork CBOR, CDE, or dCBOR ([cbor], [cde], [dcbor]), but it is a subset of features defined in CBOR "Core" ([cborc]), first defined in the earliest CBOR RFC and largely unaffected by refinements made since. Any decoder for any version of CBOR since v1 will be able to read DRISL content as conformant CBOR, and with enough carefully configuration of a powerful CBOR library and in some case pre-processing of the data, DRISL can be encoded anywhere CBOR can.
Format
DRISL is an application profile of CBOR ([cbor]) that subsets the more established [cborc] profile, with the following additional constraints:
- Implementations MUST support Tag 42 in the CBOR Tag registry; this tag compactly encodes CIDs as bytestrings, as specified below.
- Implementations MUST reject all other tags, including any of the tags listed in the section 3.4 of RFC 8949.
- Implementations MUST reject map keys that are not strings.
- Floating-point numbers MUST always be encoded using the longest variant; completely avoiding floating-point numbers is RECOMMENDED to minimize interoperability and tooling issues.
All other requirements are as CBOR/c ([cborc]).
CIDs in CBOR
Content-identifiers used in DASL are actually LEB128 binary numbers, canonically, which is a detail one can easily forget since in code and, e.g., in JSON APIs, CIDs are conventionally represented as base-32 ASCII strings. But in CBOR contexts, simply affixing one extra 0x00
bit in front of the same LEB128 bytestring that would get base-32-encoded to ASCII turns that bytestring into a valid value for tag 42, CBOR's bespoke minor type for binary CIDs.
For more information, see the [cbor-tag42] appendix to the [drisl] specification.
Debugging Considerations
It is often convenient to represent DRISL in textual formats for debugging purposes, for example using JSON.
One common convention for doing so is historically referred to as "DAG-JSON," which is a JSON expression
of the DRISL data in which CIDs are represented as the object
{ "/": "string CID" }
, i.e., DASL CIDs in their base-32 ASCII representation ([cid]), NOT in their CBOR representation ([cbor-tag42])). Another option is
CBOR
Extended Diagnostic Notation.
In any case, note that the CIDs used in such debugging outputs that may point to other parts of the debugging output should be the CIDs of the DRISL content, not of the debugging resources.
References
- [cbor]
- C. Bormann. & P. Hoffman. Concise Binary Object Representation (CBOR). October 2024. URL: https://www.rfc-editor.org/info/rfc8949
- [cbor-tag42]
- J. Caballero. Binary Content Identifiers. May 2025. URL: https://www.ietf.org/archive/id/draft-caballero-cbor-cborc42-00.html#name-binary-content-identifiers
- [cborc]
- A. Rundgren. Core CBOR Platform Profile. April 2025. URL: https://datatracker.ietf.org/doc/draft-rundgren-cbor-core/
- [cborc-42]
- J. Caballero, R. Berjon. The tag-42 profile of CBOR Core. May 2025. URL: https://datatracker.ietf.org/doc/draft-caballero-cbor-cborc42/
- [cde]
- C. Bormann. CBOR Common Deterministic Encoding (CDE). October 2024. URL: https://datatracker.ietf.org/doc/html/draft-ietf-cbor-cde-06
- [cid]
- Robin Berjon & Juan Caballero. Content IDs (CIDs). 2025-06-25. URL: https://dasl.ing/cid.html
- [dcbor]
- W. McNally, C. Allen, C. Bormann, & L. Lundblade. dCBOR: A Deterministic CBOR Application Profile. October 2024. URL: https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/
- [drisl]
- Robin Berjon & Juan Caballero. DRISL — Deterministic Representation for Interoperable Structures & Links. 2025-06-25. URL: https://dasl.ing/drisl.html