Overview
dCBOR is deterministic CBOR, a profile for CBOR as specified in RFC 8949. dCBOR itself is specified in an IETF Internet-Draft.
Why is dCBOR Important?
Determinism ensures that the same data is always encoded in the same way. It has strict rules for how data is represented and ensures that edge cases are always represented in the same way. For dCBOR, for example, this required the reduction of numbers to a canonical encoding: 10.00, 10.0, and 10 must be the same thing.
Determinism is important for a wide variety of applications that require data to remain consistent, usually across multiple platforms. This includes data signatures, reproducible software builds, hashing functions, version control, consensus algorithms, secure multi-party computation, and zero-knowledge proofs. It can also fulfill legal and compliance requirements.
dCBOR doesn’t automatically produce determnism, but it supports it, as does Gordian Envelope.
How Does dCBOR Work?
Though RFC 8949 includes some requirements for dCBOR, it leaves other options up to encoder developers. This results in dCBOR usage that is not necessarily consistent across multiple encoders. As a result, Blockchain Commons has produced an Internet-Draft of a dCBOR profile, which narrows the range of what can be considered valid dCBOR.
All dCBOR is decodable by generic CBOR encoders, and generic CBOR encoders can produce valid dCBOR, but not all CBOR is valid dCBOR.
We have also released libraries for dCBOR in Rust and Swift as well as a command line application for testing encoding and decoding that all follow the specifications laid out in this Draft.
dCBOR Videos
Why CBOR?
|
dCBOR Library from Blockchain Commons
|
Libraries
dCBOR Libraries
Language | Repo | Contributor | Status |
---|---|---|---|
Ruby | cbor-dcbor gem | @cabo | |
Rust | bc-dcbor-rust | Blockchain Commons | |
Swift | BCSwiftDCBOR | Blockchain Commons | |
TypeScript | bc-dcbor-ts | Blockchain Commons |
Links
Intro:
- Why CBOR? (blog article)
- dCBOR Goes to IETF (blog article)
Developer Resources:
- dCBOR IETF I-D (IETF)
- Editor’s Draft (Repo) (GitHub)
Developer Resource Apps:
- dcbor-cli Parser/Validator (GitHub)
dCBOR Discussions
- 8/23/23: Subnormal Floats and Determinism
- 8/23/23: I-D: draft-bormann-cbor-dcbor-03
- 8/19/23: CBOR profiling for protocol designers
- 8/19/23: A deterministic summary
- 8/16/23: dCBOR on cbor.me
- 8/15/23: Implementing float->int numeric reduction
- 8/8/23: New Version Notification for draft-mcnally
- 8/6/23: Announcement: draft-mcnally-deterministic-cbor-03
- 8/4/23: I-D: draft-mcnally-deterministic-cbor-02.txt
- 7/23/23: I-D Action: draft-bormann-cbor-dcbor-00.txt
- 7/20/23: The rationale behind dCBOR
- 7/18/23: FTZ (“flush to zero”) and/or DAZ (“denormals are zero”) floating point underflow strategies vs. Deterministic Encoding
- 7/17/23: Two drafts about CBOR Deterministic Encoding
- 6/30/23: cbor - Requested session has been scheduled for IETF 117
- 5/31/23: draft-mcnally-deterministic-cbor: rationale for not going with pre-encoded data
- 5/8/23: Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration
- 5/8/23: Proposal for Deterministic CBOR (dCBOR) discussion at May 17th meeting
- 3/12/23: dCBOR moving from numerically-typeless systems
- 3/10/23: Decoding numbers and compliance verification in dCBOR
- 3/10/23: New IETF Internet-Draft draft-mcnally-deterministic-cbor-00
- 3/5/23: Deterministic CBOR as a possible DISPATCH item
- 2/16/23: Fwd: New deterministic CBOR Libraries (Rust & Swift) from Blockchain Commons