Skip to content

Latest commit

 

History

History

README.md

Blockchain Commons Deterministic CBOR ("dCBOR") for TypeScript

Disclaimer: This package is under active development and APIs may change.

dcbor is a CBOR codec that focuses on writing and parsing "deterministic" CBOR per §4.2 of RFC-8949. It does not support parts of the spec forbidden by deterministic CBOR (such as indefinite length arrays and maps). It is strict in both what it writes and reads: in particular it will return decoding errors if variable-length integers are not encoded in their minimal form, or CBOR map keys are not in lexicographic order, or there is extra data past the end of the decoded CBOR item.

Note: This package is now a compatibility layer over @blockchaincommons/dcbor, the canonical dCBOR implementation for TypeScript. The @bcts/dcbor API is unchanged, but all wire-format logic (encoding, decoding, canonical map ordering, diagnostics, traversal) is delegated to the canonical package. New code should consider depending on @blockchaincommons/dcbor directly; see its migration guide.

Specification

The current specification of the norms and practices guiding the creation of this implementation are currently found in this IETF Internet Draft: draft-mcnally-deterministic-cbor.

Rust Reference Implementation

This TypeScript implementation is based on bc-dcbor-rust v0.25.2 (commit).