Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 937 Bytes

bcr-2023-008-dcbor-date.md

File metadata and controls

28 lines (17 loc) · 937 Bytes

dCBOR: Preferred Encoding of Dates

BCR-2023-008

© 2023 Blockchain Commons

Authors: Wolf McNally, Christopher Allen
Date: Sep 2, 2022
Revised: Sep 4, 2023

Abstract

This document defines a preferred format for dates in Gordian Deterministic CBOR (dCBOR).

Format Specification

CBOR already has a well-defined date format using the tag #6.1 defined in RFC 8949 §3.4.2 Epoch-Based Date Type.

This document specifies this method, which MUST include its tag-based type declaration, as the preferred format to specify dates when using Gordian dCBOR.

RFC 8949 says the tagged value may be either an integer or a float, but dCBOR's numeric reduction rules apply and MUST be used to determine the encoded numeric type.

CDDL

tagged-date = #6.1(date)
date = int / float