InternetDraft  COSE Receipts  October 2024 
Steele, et al.  Expires 12 April 2025  [Page] 
 Workgroup:
 COSE
 InternetDraft:
 draftietfcosemerkletreeproofs06
 Published:
 Intended Status:
 Standards Track
 Expires:
COSE Receipts
Abstract
COSE (CBOR Object Signing and Encryption) Receipts prove properties of a verifiable data structure to a verifier. Verifiable data structures and associated proof types enable security properties, such as minimal disclosure, transparency and nonequivocation. Transparency helps maintain trust over time, and has been applied to certificates, end to end encrypted messaging systems, and supply chain security. This specification enables concise transparency oriented systems, by building on CBOR (Concise Binary Object Representation) and COSE. The extensibility of the approach is demonstrated by providing CBOR encodings for RFC9162.¶
Status of This Memo
This InternetDraft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
InternetDrafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as InternetDrafts. The list of current InternetDrafts is at https://datatracker.ietf.org/drafts/current/.¶
InternetDrafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use InternetDrafts as reference material or to cite them other than as "work in progress."¶
This InternetDraft will expire on 12 April 2025.¶
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/licenseinfo) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
1. Introduction
COSE Receipts are signed proofs that include metadata about about certain states of a verifiable data structure (VDS) that are true when the COSE Receipt was issued. COSE Receipts can include proves that a document is in a database (proof of inclusion), that a database is append only (proof of consistency), that a smaller set of statements are contained in a large set of statements (proof of disclosure, a special case of proof of inclusion), or proof that certain data is not yet present in a database (proofs of non inclusion). Different VDS can produce different verifiable data structure proofs (VDP). The combination of representations of various VDS and VDP can significantly increase burden for implementers and create interoperability challenges for transparency services. This document describes how to convey VDS and associated VDP types in unified COSE envelopes.¶
1.1. Requirements Notation
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Terminology
 CDDL:

Concise Data Definition Language (CDDL) is defined in [RFC8610].¶
 EDN:

CBOR Extended Diagnostic Notation (EDN) is defined in [RFC8949], where it is referred to as "diagnostic notation", and is revised in [ID.draftietfcborednliterals].¶
 Verifiable Data Structure (VDS):

A data structure which supports one or more Proof Types. This property is conceptually similar to "alg" (1), it described an algorithm used to maintain the verifiable data structure, for example a binary merkle tree algorithm.¶
 Verifiable Data Structure Parameters (VDP):

Parameters to a verifiable data structure that are used to prove properties, such as authentication, inclusion, consistency, and freshness. Parameters can include multiple proofs of a given type, or multiple types of proof (inclusion and consistency). This property is conceptually similar to COSE Header Parameter "epk" (1) or CBOR Web Token (CWT) claim "cnf" (8), it is applied to a verifiable data structure, to confirm a property. For example an encrypted message might be decrypted using epk and a private key, a digital signature for authentication might be verified using cnf and the (CWT) claim "nonce" and "audience", and an inclusion proof for a binary merkle tree might be verified with VDP and some entry that is being tested or inclusion in the tree.¶
 Proof Type:

A verifiable process, that proves properties of a Verifiable Data Structure. For example, a VDS, such as a binary merkle tree, can support multiple proofs of type "inclusion" where each proof confirms that a given entry is included in a merkle root.¶
 Proof Value:

An encoding of a Proof Type in CBOR.¶
 Entry:

An entry in a verifiable data structure for which proofs can be derived.¶
 Receipt:

A COSE object, as defined in [RFC9052], containing the header parameters necessary to convey VDP for an associated VDS.¶
4. Verifiable Data Structures in CBOR
This section describes representations of verifiable data structure proofs in CBOR. For example, construction of a merkle tree leaf, or an inclusion proof from a leaf to a merkle root, might have several different representations, depending on the verifiable data structure used. Differences in representations are necessary to support efficient verification, unique security or privacy properties, and for compatibility with specific implementations. This document defines two extension points for enabling verifiable data structures with COSE and provides concrete examples for the structures and proofs defined in [RFC9162]. The design of these structures is influenced by the conventions established for COSE Keys.¶
During testing and development the experimental range SHOULD be used, unless early assignment for a provisional entry has been completed.¶
4.1. Structures
Similar to COSE Key Types, different verifiable data structures support different algorithms. As EC2 keys (1: 2) support both digital signature and key agreement algorithms, RFC9162_SHA256 (TBD_1 : 1) supports both inclusion and consistency proofs.¶
This document establishes a registry of verifiable data structure algorithms, with the following initial contents:¶
Name  Value  Description  Reference 

N/A  0  N/A  N/A 
RFC9162_SHA256  1  SHA256 Binary Merkle Tree  [RFC9162] 
EXPERIMENTAL  11  Unknown  RFC XXXX 
EXPERIMENTAL  22  Unknown  RFC XXXX 
EXPERIMENTAL  33  Unknown  RFC XXXX 
When designing new verifiable data structures, please request the next available positive integer as your requested assignment, for example:¶
Name  Value  Description  Reference 

N/A  0  N/A  N/A 
RFC9162_SHA256  1  SHA256 Binary Merkle Tree  [RFC9162] 
Your name  TBD (requested assignment 2)  tbd  Your specification 
4.2. Parameters
Similar to COSE Key Type Parameters, as EC2 keys (1: 2) keys require and give meaning to specific parameters, such as 1 (crv), 2 (x), 3 (y), 4 (d), RFC9162_SHA256 (TBD_1 : 1) supports both (1) inclusion and (2) consistency proofs.¶
This document establishes a registry of verifiable data structure algorithms, with the following initial contents:¶
Verifiable Data Structure  Name  Label  CBOR Type  Description  Reference 

1  inclusion proofs  1  array (of bstr)  Proof of inclusion  Section 5.2 
1  consistency proofs  2  array (of bstr)  Proof of append only property  Section 5.3 
11  unknown  1  array (of bstr)  Unknown  RFC XXXX 
22  unknown  1  array (of bstr)  Unknown  RFC XXXX 
33  unknown  1  array (of bstr)  Unknown  RFC XXXX 
Proof types are specific to their associated "verifiable data structure", for example, different Merkle trees might support different representations of "inclusion proof" or "consistency proof". Implementers should not expect interoperability across "verifiable data structures", but they should expect conceptually similar properties across the different registered proof types. For example, 2 different merkle tree based verifiable data structures might both support proofs of inclusion. Security analysis SHOULD be conducted prior to migrating to new structures to ensure the new security and privacy assumptions are acceptable for the use case. When designing new verifiable data structure parameters (or proof types), please start with 1, and count down for each proof type supported by your verifiable data structure:¶
Verifiable Data Structure  Name  Label  CBOR Type  Description  Reference 

1  inclusion proofs  1  array (of bstr)  Proof of inclusion  Section 5.2 
1  consistency proofs  2  array (of bstr)  Proof of append only property  Section 5.3 
TBD (requested assignment 2)  new proof type  1  tbd  tbd  Your_Specification 
TBD (requested assignment 2)  new proof type  2  tbd  tbd  Your_Specification 
TBD (requested assignment 2)  new proof type  3  tbd  tbd  Your_Specification 
4.3. Usage
This document registered a new COSE Header Parameter receipts
(394) to enable this Receipts to be conveyed in the protected and unprotected headers of COSE Objects.¶
When the receipts parameter is present, the associated verifiable data structure and verifiable data structure proofs MUST match entries present in the registries established in RFC XXXX.¶
The following informative CDDL is provided:¶
The following informative EDN is provided:¶
4.3.1. Registration Requirements
Each specification MUST define how to encode the verifiable data structure and its parameters (also called proof types) in CBOR. Each specification MUST define how to produce and consume the supported proof types. See Section 5 as an example.¶
Where a specification supports a choice of hash algorithm, an IANA registration must be made for each individually supported algorithm. For example, to provide for both SHA256 and SHA3_256 with [RFC9162], both "RFC9162_SHA256" and "RFC9162_SHA3_256" require entries in the relevant IANA registries.¶
5. RFC9162_SHA256
This section defines how the data structures described in [RFC9162] are mapped to the terminology defined in this document, using CBOR and COSE.¶
5.1. Verifiable Data Structure
The integer identifier for this Verifiable Data Structure is 1. The string identifier for this Verifiable Data Structure is "RFC9162_SHA256". See Table 1. See [RFC9162], 2.1.1. Definition of the Merkle Tree, for a complete description of this verifiable data structure.¶
5.2. Inclusion Proof
See [RFC9162], 2.1.3.1. Generating an Inclusion Proof, for a complete description of this verifiable data structure proof type.¶
The CBOR representation of an inclusion proof for RFC9162_SHA256 is:¶
The term leafindex
is used for alignment with the use established in [RFC9162]¶
Note that [RFC9162] defines that verification MUST fail if leafindex is >= treesize, and inclusion proofs are defined only for leaf nodes. The identifying index of a leaf node is relative to all nodes in the tree size for which the proof was obtained.¶
5.2.1. Receipt of Inclusion
In a signed inclusion proof, the payload is the merkle tree root which corresponds to the log at size treesize
.
Specifications are encouraged to make payloads detached when possible, forcing validationtime comparison.
Profiles of proof signatures are encouraged to make additional protected header parameters mandatory, to ensure that claims are processed with their intended semantics.
One way to include this information in the COSE structure is use of the typ (type) Header Parameter, see [ID.ietfcosetypheaderparameter] and the similar guidance provided in [ID.ietfcosecwtclaimsinheaders].
The protected header for an RFC9162_SHA256 inclusion proof signature is:¶
 alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int.¶
 vds (label: 395): REQUIRED. verifiable data structure algorithm identifier. Value type: int.¶
The unprotected header for an RFC9162_SHA256 inclusion proof signature is:¶
 vdp (label: 396): REQUIRED. Verifiable data structure proofs. Value type: Map.¶
 inclusionproof (label: 1): REQUIRED. Inclusion proofs. Value type: Array of bstr.¶
The payload of an RFC9162_SHA256 inclusion proof signature is the Merkle tree hash as defined in [RFC9162]. The payload MUST be detached. Detaching the payload forces verifiers to recompute the root from the inclusion proof, this protects against implementation errors where the signature is verified but the merkle root does not match the inclusion proof. The EDN for a Receipt containing an inclusion proof for RFC9162_SHA256 is:¶
The EDN for the Protected Header in the example above is:¶
The VDS in the protected header is necessary to understand the VDP in the unprotected header.¶
The EDN for the inclusion proof in the Unprotected Header is:¶
The VDS in the protected header is necessary to understand the inclusion proof structure in the unprotected header.¶
The inclusion proof and signature are verified in order. First the verifiers applies the inclusion proof to a possible entry (set member) bytes. If this process fails, the inclusion proof may have been tampered with. If this process succeeds, the result is a merkle root, which in the attached as the COSE Sign1 payload. Second the verifier checks the signature of the COSE Sign1. If the resulting signature verifies, the Receipt has proved inclusion of the entry in the verifiable data structure. If the resulting signature does not verify, the signature may have been tampered with. It is recommended that implementations return a single boolean result for Receipt verification operations, to reduce the chance of accepting a valid signature over an invalid inclusion proof.¶
5.3. Consistency Proof
See [RFC9162], 2.1.4.1. Generating a Consistency Proof, for a complete description of this verifiable data structure proof type.¶
The cbor representation of a consistency proof for RFC9162_SHA256 is:¶
Editors note: treesize1, could be omitted, if an inclusionproof is always present, since the inclusion proof contains, treesize1.¶
5.3.1. Receipt of Consistency
In a signed consistency proof, the newer merkle tree root (proven to be consistent with an older merkle tree root) is an attached payload and corresponds to the log at size treesize2.¶
The protected header for an RFC9162_SHA256 consistency proof signature is:¶
 alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int.¶
 vds (label: TBD_1): REQUIRED. Verifiable data structure algorithm identifier. Value type: int.¶
The unprotected header for an RFC9162_SHA256 consistency proof signature is:¶
consistencyproofs = [ + consistencyproof ] verifiableproofs = { &(consistencyproof: 2) => consistencyproofs } unprotectedheadermap = { &(vdp: 396) => verifiableproofs * coselabel => cosevalue }¶
 vdp (label: 396): REQUIRED. Verifiable data structure proofs. Value type: Map.¶
 consistencyproof (label: 2): REQUIRED. Consistency proofs. Value type: Array of bstr.¶
The payload of an RFC9162_SHA256 consistency proof signature is: The newer Merkle tree hash as defined in [RFC9162]. The payload MUST be attached.¶
The EDN for a Receipt containing a consistency proof for RFC9162_SHA256 is:¶
The VDS in the protected header is necessary to understand the VDP in the unprotected header.¶
The EDN for the Protected Header in the example above is:¶
The EDN for the consistency proof in the Unprotected Header is:¶
The VDS in the protected header is necessary to understand the consistency proof structure in the unprotected header.¶
The signature and consistency proof are verified in order.¶
First the verifier checks the signature on the COSE Sign1. If the verification fails, the consistency proof is not checked. Second the consistency proof is checked by applying a previous inclusion proof, to the consistency proof. If the verification fails, the append only property of the verifiable data structure is not assured. This approach is specific to RFC9162_SHA256, different verifiable data structures may not support consistency proofs. It is recommended that implementations return a single boolean result for Receipt verification operations, to reduce the chance of accepting a valid signature over an invalid consistency proof.¶
6. Privacy Considerations
See the privacy considerations section of:¶
6.1. Log Length
Some structures and proofs leak the size of the log at the time of inclusion. In the case that a log only stores certain kinds of information, this can reveal details that could impact reputation. For example, if a transparency log only stored breach notices, a receipt for a breach notice would reveal the number of previous breaches at the time the notice was made transparent.¶
6.2. Header Parameters
Additional header parameters can reveal information about the transparency service or its log entries. A privacy analysis MUST be performed for all mandatory fields in profiles based on this specification.¶
7. Security Considerations
See the security considerations section of:¶
7.1. Choice of Signature Algorithms
A security analysis MUST be performed to ensure that the digital signature algorithm alg
has the appropriate strength to secure receipts.¶
It is recommended to select signature algorithms that share cryptographic components with the verifiable data structure used, for example: Both RFC9162_SHA256 and ES256 depend on the sha256 hash function.¶
7.2. Validity Period
In some cases, receipts MAY include strict validity periods, for example, activation not too far in the future, or expiration, not too far in the past.
See the iat
, nbf
, and exp
claims in [RFC8392], for one way to accomplish this.
The details of expressing validity periods are out of scope for this document.¶
7.3. Status Updates
In some cases, receipts should be "revocable" or "suspendible", after being issued, regardless of their validity period. The details of expressing statuses are out of scope for this document.¶
8. Acknowledgements
We would like to thank Maik Riechert, Jon Geater, Mike Jones, Mike Prorock, Ilari Liusvaara, for their contributions (some of which substantial) to this draft and to the initial set of implementations.¶
9. IANA Considerations
9.1. Additions to Existing Registries
9.1.1. New Entries to the COSE Header Parameters Registry
This document requests IANA to add new values to the 'COSE Header Parameters' registries in the 'Integer values between 1 and 255' range with 'Specification Required' Registration Procedure.¶
9.1.2. COSE Verifiable Data Structures
IANA will be asked to establish a registry of verifiable data structure identifiers, named "COSE Verifiable Data Structures" to be administered under a Specification Required policy [RFC8126].¶
Template:¶
 Name: The name of the verifiable data structure¶
 Value: The identifier for the verifiable data structure¶
 Description: A brief description of the verifiable data structure¶
 Reference: Where the verifiable data structure is defined¶
Initial contents: Provided in Table 1¶
9.1.2.1. Expert Review
This IANA registries is established under a Specification Required policy.¶
This section gives some general guidelines for what the experts should be looking for, but they are being designated as experts for a reason, so they should be given substantial latitude.¶
Expert reviewers should take into consideration the following points:¶
 Point squatting should be discouraged. Reviewers are encouraged to get sufficient information for registration requests to ensure that the usage is not going to duplicate one that is already registered, and that the point is likely to be used in deployments.¶
 Specifications are required for all point assignments. Early Allocation is permissible, see Section 2 of [RFC7120]. Provisional assignments to expired drafts MUST be removed from the registry.¶
 Points assigned in this registry MUST have references that match the COSE Verifiable Data Structure Parameters registry. It is not permissible to assign points in this registry, for which no Verifiable Data Structure Parameters entries exist.¶
9.1.3. COSE Verifiable Data Structure Parameters
IANA will be asked to establish a registry of verifiable data structure parameters, named "COSE Verifiable Data Structure Parameters" to be administered under a Specification Required policy [RFC8126].¶
Template:¶
 Verifiable Data Structure: The identifier for the verifiable data structure¶
 Name: The name of the proof type¶
 Label: The integer of the proof type¶
 CBOR Type: The cbor data type of the proof¶
 Description: The description of the proof type¶
 Reference: Where the proof type is defined¶
Initial contents: Provided in Table 3¶
9.1.3.1. Expert Review
This IANA registries is established under a Specification Required policy.¶
This section gives some general guidelines for what the experts should be looking for, but they are being designated as experts for a reason, so they should be given substantial latitude.¶
Expert reviewers should take into consideration the following points:¶
 Point squatting should be discouraged. Reviewers are encouraged to get sufficient information for registration requests to ensure that the usage is not going to duplicate one that is already registered, and that the point is likely to be used in deployments.¶
 Specifications are required for all point assignments. Early Allocation is permissible, see Section 2 of [RFC7120]. Provisional assignments to expired drafts MUST be removed from the registry.¶
 Points assigned in this registry MUST have references that match the COSE Verifiable Data Structures registry. It is not permissible to assign points in this registry, for which no Verifiable Data Structure entry exists.¶
10. References
10.1. Normative References
 [RFC2119]
 Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://doi.org/10.17487/RFC2119>.
 [RFC7049]
 Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, , <https://doi.org/10.17487/RFC7049>.
 [RFC8174]
 Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://doi.org/10.17487/RFC8174>.
 [RFC9053]
 Schaad, J., "CBOR Object Signing and Encryption (COSE): Initial Algorithms", RFC 9053, DOI 10.17487/RFC9053, , <https://doi.org/10.17487/RFC9053>.
 [RFC9162]
 Laurie, B., Messeri, E., and R. Stradling, "Certificate Transparency Version 2.0", RFC 9162, DOI 10.17487/RFC9162, , <https://doi.org/10.17487/RFC9162>.
10.2. Informative References
 [BCP205]
 Sheffer, Y. and A. Farrel, "Improving Awareness of Running Code: The Implementation Status Section", BCP 205, RFC 7942, DOI 10.17487/RFC7942, , <https://doi.org/10.17487/RFC7942>.
 [ID.draftietfcborednliterals]
 Bormann, C., "CBOR Extended Diagnostic Notation (EDN)", Work in Progress, InternetDraft, draftietfcborednliterals12, , <https://datatracker.ietf.org/doc/html/draftietfcborednliterals12>.
 [ID.ietfcosecwtclaimsinheaders]
 Looker, T. and M. B. Jones, "CBOR Web Token (CWT) Claims in COSE Headers", Work in Progress, InternetDraft, draftietfcosecwtclaimsinheaders10, , <https://datatracker.ietf.org/doc/html/draftietfcosecwtclaimsinheaders10>.
 [ID.ietfcosetypheaderparameter]
 Jones, M. B. and O. Steele, "COSE "typ" (type) Header Parameter", Work in Progress, InternetDraft, draftietfcosetypheaderparameter05, , <https://datatracker.ietf.org/doc/html/draftietfcosetypheaderparameter05>.
 [RFC7120]
 Cotton, M., "Early IANA Allocation of Standards Track Code Points", BCP 100, RFC 7120, DOI 10.17487/RFC7120, , <https://doi.org/10.17487/RFC7120>.
 [RFC8126]
 Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, , <https://doi.org/10.17487/RFC8126>.
 [RFC8392]
 Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, , <https://doi.org/10.17487/RFC8392>.
 [RFC8610]
 Birkholz, H., Vigano, C., and C. Bormann, "Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, , <https://doi.org/10.17487/RFC8610>.
 [RFC8949]
 Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10.17487/RFC8949, , <https://doi.org/10.17487/RFC8949>.
 [RFC9052]
 Schaad, J., "CBOR Object Signing and Encryption (COSE): Structures and Process", STD 96, RFC 9052, DOI 10.17487/RFC9052, , <https://doi.org/10.17487/RFC9052>.
Appendix A. Implementation Status
Note to RFC Editor: Please remove this section as well as references to [BCP205] before AUTH48.¶
This section records the status of known implementations of the protocol defined by this specification at the time of posting of this InternetDraft, and is based on a proposal described in [BCP205]. 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.¶
According to [BCP205], "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".¶
A.1. Implementer
An opensource implementation was initiated and is maintained by the Transmute Industries Inc.  Transmute.¶
A.2. Implementation Name
An application demonstrating the concepts is available at COSE SCITT Receipts¶
A.3. Implementation URL
An opensource implementation is available at:¶
 https://github.com/transmuteindustries/cose¶
A.5. Coverage and Version Compatibility
The current version ('main') implements the verifiable data structure algorithm, inclusion proof and consistency proof concepts of this draft.¶
A.6. License
The project and all corresponding code and data maintained on GitHub are provided under the Apache License, version 2.¶
A.7. Implementation Dependencies
The implementation uses the Concise Binary Object Representation [RFC7049] (https://cbor.io/).¶
The implementation uses the CBOR Object Signing and Encryption [RFC9053], maintained at:  https://github.com/erdtman/cosejs¶
The implementation uses an implementation of [RFC9162], maintained at:¶
 https://github.com/transmuteindustries/rfc9162/tree/main/src/CoMETRE¶