<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.35 (Ruby 2.5.1) -->
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-birkholz-cose-cometre-ccf-profile-01" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 2.46.0 -->
  <front>
    <title abbrev="CoMTRE CFF Ledger">A Transaction Ledger Verifiable Structure for COSE Merkle Tree Proofs</title>
    <seriesInfo name="Internet-Draft" value="draft-birkholz-cose-cometre-ccf-profile-01"/>
    <author initials="H." surname="Birkholz" fullname="Henk Birkholz">
      <organization abbrev="Fraunhofer SIT">Fraunhofer SIT</organization>
      <address>
        <postal>
          <street>Rheinstrasse 75</street>
          <city>Darmstadt</city>
          <code>64295</code>
          <country>Germany</country>
        </postal>
        <email>henk.birkholz@sit.fraunhofer.de</email>
      </address>
    </author>
    <author initials="A." surname="Delignat-Lavaud" fullname="Antoine Delignat-Lavaud">
      <organization>Microsoft Research</organization>
      <address>
        <postal>
          <street>21 Station Road</street>
          <city>Cambridge</city>
          <code>CB1 2FB</code>
          <country>UK</country>
        </postal>
        <email>antdl@microsoft.com</email>
      </address>
    </author>
    <author initials="C." surname="Fournet" fullname="Cedric Fournet">
      <organization>Microsoft Research</organization>
      <address>
        <postal>
          <street>21 Station Road</street>
          <city>Cambridge</city>
          <code>CB1 2FB</code>
          <country>UK</country>
        </postal>
        <email>fournet@microsoft.com</email>
      </address>
    </author>
    <date year="2024" month="January" day="12"/>
    <area>Security</area>
    <workgroup>TBD</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 46?>

<t>This document defines a new verifiable data structure type for COSE Signed Merkle Tree Proofs specifically designed for transaction ledgers produced by Trusted Execution Environments (TEEs) to provide stronger tamper-evidence guarantees.</t>
    </abstract>
  </front>
  <middle>
    <?line 50?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The Concise Encoding of Signed Merkle Tree Proofs (CoMeTre) <xref target="I-D.ietf-cose-merkle-tree-proofs"/> defines a common framework for defining different types of proofs about verifiable data structures (also abbreviated as "logs" in this document). For instance, inclusion proofs guarantee to a verifier that a given serializable element is recorded at a given state of the log, while consistency proofs are used to establish that an inclusion proof is still consistent with the new state of the log at a later time.</t>
      <t>In this document, we define a new type of log, associated with the Confidential Consortium Framework (CCF) ledger. This log carries indexed transaction information in a binary Merkle Tree, where new transactions are appended to the right, so that the binary decomposition of the index of a transaction can be interpreted as the position in the tree if 0 represents the left branch and 1 the right branch.  Compared to <xref target="RFC9162"/>, the leaves of CCF trees carry additional opaque information that is used to verify that elements are only written by the Trusted Execution Environment, which addresses the persistence of committed transactions that happen between new signatures of the Merkle Tree root.</t>
      <section anchor="requirements-notation">
        <name>Requirements Notation</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&nbsp;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="format-of-ccf-ledger">
      <name>Format of CCF Ledger</name>
      <t>This documents extends the verifiable data structure registry of <xref target="I-D.ietf-cose-merkle-tree-proofs"/> with the following value:</t>
      <table align="left" anchor="verifiable-data-structure-values">
        <name>Verifiable Data Structure Algorithms</name>
        <thead>
          <tr>
            <th align="left">Name</th>
            <th align="left">Value</th>
            <th align="left">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">CCF_LEDGER_SHA256</td>
            <td align="left">TBD_1 (requested assignment 2)</td>
            <td align="left">Historical transaction ledgers, such as the CCF ledger</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>
      <t>This document defines inclusion proofs and consistency proof formats for CCF ledgers. Verifiers <bcp14>MUST</bcp14> reject all other proof types.</t>
      <section anchor="merkle-tree-shape">
        <name>Merkle Tree Shape</name>
        <t>A CCF ledger is a binary Merkle Tree constructed from a hash function H, which is defined from the log type. For instance, the hash function for <tt>CCF_LEDGER_SHA256</tt> is <tt>SHA256</tt>, whose <tt>HASH_SIZE</tt> is 32 bytes.
The Merkle tree encodes an ordered list of <tt>n</tt> transactions T_n = {T[0], T[1], ..., T[n-1]}. We define the Merkle Tree Hash (MTH) function, which takes as input a list of serialized transactions (as byte strings), and outputs a single HASH_SIZE byte string called the Merkle root hash, by induction on the list:</t>
        <t>The hash of an empty list is the hash of an empty string:</t>
        <artwork><![CDATA[
MTH({}) = HASH().
]]></artwork>
        <t>The hash of a list with one entry (also known as a leaf hash) is:</t>
        <artwork><![CDATA[
MTH({d[0]}) = HASH(d[0]).
]]></artwork>
        <t>For n &gt; 1, let k be the largest power of two smaller than n (i.e., k &lt; n &lt;= 2k). The Merkle Tree Hash of an n-element list D_n is then defined recursively as:</t>
        <artwork><![CDATA[
MTH(D_n) = HASH(MTH(D[0:k]) || MTH(D[k:n])),
]]></artwork>
        <t>where:</t>
        <ul spacing="normal">
          <li>|| denotes concatenation</li>
          <li>: denotes concatenation of lists</li>
          <li>D[k1:k2] = D'_(k2-k1) denotes the list {d'[0] = d[k1], d'[1] = d[k1+1], ..., d'[k2-k1-1] = d[k2-1]} of length (k2 - k1).</li>
        </ul>
      </section>
      <section anchor="transaction-components">
        <name>Transaction Components</name>
        <t>Each leaf transaction in a CCF ledger carries the following components:</t>
        <artwork><![CDATA[
CCF-leaf = [
  internal-hash: bstr ; a string of HASH_SIZE bytes;
  internal-data: bstr; a string of at most 1024 bytes; and
  data_hash: bstr ; the serialization of the element stored at this leaf.
]
]]></artwork>
        <t>The <tt>internal_hash</tt> and <tt>internal_data</tt> byte strings are internal to the CCF implementation. Similarly, the auxiliary tree entries are internal to CCF. They are opaque to receipt Verifiers, but they commit the TS to the whole tree contents and may be used for additional, CCF-specific auditing.</t>
      </section>
    </section>
    <section anchor="ccf-inclusion-proofs">
      <name>CCF Inclusion Proofs</name>
      <t>CCF inclusion proofs consist of a list of digests tagged with a single left-or-right bit.</t>
      <artwork><![CDATA[
CCF-inclusion-proof: [
  leaf: CCF-leaf ;
  path: [+ ccf-proof-element] ;
]

ccf-proof-element = [
  left: bool
  hash: bstr
]
]]></artwork>
      <t>Unlike some other tree algorithms, the index of the element in the tree is not explicit in the inclusion proof, but the list of left-or-right bits can be treated as the binary decomposition of the index, from the least significant (leaf) to the most significant (root).</t>
      <section anchor="inclusion-proof-verification-algorithm">
        <name>Inclusion Proof Verification Algorithm</name>
        <t>CCF uses the following algorithm to validate an inclusion receipt:</t>
        <artwork><![CDATA[
compute_root(proof):
  let h = proof.leaf.internal-hash
       || HASH(proof.leaf.internal-data)
       || proof.leaf.data-hash
  for [left, hash] in proof.path:
      h := HASH(hash + h) if left
           HASH(h + hash) else
  return h

verify_inclusion_receipt(inclusion_receipt):
  let proofs = inclusion_receipt.unprotected_headers[-222] or fail
  let payload = nil
  assert(inclusion_receipt.payload == nil)

  for proof in proofs
    let root = compute_root(proof)
    if payload = nil then payload := root
    else assert(root == payload)

  # Use the Merkle Root as the detached payload
  return verif_cose(inclusion_receipt, payload)
]]></artwork>
      </section>
    </section>
    <section anchor="privacy-considerations">
      <name>Privacy Considerations</name>
      <t>Privacy Considerations</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Security Considerations</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="additions-to-existing-registries">
        <name>Additions to Existing Registries</name>
        <section anchor="tree-alg-registry">
          <name>Tree Algorithms</name>
          <t>This document requests IANA to add the following new value to the 'COSE Verifiable Data Structures' registry:</t>
          <ul spacing="normal">
            <li>Name: CCF_LEDGER_SHA256</li>
            <li>Value: TBD_1 (requested assignment 2)</li>
            <li>Description: Historical transaction ledgers, such as the CCF ledger</li>
            <li>Reference: This document</li>
          </ul>
        </section>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC9162">
          <front>
            <title>Certificate Transparency Version 2.0</title>
            <seriesInfo name="DOI" value="10.17487/RFC9162"/>
            <seriesInfo name="RFC" value="9162"/>
            <author fullname="B. Laurie" initials="B." surname="Laurie"/>
            <author fullname="E. Messeri" initials="E." surname="Messeri"/>
            <author fullname="R. Stradling" initials="R." surname="Stradling"/>
            <date month="December" year="2021"/>
            <abstract>
              <t>This document describes version 2.0 of the Certificate Transparency (CT) protocol for publicly logging the existence of Transport Layer Security (TLS) server certificates as they are issued or observed, in a manner that allows anyone to audit certification authority (CA) activity and notice the issuance of suspect certificates as well as to audit the certificate logs themselves. The intent is that eventually clients would refuse to honor certificates that do not appear in a log, effectively forcing CAs to add all issued certificates to the logs.</t>
              <t>This document obsoletes RFC 6962. It also specifies a new TLS extension that is used to send various CT log artifacts.</t>
              <t>Logs are network services that implement the protocol operations for submissions and queries that are defined in this document.</t>
            </abstract>
          </front>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <seriesInfo name="DOI" value="10.17487/RFC2119"/>
            <seriesInfo name="RFC" value="2119"/>
            <seriesInfo name="BCP" value="14"/>
            <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>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="BCP" value="14"/>
            <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>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="I-D.ietf-cose-merkle-tree-proofs">
          <front>
            <title>Concise Encoding of Signed Merkle Tree Proofs</title>
            <seriesInfo name="Internet-Draft" value="draft-ietf-cose-merkle-tree-proofs-03"/>
            <author fullname="Orie Steele" initials="O." surname="Steele">
              <organization>Transmute</organization>
            </author>
            <author fullname="Henk Birkholz" initials="H." surname="Birkholz">
              <organization>Fraunhofer SIT</organization>
            </author>
            <author fullname="Antoine Delignat-Lavaud" initials="A." surname="Delignat-Lavaud">
              <organization>Microsoft</organization>
            </author>
            <author fullname="Cedric Fournet" initials="C." surname="Fournet">
              <organization>Microsoft</organization>
            </author>
            <date day="11" month="December" year="2023"/>
            <abstract>
              <t>   This specification describes verifiable data structures and
   associated proof types for use with COSE.  The extensibility of the
   approach is demonstrated by providing CBOR encodings for RFC9162.

Discussion Venues

   This note is to be removed before publishing as an RFC.

   Discussion of this document takes place on the CBOR Object Signing
   and Encryption Working Group mailing list (cose@ietf.org), which is
   archived at https://mailarchive.ietf.org/arch/browse/cose/.

   Source for this draft and an issue tracker can be found at
   https://github.com/cose-wg/draft-ietf-cose-merkle-tree-proofs.

              </t>
            </abstract>
          </front>
        </reference>
      </references>
    </references>
    <?line 202?>

<section anchor="attic">
      <name>Attic</name>
      <t>Not ready to throw these texts into the trash bin yet.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAYJoWUAA71Z21bjRhZ911fUwEPjBHlhT+fSSpOExiawBugM0JmVARYU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