Internet-Draft | CoMETRE | December 2023 |
Steele, et al. | Expires 13 June 2024 | [Page] |
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.¶
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.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts 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 Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 13 June 2024.¶
Copyright (c) 2023 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/license-info) 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.¶
Merkle trees are one of many verifiable data structures that enable tamper evident secure information storage, through their ability to protect the integrity of batches of documents or collections of statements.¶
Merkle trees can be constructed from simple operations such as concatenation and digest via a cryptographic hash function, however, more advanced constructions enable proofs of different properties of the underlying verifiable data structure.¶
Verifiable data structure proofs can be used to prove 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).¶
Differences in the representation of verifiable data structures, and verifiable data structure proof types, can increase the burden for implementers, and create interoperability challenges for transparency services.¶
This document describes how to convey verifiable data structures, and associated proof types in COSE envelopes.¶
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.¶
A data structure which supports one or more Proof Types.¶
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).¶
A verifiable process, that proves properties of a Verifiable Data Structure.¶
An encoding of a Proof Type 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.¶
In order to improve interoperability we define two extension points for enabling verifiable data structures with COSE, and we provide concrete examples for the structures and proofs defined in [RFC9162].¶
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: The name of the verifiable data structure¶
Value: The identifier for the verifiable data structure¶
Description: The identifier for the verifiable data structure¶
Reference: Where the verifiable data structure is defined¶
Name | Value | Description | Reference |
---|---|---|---|
N/A | 0 | N/A | N/A |
RFC9162_SHA256 | 1 | SHA256 Binary Merkle Tree | [RFC9162] |
When desigining 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 |
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 |
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 accross "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.¶
Protocols requiring proof of inclusion ought to be able to preserve their functionality, while switching from one verifiable data structure to another, so long as both structures support the same proof types.¶
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 |
This section defines how the data structures described in [RFC9162] are mapped to the terminology defined in this document, using cbor and cose.¶
The integer identifier for this Verifiable Data Structure is 1. The string identifier for this Verifiable Data Structure is "RFC9162_SHA256".¶
See [RFC9162], 2.1.1. Definition of the Merkle Tree, for a complete description of this verifiable data structure.¶
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:¶
inclusion-proof = [ tree-size: int leaf-index: int inclusion-path: [ + bstr ] ]¶
This specification sometimes refers to profiles of signed inclusion proofs as "receipts".¶
In a signed inclusion proof, the previous merkle tree root, maps to tree-size-1, and is a detached payload.¶
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 [I-D.ietf-cose-typ-header-parameter] and the similar guidance provided in [I-D.ietf-cose-cwt-claims-in-headers].¶
The [I-D.ietf-scitt-architecture] describes one way in which signed inclusion proofs can be leveraged to support supply chain transparency.¶
The protected header for an RFC9162_SHA256 inclusion proof signature is:¶
protected-header-map = { &(alg: 1) => int &(verifiable-data-structure: -111) => int * cose-label => cose-value }¶
alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int / tstr.¶
verifiable-data-structure (label: -111): REQUIRED. verifiable data structure algorithm identifier. Value type: int / tstr.¶
The unprotected header for an RFC9162_SHA256 inclusion proof signature is:¶
inclusion-proofs = [ + bstr .cbor inclusion-proof ] verifiable-proofs = { &(inclusion-proof: -1) => inclusion-proofs } unprotected-header-map = { &(verifiable-data-proof: -222) => verifiable-proofs * cose-label => cose-value }¶
The payload of an RFC9162_SHA256 inclusion proof signature is the previous 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 signature, this protects against implementation errors where the signature is verified but the root does not match the inclusion 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:¶
consistency-proof = [ tree-size-1: int ; size of tree, at previous root tree-size-2: int ; size of tree, at latest root consistency-path: [ + bstr ] ; path from previous to latest root. ]¶
Editors note: tree-size-1, could be ommited, if an inclusion-proof is always present, since the inclusion proof contains, tree-size-1.¶
In a signed consistency proof, the latest merkle tree root, maps to tree-size-2, and is an attached payload.¶
The protected header for an RFC9162_SHA256 consistency proof signature is:¶
protected-header-map = { &(alg: 1) => int &(verifiable-data-structure: -111) => int * cose-label => cose-value }¶
alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int / tstr.¶
verifiable-data-structure (label: TBD_1): REQUIRED. verifiable data structure algorithm identifier. Value type: int / tstr.¶
The unprotected header for an RFC9162_SHA256 consistency proof signature is:¶
consistency-proofs = [ + bstr ] verifiable-proofs = { &(consistency-proof: -2) => consistency-proofs } unprotected-header-map = { &(verifiable-data-proof: -222) => verifiable-proofs * cose-label => cose-value }¶
The payload of an RFC9162_SHA256 consistency proof signature is:¶
The latest Merkle tree hash as defined in [RFC9162].¶
The payload MUST be attached.¶
See the privacy considerations section of:¶
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.¶
Additional header parameters can reveal information about the transparency service or its log entries. A privacy analysis SHOULD be performed for all mandatory fields in profiles based on this specification.¶
See the security considerations section of:¶
A security analysis SHOULD be performed to ensure that the
digitial signature algorithm alg
is the appropriate strength to secure receipts.¶
In some cases, receipts SHOULD have 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.¶
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.¶
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.¶
This document requests IANA to add new values to the 'COSE Algorithms' and to the 'COSE Header Algorithm Parameters' registries in the 'Standards Action With Expert Review category.¶
Name: verifiable-data-structure¶
Label: TBD_1¶
Value type: int / tstr¶
Value registry: https://www.iana.org/assignments/cose/cose.xhtml#header-parameters¶
Description: Algorithm name for verifiable data structure, used to produce verifiable data structure proofs.¶
Name: verifiable-data-structure-parameters¶
Label: TBD_2¶
Value type: int / tstr¶
Value registry: https://www.iana.org/assignments/cose/cose.xhtml#header-parameters¶
Description: Location for verifiable data structure proofs in COSE Header Parameters.¶
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:¶
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:¶
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 Internet-Draft, 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".¶
An open-source implementation was initiated and is maintained by the Transmute Industries Inc. - Transmute.¶
An application demonstrating the concepts is available at https://scitt.xyz.¶
An open-source implementation is available at:¶
https://github.com/transmute-industries/cose¶
The current version ('main') implements the verifiable data structure algorithm, inclusion proof and consistency proof concepts of this draft.¶
The project and all corresponding code and data maintained on GitHub are provided under the Apache License, version 2.¶
The implementation builds on concepts described in SCITT [I-D.ietf-scitt-architecture] (https://scitt.io/).¶
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/cose-js¶
The implementation uses an implementation of [RFC9162], maintained at:¶
https://github.com/transmute-industries/rfc9162/tree/main/src/CoMETRE¶