<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.5 (Ruby 2.6.10) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-mcnally-deterministic-cbor-08" category="exp" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.1 -->
  <front>
    <title abbrev="dCBOR">dCBOR: A Deterministic CBOR Application Profile</title>
    <seriesInfo name="Internet-Draft" value="draft-mcnally-deterministic-cbor-08"/>
    <author initials="W." surname="McNally" fullname="Wolf McNally">
      <organization>Blockchain Commons</organization>
      <address>
        <email>wolf@wolfmcnally.com</email>
      </address>
    </author>
    <author initials="C." surname="Allen" fullname="Christopher Allen">
      <organization>Blockchain Commons</organization>
      <address>
        <email>christophera@lifewithalacrity.com</email>
      </address>
    </author>
    <author initials="C." surname="Bormann" fullname="Carsten Bormann">
      <organization>Universität Bremen TZI</organization>
      <address>
        <email>cabo@tzi.org</email>
      </address>
    </author>
    <date year="2024" month="March" day="31"/>
    <area>Applications and Real-Time</area>
    <workgroup>Network Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 76?>

<t>The purpose of determinism is to ensure that semantically equivalent data items are encoded into identical byte streams. CBOR (RFC 8949) defines "Deterministically Encoded CBOR" in its Section 4.2, but leaves some important choices up to the application developer. The CBOR Common Deterministic Encoding (CDE) Internet Draft builds on this by specifying a baseline for application profiles that wish to implement deterministic encoding with CBOR. The present document provides an application profile "dCBOR" that can be used to help achieve interoperable deterministic encoding based on CDE for a variety of applications wishing an even narrower and clearly defined set of choices.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/BlockchainCommons/WIPs-IETF-draft-deterministic-cbor"/>.</t>
    </note>
  </front>
  <middle>
    <?line 80?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>CBOR <xref target="RFC8949"/> has many advantages over other data serialization formats. One of its strengths is specifications and guidelines for serializing data deterministically, such that multiple agents serializing the same data automatically achieve consensus on the exact byte-level form of that serialized data. This is particularly useful when data must be compared for semantic equivalence by comparing the hash of its contents.</t>
      <t>Nonetheless, determinism is an opt-in feature of CBOR, and most existing CBOR codecs put the primary burden of correct deterministic serialization and validation of deterministic encoding during deserialization on the engineer. Furthermore, the specification leaves a number of important decisions around determinism up to the application developer. The CBOR Common Deterministic Encoding (CDE) Internet Draft <xref target="CDE"/> builds on the basic CBOR specification by providing a baseline for application profiles that wish to implement deterministic encoding with CBOR.</t>
      <t>This document narrows CDE further into a set of requirements for the application profile "dCBOR". These requirements include but go beyond CDE, including requiring that dCBOR decoders validate that encoded CDE conforms to the requirements of this document.</t>
      <section anchor="conventions-and-definitions">
        <name>Conventions and Definitions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
        <?line -18?>

</section>
    </section>
    <section anchor="application-profile">
      <name>Application Profile</name>
      <t>The dCBOR Application Profile specifies the use of Deterministic Encoding as defined in <xref target="CDE"/> and adds several exclusions and reductions specified in this section.</t>
      <t>Just as CDE does not "fork" CBOR, the rules specified here do not "fork" CDE: A dCBOR implementation produces well-formed, deterministically encoded CDE according to <xref target="CDE"/>, and existing CBOR or CDE decoders will therefore be able to decode it. Similarly, CBOR or CDE encoders will be able to produce valid dCBOR if handed dCBOR conforming data model level information from an application.</t>
      <t>Note that the separation between standard CBOR or CDE processing and the processing required by the dCBOR application profile is a conceptual one: Both dCBOR processing and standard CDE/CBOR processing may be combined into a unified dCBOR/CDE/CBOR codec. The requirements in this document apply to encoding or decoding of dCBOR data, regardless of whether the codec is a unified dCBOR/CDE/CBOR codec operating in dCBOR-compliant modes, or a single-purpose dCBOR codec. Both of these are generically referred to as "dCBOR codecs" in this document.</t>
      <t>This application profile is intended to be used in conjunction with an application, which typically will use a subset of CDE/CBOR, which in turn influences which subset of the application profile is used. As a result, this application profile places no direct requirement on what subset of CDE/CBOR is implemented. For instance, there is no requirement that dCBOR implementations support floating point numbers (or any other kind of non-basic integer type, such as arbitrary precision integers or complex numbers) when they are used with applications that do not use them. However, this document does place requirements on dCBOR implementations that support negative 64-bit integers and 64-bit or smaller floating point numbers.</t>
      <section anchor="common-deterministic-encoding-conformance">
        <name>Common Deterministic Encoding Conformance</name>
        <t>dCBOR encoders:</t>
        <ol spacing="normal" type="1"><li>
            <bcp14>MUST</bcp14> only emit CBOR conforming "CBOR Common Deterministic Encoding (CDE)" <xref target="CDE"/>, including mandated preferred encoding of integers and floating point numbers and the lexicographic ordering of map keys.</li>
        </ol>
        <t>dCBOR decoders:</t>
        <ol spacing="normal" type="1" start="2"><li>
            <bcp14>MUST</bcp14> validate that encoded CBOR conforms to the requirements of <xref target="CDE"/>.</li>
        </ol>
      </section>
      <section anchor="duplicate-map-keys">
        <name>Duplicate Map Keys</name>
        <t>CBOR <xref target="RFC8949"/> defines maps with duplicate keys as invalid, but leaves how to handle such cases to the implementor (§2.2, §3.1, §5.4, §5.6). <xref target="CDE"/> provides no additional mandates on this issue.</t>
        <t>dCBOR encoders:</t>
        <ol spacing="normal" type="1"><li>
            <bcp14>MUST NOT</bcp14> emit CBOR maps that contain duplicate keys.</li>
        </ol>
        <t>dCBOR decoders:</t>
        <ol spacing="normal" type="1" start="2"><li>
            <bcp14>MUST</bcp14> reject encoded maps with duplicate keys.</li>
        </ol>
      </section>
      <section anchor="bit-negative-integers">
        <name>"65-bit" Negative Integers</name>
        <t>dCBOR limits the range of integers to those that can be contained in common 64-bit programming language integer types, either as a signed (<tt>int64</tt> or <tt>i64</tt>) or unsigned (<tt>uint64</tt> or <tt>u64</tt>) integer.
In other words, integer values in the range <tt>DCBOR_INT</tt> = [-2<sup>63</sup>, 2<sup>64</sup>-1] are valid.</t>
        <t>CBOR integers in the basic generic data model have an argument of up to 64 bits; whether the value is interpreted as non-negative or negative then depends on the additional bit provided by whether it is encoded as a major type 0 or 1 value.</t>
        <t>Many programming languages offer a separate type that covers the entire range of major type 0 (such as <tt>uint64</tt> or <tt>u64</tt>), but do not offer a type that provides the full range of negative integers that can be encoded in CBOR major type 1.
(If a two's-complement signed type were to be used to cover both ranges in full, it would need to have at least 65 bits.)
We therefore use the name <tt>NEG_65</tt> for the range of negative numbers that can be encoded in major type 1, but do not fit into <tt>int64</tt>, i.e., [-2<sup>64</sup>, -2<sup>63</sup> - 1].
Integer values in this range are invalid in dCBOR.</t>
        <t>dCBOR encoders:</t>
        <ol spacing="normal" type="1"><li>
            <bcp14>MUST NOT</bcp14> encode CBOR integer values in the range <tt>NEG_65</tt>.</li>
        </ol>
        <t>dCBOR decoders:</t>
        <ol spacing="normal" type="1" start="2"><li>
            <bcp14>MUST</bcp14> reject CBOR integer values in the range <tt>NEG_65</tt>.</li>
        </ol>
        <t>(As always with CBOR, whether the value is interpreted as non-negative or negative depends on whether it is encoded as a major type 0 or 1 value.)</t>
        <t>Specific applications will, of course, further restrict ranges of integers that are considered valid for the application, based on their position and semantics in the CBOR data item.</t>
      </section>
      <section anchor="numeric-reduction">
        <name>Numeric Reduction</name>
        <t>The purpose of determinism is to ensure that semantically equivalent data items are encoded into identical byte streams. Numeric reduction ensures that semantically equal numeric values (e.g. <tt>2</tt> and <tt>2.0</tt>) are encoded into identical byte streams (e.g. <tt>0x02</tt>) by encoding "Integral floating point values" (floating point values with a zero fractional part) as integers when possible.</t>
        <t>dCBOR implementations that support floating point numbers:</t>
        <ol spacing="normal" type="1"><li>
            <t><bcp14>MUST</bcp14> check whether floating point values to be encoded have the numerically equal value in <tt>DCBOR_INT</tt> as defined above. If that is the case, it <bcp14>MUST</bcp14> be converted to that numerically equal integer value before encoding it. (Preferred encoding will then ensure the shortest length encoding is used.) If a floating point value has a non-zero fractional part, or an exponent that takes it out of <tt>DCBOR_INT</tt>, the original floating point value is used for encoding. (Specifically, conversion to a CBOR bignum is never considered.)  </t>
            <t>
This also means that the three representations of a zero number in CBOR (<tt>0</tt>, <tt>0.0</tt>, <tt>-0.0</tt> in diagnostic notation) are all reduced to the basic integer <tt>0</tt> (with preferred encoding <tt>0x00</tt>).</t>
          </li>
        </ol>
        <aside>
          <t>Note that numeric reduction means that some maps that are valid CDE/CBOR cannot be reduced to valid dCBOR maps, as numeric reduction can result in multiple entries with the same keys ("duplicate keys"). For example, the following is a valid CBOR/CDE map:</t>
          <figure>
            <name>Valid CBOR data item with numeric map keys (also valid CDE)</name>
            <sourcecode type="cbor-diag"><![CDATA[
{
   10: "ten",
   10.0: "floating ten"
}
]]></sourcecode>
          </figure>
          <t>Applying numeric reduction to this map would yield the invalid map:</t>
          <figure>
            <name>Numeric reduction turns valid CBOR invalid</name>
            <sourcecode type="cbor-diag"><![CDATA[
{  / invalid: multiple entries with the same key /
   10: "ten",
   10: "floating ten"
}
]]></sourcecode>
          </figure>
          <t>In general, dCBOR applications need to avoid maps that have entries with keys that are semantically equivalent in dCBOR's numeric model.</t>
        </aside>
        <ol spacing="normal" type="1" start="2"><li>
            <bcp14>MUST</bcp14> reduce all encoded NaN values to the quiet NaN value having the half-width CBOR representation <tt>0xf97e00</tt>.</li>
        </ol>
        <t>dCBOR decoders that support floating point numbers:</t>
        <ol spacing="normal" type="1" start="3"><li>
            <bcp14>MUST</bcp14> reject any encoded floating point values that are not encoded according to the above rules.</li>
        </ol>
      </section>
      <section anchor="simple-values">
        <name>Simple Values</name>
        <t>Only the three "simple" (major type 7) values <tt>false</tt> (0xf4), <tt>true</tt> (0xf5), and <tt>null</tt> (0xf6) and the floating point values are valid in dCBOR.</t>
        <t>dCBOR encoders:</t>
        <ol spacing="normal" type="1"><li>
            <bcp14>MUST NOT</bcp14> encode major type 7 values other than <tt>false</tt>, <tt>true</tt>, <tt>null</tt>, and the floating point values.</li>
        </ol>
        <t>dCBOR decoders:</t>
        <ol spacing="normal" type="1" start="2"><li>
            <bcp14>MUST</bcp14> reject any encoded major type 7 values other than <tt>false</tt>, <tt>true</tt>, <tt>null</tt>, and the floating point values.</li>
        </ol>
      </section>
    </section>
    <section anchor="cddl-support">
      <name>CDDL support</name>
      <t>Similar to the CDDL <xref target="RFC8610"/> support in CDE <xref target="CDE"/>, this specification adds two CDDL control operators that can be used to specify that the data items should be encoded in CBOR Common Deterministic Encoding (CDE), with the dCBOR application profile applied as well.</t>
      <t>The control operators <tt>.dcbor</tt> and <tt>.dcborseq</tt> are exactly like <tt>.cde</tt> and <tt>.cdeseq</tt> except that they also require the encoded data item(s) to conform to the dCBOR application profile.</t>
      <t>For example, the normative comment in Section 3 of <xref target="GordianEnvelope"/>:</t>
      <sourcecode type="cddl"><![CDATA[
leaf = #6.24(bytes)  ; MUST be dCBOR
]]></sourcecode>
      <t>...can now be formalized as:</t>
      <sourcecode type="cddl"><![CDATA[
leaf = #6.24(bytes .dcbor any)
]]></sourcecode>
    </section>
    <section removeInRFC="true" anchor="implementation-status">
      <name>Implementation Status</name>
      <t>(Boilerplate as per <xref section="2.1" sectionFormat="of" target="RFC7942"/>:)</t>
      <t>This section records the status of known implementations of the
protocol defined by this specification at the time of posting of
this Internet-Draft, and is based on a proposal described in
<xref target="RFC7942"/>.  The description of implementations in this section is
intended to assist the IETF in its decision processes in
progressing drafts to RFCs.  Please note that the listing of any
individual implementation here does not imply endorsement by the
IETF.  Furthermore, no effort has been spent to verify the
information presented here that was supplied by IETF contributors.
This is not intended as, and must not be construed to be, a
catalog of available implementations or their features.  Readers
are advised to note that other implementations may exist.</t>
      <t>According to <xref target="RFC7942"/>, "this will allow reviewers and working
groups to assign due consideration to documents that have the
benefit of running code, which may serve as evidence of valuable
experimentation and feedback that have made the implemented
protocols more mature.  It is up to the individual working groups
to use this information as they see fit".
<?line -22?>
      </t>
      <section anchor="swift">
        <name>Swift</name>
        <ul spacing="normal">
          <li>Description: Single-purpose dCBOR reference implementation for Swift.</li>
          <li>Organization: Blockchain Commons</li>
          <li>Implementation Location: <xref target="BCSwiftDCBOR"/></li>
          <li>Primary Maintainer: Wolf McNally</li>
          <li>Languages: Swift</li>
          <li>Coverage: Complete</li>
          <li>Testing: Unit tests</li>
          <li>Licensing: BSD-2-Clause-Patent</li>
        </ul>
      </section>
      <section anchor="rust">
        <name>Rust</name>
        <ul spacing="normal">
          <li>Description: Single-purpose dCBOR reference implementation for Rust.</li>
          <li>Organization: Blockchain Commons</li>
          <li>Implementation Location: <xref target="BCRustDCBOR"/></li>
          <li>Primary Maintainer: Wolf McNally</li>
          <li>Languages: Rust</li>
          <li>Coverage: Complete</li>
          <li>Testing: Unit tests</li>
          <li>Licensing: BSD-2-Clause-Patent</li>
        </ul>
      </section>
      <section anchor="typescript">
        <name>TypeScript</name>
        <ul spacing="normal">
          <li>Description: Single-purpose dCBOR reference implementation for TypeScript.</li>
          <li>Organization: Blockchain Commons</li>
          <li>Implementation Location: <xref target="BCTypescriptDCBOR"/></li>
          <li>Primary Maintainer: Wolf McNally</li>
          <li>Languages: TypeScript (transpiles to JavaScript)</li>
          <li>Coverage: Complete</li>
          <li>Testing: Unit tests</li>
          <li>Licensing: BSD-2-Clause-Patent</li>
        </ul>
      </section>
      <section anchor="ruby">
        <name>Ruby</name>
        <ul spacing="normal">
          <li>Implementation Location: <xref target="cbor-dcbor"/></li>
          <li>Primary Maintainer: Carsten Bormann</li>
          <li>Languages: Ruby</li>
          <li>Coverage: Complete specification; complemented by CBOR encoder/decoder and command line interface from <xref target="cbor-diag"/> and deterministic encoding from <xref target="cbor-deterministic"/>. Checking of dCBOR - exclusions not yet implemented.</li>
          <li>Testing: Also available at https://cbor.me</li>
          <li>Licensing: Apache-2.0</li>
        </ul>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document inherits the security considerations of CBOR <xref target="RFC8949"/>.</t>
      <t>Vulnerabilities regarding dCBOR will revolve around whether an attacker can find value in producing semantically equivalent documents that are nonetheless serialized into non-identical byte streams. Such documents could be used to contain malicious payloads or exfiltrate sensitive data. The ability to create such documents could indicate the failure of a dCBOR decoder to correctly validate according to this document, or the failure of the developer to properly specify or implement application protocol requirements using dCBOR. Whether these possibilities present an identifiable attack surface is a question that developers should consider.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>RFC Editor: please replace RFCXXXX with the RFC number of this RFC and remove this note.</t>
      <t>This document requests IANA to register the following CBOR tag in the "CBOR Tags" registry of <xref target="IANACBORTAGS"/>:</t>
      <table>
        <name>CBOR Tag for dCBOR</name>
        <thead>
          <tr>
            <th align="left">Tag</th>
            <th align="left">Data Item</th>
            <th align="left">Semantics</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">#201</td>
            <td align="left">(any)</td>
            <td align="left">enclosed dCBOR</td>
            <td align="left">[RFCXXXX]</td>
          </tr>
        </tbody>
      </table>
      <t>This document requests IANA to register the contents of Table 1 into the registry "CDDL Control Operators" of <xref target="IANACDDL"/>:</t>
      <table>
        <name>CDDL Control Operators for dCBOR</name>
        <thead>
          <tr>
            <th align="left">Name</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">.dcbor</td>
            <td align="left">[RFCXXXX]</td>
          </tr>
          <tr>
            <td align="left">.dcborseq</td>
            <td align="left">[RFCXXXX]</td>
          </tr>
        </tbody>
      </table>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
            <date month="December" year="2020"/>
            <abstract>
              <t>The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation. These design goals make it different from earlier binary serializations such as ASN.1 and MessagePack.</t>
              <t>This document obsoletes RFC 7049, providing editorial improvements, new details, and errata fixes while keeping full compatibility with the interchange format of RFC 7049. It does not create a new version of the format.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
          <seriesInfo name="DOI" value="10.17487/RFC8949"/>
        </reference>
        <reference anchor="RFC8610">
          <front>
            <title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
            <author fullname="H. Birkholz" initials="H." surname="Birkholz"/>
            <author fullname="C. Vigano" initials="C." surname="Vigano"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2019"/>
            <abstract>
              <t>This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049). Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8610"/>
          <seriesInfo name="DOI" value="10.17487/RFC8610"/>
        </reference>
        <reference anchor="CDE">
          <front>
            <title>CBOR Common Deterministic Encoding (CDE)</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="3" month="March" year="2024"/>
            <abstract>
              <t>   CBOR (STD 94, RFC 8949) defines "Deterministically Encoded CBOR" in
   its Section 4.2, providing some flexibility for application specific
   decisions.  To facilitate Deterministic Encoding to be offered as a
   selectable feature of generic encoders, the present document defines
   a CBOR Common Deterministic Encoding (CDE) Profile that can be shared
   by a large set of applications with potentially diverging detailed
   requirements.

   This document also introduces the concept of Application Profiles,
   which are layered on top of the CBOR CDE Profile and can address more
   application specific requirements.  Application Profiles are defined
   in separate documents.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-cbor-cde-02"/>
        </reference>
        <reference anchor="IANACDDL" target="http://www.iana.org/assignments/cddl">
          <front>
            <title>Concise Data Definition Language (CDDL)</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
        <reference anchor="IANACBORTAGS" target="http://www.iana.org/assignments/cbor-tags">
          <front>
            <title>Concise Binary Object Representation (CBOR) Tags</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="BCSwiftDCBOR" target="https://github.com/BlockchainCommons/BCSwiftDCBOR">
          <front>
            <title>Deterministic CBOR (dCBOR) for Swift.</title>
            <author initials="W." surname="McNally" fullname="Wolf McNally">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="BCRustDCBOR" target="https://github.com/BlockchainCommons/bc-dcbor-rust">
          <front>
            <title>Deterministic CBOR (dCBOR) for Rust.</title>
            <author initials="W." surname="McNally" fullname="Wolf McNally">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="BCTypescriptDCBOR" target="https://github.com/BlockchainCommons/bc-dcbor-ts">
          <front>
            <title>Deterministic CBOR (dCBOR) for Typescript.</title>
            <author initials="W." surname="McNally" fullname="Wolf McNally">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="GordianEnvelope">
          <front>
            <title>The Gordian Envelope Structured Data Format</title>
            <author fullname="Wolf McNally" initials="W." surname="McNally">
              <organization>Blockchain Commons</organization>
            </author>
            <author fullname="Christopher Allen" initials="C." surname="Allen">
              <organization>Blockchain Commons</organization>
            </author>
            <date day="18" month="February" year="2024"/>
            <abstract>
              <t>   Gordian Envelope specifies a structured format for hierarchical
   binary data focused on the ability to transmit it in a privacy-
   focused way, offering support for privacy as described in RFC 6973
   and human rights as described in RFC 8280.  Envelopes are designed to
   facilitate "smart documents" and have a number of unique features
   including: easy representation of a variety of semantic structures, a
   built-in Merkle-like digest tree, deterministic representation using
   CBOR, and the ability for the holder of a document to selectively
   elide specific parts of a document without invalidating the digest
   tree structure.  This document specifies the base Envelope format,
   which is designed to be extensible.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-mcnally-envelope-06"/>
        </reference>
        <reference anchor="cbor-deterministic" target="https://github.com/cabo/cbor-deterministic">
          <front>
            <title>cbor-deterministic gem</title>
            <author initials="C." surname="Bormann" fullname="Carsten Bormann">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="cbor-diag" target="https://github.com/cabo/cbor-diag">
          <front>
            <title>CBOR diagnostic utilities</title>
            <author initials="C." surname="Bormann" fullname="Carsten Bormann">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="cbor-dcbor" target="https://github.com/cabo/cbor-dcbor">
          <front>
            <title>PoC of the McNally/Allen dCBOR application-level CBOR representation rules</title>
            <author initials="C." surname="Bormann" fullname="Carsten Bormann">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="RFC7942">
          <front>
            <title>Improving Awareness of Running Code: The Implementation Status Section</title>
            <author fullname="Y. Sheffer" initials="Y." surname="Sheffer"/>
            <author fullname="A. Farrel" initials="A." surname="Farrel"/>
            <date month="July" year="2016"/>
            <abstract>
              <t>This document describes a simple process that allows authors of Internet-Drafts to record the status of known implementations by including an Implementation Status section. This will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature.</t>
              <t>This process is not mandatory. Authors of Internet-Drafts are encouraged to consider using the process for their documents, and working groups are invited to think about applying the process to all of their protocol specifications. This document obsoletes RFC 6982, advancing it to a Best Current Practice.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="205"/>
          <seriesInfo name="RFC" value="7942"/>
          <seriesInfo name="DOI" value="10.17487/RFC7942"/>
        </reference>
      </references>
    </references>
    <?line 337?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>The authors are grateful for the contributions of Joe Hildebrand, Laurence Lundblade, and Anders Rundgren in the CBOR working group.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAO0mCmYAA8Vb63bbRpL+j6fopX+MNIeELlaUmLnKkpwoa8teS0l21vEZ
NYEm2TEIMLhIZmTlWfbHnjPvkXmx+aqqGxdePHbGmdU5NkkA3V33+qq6MRgM
guuhuh8EpS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