]>
Concise Encoding of Signed Merkle Tree Proofs
Transmute
United States
orie@transmute.industries
Fraunhofer SIT
Rheinstrasse 75
Darmstadt
64295
Germany
henk.birkholz@sit.fraunhofer.de
Microsoft
UK
antdl@microsoft.com
Microsoft
UK
fournet@microsoft.com
Security
COSE
InternetDraft
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
Source for this draft and an issue tracker can be found at
.
Introduction
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.
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 when, and only when, they
appear in all capitals, as shown here.
Terminology
 Verifiable Data Structure:

A data structure which supports one or more Proof Types.
 Proof Type:

A verifiable process, that proves properties of one or more Verifiable Data Structures.
 Proof Value:

An encoding of a Proof Type in CBOR.
 Proof Signature:

A COSE Sign1 encoding of a specific Proof Type for a specific Verifiable Data Structure.
Verifiable Data Structures in CBOR
This section describes representations of verifiable data structure proofs structures in CBOR.
Different verifiable data structures support the same proof types,
but the representations of the proofs varies greatly.
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.
Some differences in representations are necessary to support efficient
verification of different kinds of proofs and for compatibility with specific implementations.
Some proof types benefit from standard envelope formats for signing and encryption, whilst others require no further cryptographic intervention at all.
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 .
Algorithms Registry
This document establishes a registry of verifiable data structure algorithms,
with the following initial contents:
Verifiable Data Structure Alogrithms
Identifier 
Algorithm 
Reference 
0 
N/A 

1 
RFC9162_SHA256 

Registration Requirements
Each specification MUST define how to encode the algorithm and proof types in CBOR.
Each specification MUST define how to produce and consume the supported proof types.
See as an example.
Proof Types in CBOR
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 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.
Proof Types Registry
This document establishes a registry of verifiable data structure proof types tags,
with the following initial contents:
Verifiable Data Structure Proof Types
Identifier 
Proof Type 
Proof Value 
Reference 
0 
N/A 
N/A 
N/A 
1 
inclusion 
array of bstr 

2 
consistency 
array of bstr 

Inclusion Proof
Inclusion proofs provide a mechanism for a verifier to validate set membership.
The integer identifier for this Proof Type is 1.
The string identifier for this Proof Type is "inclusion".
The value of this Proof Type is array of bstr.
provides a concrete example.
Consistency Proof
Consistency proofs provide a mechanism for a verifier to validate the consistency of a verifiable data structure.
The integer identifier for this Proof Type is 2.
The string identifier for this Proof Type is "consistency".
The value of this Proof Type is array of bstr.
provides a concrete example.
RFC9162_SHA256 as a Verifiable Data Structure
This section defines how the data structures described in
are mapped to the terminology defined in this document, using cbor and cose.
RFC9162_SHA256 requires the following:

11111 (verifiabledatastructure): 1, the integer representing the RFC9162_SHA256 verifiable data structure algorithm.

22222 (verifiabledataproofs): a map supporting the following proof types:

1 (inclusionproof): an array of bstr representing RFC9162_SHA256 inclusion proofs

2 (consistencyproof): an array of bstr representing RFC9162_SHA256 consistency proofs
Algorithm Definition
The integer identifier for this Verifiable Data Structure is 1.
The string identifier for this Verifiable Data Structure is "RFC9162_SHA256".
See .
See , 2.1.1. Definition of the Merkle Tree,
for a complete description of this verifiable data structure.
Inclusion Proof Definition
See , 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 Signature
In a signed inclusion proof, the previous merkle tree root, maps to treesize1, and is a detached payload.
Other specifications refer to signed inclusion proofs as "receipts",
profiles of proof signatures are encouraged to make additional protected header parameters mandatory.
TODO: reference to scitt receipts.
The protected header for an RFC9162_SHA256 inclusion proof signature is:

alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int / tstr.

verifiabledatastructure (label: 11111): REQUIRED. verifiable data structure algorithm identifier. Value type: int / tstr.
The unprotected header for an RFC9162_SHA256 inclusion proof signature is:
inclusionproofs
}
unprotectedheadermap = {
&(verifiabledataproof: 22222) => verifiableproofs
* coselabel => cosevalue
}
]]>

inclusionproof (label: 1): REQUIRED. proof type identifier. Value type: [ + bstr ].
The payload of an RFC9162_SHA256 inclusion proof signature is the previous Merkle tree hash as defined in .
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.
Consistency Proof Definition
See , 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 ommited, if an inclusionproof is always present, since the inclusion proof contains, treesize1.
Consistency Proof Signature
In a signed consistency proof, the latest merkle tree root, maps to treesize2, and is an attached payload.
The protected header for an RFC9162_SHA256 consistency proof signature is:

alg (label: 1): REQUIRED. Signature algorithm identifier. Value type: int / tstr.

verifiabledatastructure (label: TBD_1): REQUIRED. verifiable data structure algorithm identifier. Value type: int / tstr.

kid (label: 4): OPTIONAL. Key identifier. Value type: bstr

crit (label: 2): OPTIONAL. Criticality marker. Value type: [ + label ]
The unprotected header for an RFC9162_SHA256 consistency proof signature is:
consistencyproofs
}
unprotectedheadermap = {
&(verifiabledataproof: 22222) => verifiableproofs
* coselabel => cosevalue
}
]]>

consistencyproof (label: 2): REQUIRED. proof type identifier. Value type: [ + bstr ].
The payload of an RFC9162_SHA256 consistency proof signature is:
The latest Merkle tree hash as defined in .
The payload MUST be attached.
Privacy Considerations
See the privacy considerations section of:
Security Considerations
See the security considerations section of:
IANA Considerations
Additions to Existing Registries
New Entries to the COSE Header Parameters Registry
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.
COSE Header Algorithm Parameters

Name: verifiabledatastructure

Label: 11111

Value type: int / tstr

Value registry: https://www.iana.org/assignments/cose/cose.xhtml#headerparameters

Description: Algorithm name for verifiable data structure, used to produce verifiable data proofs.

Name: verifiabledataproof

Label: 222222

Value type: int / tstr

Value registry: https://www.iana.org/assignments/cose/cose.xhtml#headerparameters

Description: Location for verifiable data proofs in COSE Header Parameters.
Verifiable Data Structures
IANA will be asked to establish a registry of tree algorithm identifiers,
named "Verifiable Data Structures" to be administered under a Specification Required policy .
Template:

Identifier: The twobyte identifier for the algorithm

Algorithm: The name of the data structure

Reference: Where the data structure is defined
Initial contents: Provided in
Verifiable Data Structure Proof Types
IANA will be asked to establish a registry of tree algorithm identifiers,
named "Verifiable Data Structures Proof Types" to be administered under a Specification Required policy .
Template:

Identifier: The twobyte identifier for the algorithm

Algorithm: The name of the proof type algorithm

Reference: Where the algorithm is defined
Initial contents: Provided in
References
Normative References
Concise Binary Object Representation (CBOR)
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.
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.
Certificate Transparency
This document describes an experimental protocol for publicly logging the existence of Transport Layer Security (TLS) certificates as they are issued or observed, in a manner that allows anyone to audit certificate 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.
Logs are network services that implement the protocol operations for submissions and queries that are defined in this document.
Certificate Transparency Version 2.0
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.
This document obsoletes RFC 6962. It also specifies a new TLS extension that is used to send various CT log artifacts.
Logs are network services that implement the protocol operations for submissions and queries that are defined in this document.
US Secure Hash Algorithms (SHA and SHAbased HMAC and HKDF)
Federal Information Processing Standard, FIPS
EdwardsCurve Digital Signature Algorithm (EdDSA)
This document describes elliptic curve signature scheme Edwardscurve Digital Signature Algorithm (EdDSA). The algorithm is instantiated with recommended parameters for the edwards25519 and edwards448 curves. An example implementation and test vectors are provided.
Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)
This document defines a deterministic digital signature generation procedure. Such signatures are compatible with standard Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA) digital signatures and can be processed with unmodified verifiers, which need not be aware of the procedure described therein. Deterministic signatures retain the cryptographic security features associated with digital signatures but can be more easily implemented in various environments, since they do not need access to a source of highquality randomness.
Concise Binary Object Representation (CBOR)
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.
CBOR Object Signing and Encryption (COSE): Initial Algorithms
Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. There is a need to be able to define basic security services for this data format. This document defines a set of algorithms that can be used with the CBOR Object Signing and Encryption (COSE) protocol (RFC 9052).
This document, along with RFC 9052, obsoletes RFC 8152.
Guidelines for Writing an IANA Considerations Section in RFCs
Many protocols make use of points of extensibility that use constants to identify various protocol parameters. To ensure that the values in these fields do not have conflicting uses and to promote interoperability, their allocations are often coordinated by a central record keeper. For IETF protocols, that role is filled by the Internet Assigned Numbers Authority (IANA).
To make assignments in a given registry prudently, guidance describing the conditions under which new values should be assigned, as well as when and how modifications to existing values can be made, is needed. This document defines a framework for the documentation of these guidelines by specification authors, in order to assure that the provided guidance for the IANA Considerations is clear and addresses the various issues that are likely in the operation of a registry.
This is the third edition of this document; it obsoletes RFC 5226.
Improving Awareness of Running Code: The Implementation Status Section
This document describes a simple process that allows authors of InternetDrafts 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.
This process is not mandatory. Authors of InternetDrafts 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.
Key words for use in RFCs to Indicate Requirement Levels
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.
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
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.
Informative References
CBOR Object Signing and Encryption (COSE): Countersignatures
August Cellars
Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. CBOR Object Signing and Encryption (COSE) defines a set of security services for CBOR. This document defines a countersignature algorithm along with the needed header parameters and CBOR tags for COSE. This document updates RFC 9052.
An Architecture for Trustworthy and Transparent Digital Supply Chains
Fraunhofer SIT
Microsoft Research
Microsoft Research
ARM
RKVST
Traceability of physical and digital Artifacts in supply chains is a
longstanding, but increasingly serious security concern. The rise
in popularity of verifiable data structures as a mechanism to make
actors more accountable for breaching their compliance promises has
found some successful applications to specific use cases (such as the
supply chain for digital certificates), but lacks a generic and
scalable architecture that can address a wider range of use cases.
This document defines a generic, interoperable and scalable
architecture to enable transparency across any supply chain with
minimum adoption barriers. It provides flexibility, enabling
interoperability across different implementations of Transparency
Services with various auditing and compliance requirements.
Producers can register their Signed Statements on any Transparency
Service, with the guarantee that all Consumers will be able to verify
them.
Implementation Status
Note to RFC Editor: Please remove this section as well as references to 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 .
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 ,
"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".
Implementer
An opensource implementation was initiated and is maintained by the Transmute Industries Inc.  Transmute.
Implementation Name
An application demonstrating the concepts is available at https://scitt.xyz.
Implementation URL
An opensource implementation is available at:

https://github.com/transmuteindustries/cose
Maturity
The code's level of maturity is considered to be "prototype".
Coverage and Version Compatibility
The current version ('main') implements the tree algorithm, inclusion proof and consistency proof concepts of this draft.
License
The project and all corresponding code and data maintained on GitHub are provided under the Apache License, version 2.
Implementation Dependencies
The implementation builds on concepts described in SCITT (https://scitt.io/).
The implementation uses the Concise Binary Object Representation (https://cbor.io/).
The implementation uses the CBOR Object Signing and Encryption , maintained at:
 https://github.com/erdtman/cosejs
The implementation uses an implementation of ,
maintained at:

https://github.com/transmuteindustries/rfc9162/tree/main/src/CoMETRE
Contact
Orie Steele (orie@transmute.industries)