Skip to content

add text on deterministic CBOR encoding - #64

Open
c2bo wants to merge 2 commits into
mainfrom
18-deterministic-cbor
Open

c2bo wants to merge 2 commits into
mainfrom
18-deterministic-cbor

Conversation

@c2bo

@c2bo c2bo commented Oct 5, 2026

Copy link
Copy Markdown
Member

Closes #18

I wasn't entirely sure if we were in a state to propose a PR for this topic, but having text to discuss hopefully moves the discussion along.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📄 Editor's Copy preview

https://openid.github.io/dchp/PREVIEW-DO-NOT-USE/pr-64/digital-credentials-harmonized-presentation-editors-copy.html

Preview of 0d1ee06; updated on every push. For review only — the official specifications are published at https://openid.net/specs/

github-actions Bot pushed a commit that referenced this pull request Oct 5, 2026
@jogu
jogu requested review from davidz25 and martijnharing October 5, 2026 14:41
@jogu

jogu commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

discussed on today's call, no feedback, Martijn offered to review and also volunteered DavidZ :)

Comment thread draft/digital-credentials-harmonized-presentation.md Outdated
; ==========================================
; 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the outcome when they're not encoded as such? Is it undefined, are wallets required to reject RequestPayload if it's not deterministically encoded?

I can see some "fun" interoperability problems if a verifier sends something non-deterministically encoded and some wallets hash the RequestPayload as sent and some hash the decoded then reencoded one.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are not encoded following the rules, decryption would fail since the wrong input is used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yes, but the verifier will decrypt fine with some wallets, and fail to decrypt with others, and there's very little clue as to why.

Requiring wallets to reject requests which aren't deterministically encoded would instead surface the failure and cause pretty immediately. It would be an extra burden on wallets but maybe that's okay.


# 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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly we should be 100% clear that values defined outside this document (like transaction data equivalents or credential format specific items) are also deterministically encoded?

Suggested change
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, including any extension values they contain, 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).

@martijnharing martijnharing left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested clarification for the first section, otherwise good.


# 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).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking your comment and trying to be a little bit more specific, how about replacing the text with:


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 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.


; ==========================================
; 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are not encoded following the rules, decryption would fail since the wrong input is used.

Co-authored-by: Joseph Heenan <joseph@authlete.com>
github-actions Bot pushed a commit that referenced this pull request Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deterministic CBOR

4 participants