From c67297b65893ba1c0b69497cb12433d1dad9d7ba Mon Sep 17 00:00:00 2001 From: Christian Bormann Date: Mon, 5 Oct 2026 11:27:34 +0200 Subject: [PATCH 1/3] add text on deterministic CBOR encoding --- ...tal-credentials-harmonized-presentation.md | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/draft/digital-credentials-harmonized-presentation.md b/draft/digital-credentials-harmonized-presentation.md index 19eb0ec..937c2ba 100644 --- a/draft/digital-credentials-harmonized-presentation.md +++ b/draft/digital-credentials-harmonized-presentation.md @@ -88,6 +88,17 @@ To be completed. # Symbols and abbreviated terms To be completed. + +# CBOR Encoding {#cbor-encoding} + +All CBOR data items defined in this document shall be encoded in accordance with the core deterministic encoding requirements defined in [RFC 8949, Section 4.2.1](https://www.rfc-editor.org/rfc/rfc8949#section-4.2.1). + +The floating-point values NaN, Infinity and -Infinity shall not be used. + +These requirements do not apply to the content of byte strings that carry structures defined outside this document (e.g. mdoc data structures like `Document` or `DeviceEngagement`). Those external data structures are conveyed and processed as received. + +> **Note:** The deterministic serialization defined in draft-ietf-cbor-serialization [2] is the same as RFC 8949, Section 4.2.1 except for the encoding of NaN values, which are not used in this document. + # Credential Request > This section does not yet have working group consensus, which is tracked in [issue #24](https://github.com/openid/dchp/issues/24). @@ -246,6 +257,8 @@ The transaction transcript provides a cryptographic context binding across all p Because deterministic CBOR encoding (RFC 8949 §4.2) is required throughout this protocol, the transcript is defined as a **CBOR map** rather than a fixed-order array. Deterministic CBOR guarantees a unique canonical byte encoding for any given map value, making it safe to hash or sign over without ambiguity. This is the key difference from the ISO/IEC 18013-5 `SessionTranscript` array, which used a fixed order precisely to achieve the same determinism property. +The transcripts are never transmitted and the verifier and the wallet each construct them independently and shall encode them as specified in [CBOR Encoding](#cbor-encoding), so that both obtain identical byte representations. + Two transcript types are defined: - **`ReaderTransactionTranscript`** — constructed by the **verifier** and used in reader authentication and response encryption. @@ -518,7 +531,8 @@ SdJwtData = tstr ; SD-JWT combined presentation string ```cddl ; ========================================== ; TRANSACTION TRANSCRIPTS -; Deterministic CBOR encoding (RFC 8949 §4.2) is REQUIRED for all transcript values. +; Transcripts shall be encoded as specified in the "CBOR Encoding" clause +; (RFC 8949, Section 4.2.1). ; ========================================== ; Used by the verifier: for reader authentication and as info parameter for response encryption. @@ -590,6 +604,9 @@ Clause 7 (see ). [1] ISO/IEC Directives, Part 2, *Principles and rules for the structure and drafting of ISO and IEC documents* +[2] IETF Internet-Draft draft-ietf-cbor-serialization, *CBOR Serialization and +Determinism* (work in progress) + # Acknowledgements {#Acknowledgements} We would like to thank TBD for their @@ -597,8 +614,9 @@ valuable feedback and contributions to this specification. # Document History - [[ To be removed from the final specification ]] +[[ To be removed from the final specification ]] - -00 +-00 - * initial working draft + * adds definition on deterministic cbor encoding + * initial working draft From 0d1ee06ebfa4cf217d3a6b5c6f225a86708450c8 Mon Sep 17 00:00:00 2001 From: Christian Bormann Date: Thu, 15 Oct 2026 12:25:41 +0200 Subject: [PATCH 2/3] Apply suggestion from @jogu Co-authored-by: Joseph Heenan --- draft/digital-credentials-harmonized-presentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft/digital-credentials-harmonized-presentation.md b/draft/digital-credentials-harmonized-presentation.md index 937c2ba..53cbc55 100644 --- a/draft/digital-credentials-harmonized-presentation.md +++ b/draft/digital-credentials-harmonized-presentation.md @@ -255,7 +255,7 @@ The verifier can optionally authenticate itself using the `reader_auth` field in The transaction transcript provides a cryptographic context binding across all protocol operations, ensuring that messages from one session cannot be replayed in another, and that the verifier and wallet are bound to the same channel and request. -Because deterministic CBOR encoding (RFC 8949 §4.2) is required throughout this protocol, the transcript is defined as a **CBOR map** rather than a fixed-order array. Deterministic CBOR guarantees a unique canonical byte encoding for any given map value, making it safe to hash or sign over without ambiguity. This is the key difference from the ISO/IEC 18013-5 `SessionTranscript` array, which used a fixed order precisely to achieve the same determinism property. +Because deterministic CBOR encoding, as specified in [CBOR Encoding](#cbor-encoding), is required throughout this protocol, the transcript is defined as a **CBOR map** rather than a fixed-order array. Deterministic CBOR guarantees a unique canonical byte encoding for any given map value, making it safe to hash or sign over without ambiguity. This is the key difference from the ISO/IEC 18013-5 `SessionTranscript` array, which used a fixed order precisely to achieve the same determinism property. The transcripts are never transmitted and the verifier and the wallet each construct them independently and shall encode them as specified in [CBOR Encoding](#cbor-encoding), so that both obtain identical byte representations. From b219513765c799dd03ebd6dfa499620372bac889 Mon Sep 17 00:00:00 2001 From: Christian Bormann Date: Mon, 19 Oct 2026 09:30:13 +0200 Subject: [PATCH 3/3] Apply combined suggestion from @jogu and @martijnharing Co-authored-by: Christian Bormann --- draft/digital-credentials-harmonized-presentation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/draft/digital-credentials-harmonized-presentation.md b/draft/digital-credentials-harmonized-presentation.md index 53cbc55..ff100d6 100644 --- a/draft/digital-credentials-harmonized-presentation.md +++ b/draft/digital-credentials-harmonized-presentation.md @@ -91,11 +91,11 @@ To be completed. # CBOR Encoding {#cbor-encoding} -All CBOR data items defined in this document shall be encoded in accordance with the core deterministic encoding requirements defined in [RFC 8949, Section 4.2.1](https://www.rfc-editor.org/rfc/rfc8949#section-4.2.1). +All CBOR data items defined in this document, as well as any extension values embedded directly as CBOR data items, shall be encoded in accordance with the following requirements. +For CBOR data items encapsulated within a byte string, these requirements only apply when the content of the encapsulated data item is defined in this document: -The floating-point values NaN, Infinity and -Infinity shall not be used. - -These requirements do not apply to the content of byte strings that carry structures defined outside this document (e.g. mdoc data structures like `Document` or `DeviceEngagement`). Those external data structures are conveyed and processed as received. +- The cbor data items shall be encoded in accordance with the core deterministic encoding requirements defined in RFC 8949, Section 4.2.1. +- Floating-point values like Nan, Infinity and -Infinity shall not be used. > **Note:** The deterministic serialization defined in draft-ietf-cbor-serialization [2] is the same as RFC 8949, Section 4.2.1 except for the encoding of NaN values, which are not used in this document.