Skip to content

Rephrase conditions to provide nonce in proof types based on presence of Nonce endpoint#678

Open
awoie wants to merge 11 commits into
mainfrom
awoie/fix-677
Open

Rephrase conditions to provide nonce in proof types based on presence of Nonce endpoint#678
awoie wants to merge 11 commits into
mainfrom
awoie/fix-677

Conversation

@awoie

@awoie awoie commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Potentially fixes #677 , potentially fixes #676

Note that I created the PR based on #676 (comment).

IMO, one implication is that for nonce claims in a key_attestation in a jwt proof, it means, the wallet decides whether to include it which is how I interpret the current version of the spec but wanted to point this out in case it is not obvious for readers of this PR. If the issuer insists on the presence which is unlikely, it could still provide a nonce error. To improve this behaviour, we could define a dedicated issuer metadata parameter, e.g., require_nonce_in_key_attesatation_in_jwt_proof in a backward compatible way to improve this behaviour.

@paulbastian paulbastian left a comment

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.

I can't judge for DI, but the fix on jwt proof_type looks right

Comment thread 1.1/openid-4-verifiable-credential-issuance-1_1.md Outdated
Co-authored-by: Kristina <52878547+Sakurann@users.noreply.github.com>

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

We still have the part here to solve: #676 (comment) (or we should raise a new issue for that, I don't have a strong opinion which).

I think we should apply the change to 1.0 as well.

@babisRoutis

Copy link
Copy Markdown
Contributor

Hi @awoie

Please consider updating the definition of nonce claim of key_attestation found in appendix E.

Currently the definition is

nonce: OPTIONAL. String that represents a nonce provided by the Issuer to prove that a key attestation was freshly generated

IMO this could be update to include

MUST be present if the attestation is used with attestation Proof type, if credential issuer provides a nonce endpoint

@awoie awoie requested a review from Sakurann November 20, 2025 16:53
@c2bo

c2bo commented Nov 25, 2025

Copy link
Copy Markdown
Member

Hi @awoie

Please consider updating the definition of nonce claim of key_attestation found in appendix E.

Currently the definition is

nonce: OPTIONAL. String that represents a nonce provided by the Issuer to prove that a key attestation was freshly generated

IMO this could be update to include

MUST be present if the attestation is used with attestation Proof type, if credential issuer provides a nonce endpoint

I was wondering about the same point - we should be clear where exactly nonce is required and where not. In the case of proof type attestation we still want to mandate its presence, right?

@babisRoutis

Copy link
Copy Markdown
Contributor

I was wondering about the same point - we should be clear where exactly nonce is required and where not. In the case of proof type attestation we still want to mandate its presence, right?

@c2bo

My truth table ( 😄 ) for nonce in the key_attestation:

key_attestation carrier Nonce endpoint present Nonce endpoint absent
Proof of type jwt Optional (Wallet's decision). If present should be from nonce_endpoint Must not be present
Proof of type attestation Mandatory Must not be present

@awoie

awoie commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Hi @awoie
Please consider updating the definition of nonce claim of key_attestation found in appendix E.
Currently the definition is

nonce: OPTIONAL. String that represents a nonce provided by the Issuer to prove that a key attestation was freshly generated

IMO this could be update to include

MUST be present if the attestation is used with attestation Proof type, if credential issuer provides a nonce endpoint

I was wondering about the same point - we should be clear where exactly nonce is required and where not. In the case of proof type attestation we still want to mandate its presence, right?

For the attestation proof type we have this:

If the Credential Issuer has a Nonce Endpoint (as defined in Section 8), the c_nonce value provided by the Credential Issuer MUST be provided in the key attestation's nonce parameter.

@awoie

awoie commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Hi @awoie
Please consider updating the definition of nonce claim of key_attestation found in appendix E.
Currently the definition is

nonce: OPTIONAL. String that represents a nonce provided by the Issuer to prove that a key attestation was freshly generated

IMO this could be update to include

MUST be present if the attestation is used with attestation Proof type, if credential issuer provides a nonce endpoint

I was wondering about the same point - we should be clear where exactly nonce is required and where not. In the case of proof type attestation we still want to mandate its presence, right?

For the attestation proof type we have this:

If the Credential Issuer has a Nonce Endpoint (as defined in Section 8), the c_nonce value provided by the Credential Issuer MUST be provided in the key attestation's nonce parameter.

But yes, I agree with @babisRoutis.

I will clean up the language again to clarify all of this since I agree it is language that can be misinterpreted.

@awoie awoie requested a review from jogu December 7, 2025 17:42
@awoie

awoie commented Dec 7, 2025

Copy link
Copy Markdown
Contributor Author

@jogu I applied the change to 1.0. Let me know if there is anything else needed wrt change log. Also added some language on pre-generated attestations and how a wallet could detect whether an issuer requires a nonce in the key attestation based on the current specification, e.g., invalid_nonce error.

@awoie awoie requested a review from babisRoutis December 7, 2025 17:46
Comment thread 1.1/openid-4-verifiable-credential-issuance-1_1.md Outdated
Comment thread 1.1/openid-4-verifiable-credential-issuance-1_1.md Outdated
Comment thread 1.0/openid-4-verifiable-credential-issuance-1_0.md Outdated

@awoie awoie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied @GarethCOliver suggestion. Please review again.

As a general thought, we might use the opportunity to clean up the language a bit more and also include a table such as the one that @babisRoutis provided to make things more explicit.

Comment thread 1.0/openid-4-verifiable-credential-issuance-1_0.md Outdated
Comment thread 1.1/openid-4-verifiable-credential-issuance-1_1.md Outdated
@awoie

awoie commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

We need more reviews for this PR @jogu @Sakurann

@andprian

Copy link
Copy Markdown

@awoie the changes you made are in multiple places and describe how the wallet is expected to behave. I think we also need this kind on explanation in Clause 7. Nonce Endpoint. It would be useful for the Issuer's side to have the big picture here. If he provides a nonce endpoint, explain how this is expected to work, when it is mandatory to use this endpoint and when not.

@Sakurann Sakurann requested a review from fkj April 22, 2026 08:10
@Sakurann

Copy link
Copy Markdown
Collaborator

discussed in the WG call:

@Sakurann

Sakurann commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

@jogu put request for changes which i think have been addressed. please re-review:

We still have the part here to solve: #676 (comment) (or we should raise a new issue for that, I don't have a strong opinion which).

we now have the following text: "In some environments, a nonce is unnecessary because the key material in the key_attestation already provides sufficient entropy and freshness. Omitting the nonce also enables pre-generation of attestations prior to interacting with a specific Issuer. If the Issuer returns an invalid_nonce error, this can be interpreted as an indication that the Issuer expects a nonce claim in the key_attestation."

I think we should apply the change to 1.0 as well.

has been applied

* `jwk`: OPTIONAL. JOSE Header containing the key material the new Credential is to be bound to. It MUST NOT be present if `kid` or `x5c` is present.
* `x5c`: OPTIONAL. JOSE Header containing at least one certificate where the first certificate contains the key that the Credential is to be bound to, additional certificates may also be present. It MUST NOT be present if `kid` or `jwk` is present.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the Credential Issuer provided a `c_nonce`, the `nonce` claim in the key attestation MUST be set to a server-provided `c_nonce`.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the `nonce` claim is present in the key attestation, its value MUST be set to a server-provided `c_nonce` from the Nonce Endpoint as defined in (#nonce-endpoint). Note that including a `nonce` claim is left to the Wallet. In some environments, a `nonce` is unnecessary because the key material in the `key_attestation` already provides sufficient entropy and freshness. Omitting the `nonce` also enables pre-generation of attestations prior to interacting with a specific Issuer. If the Issuer returns an `invalid_nonce` error, this can be interpreted as an indication that the Issuer expects a `nonce` claim in the `key_attestation`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Initially there was a suggestion to have a parameter require_nonce_in_key_attestation_in_jwt_proof and I believe that this is necessary to have, otherwise the wallet cannot know what the issuer expects without trial and error.

* `jwk`: OPTIONAL. JOSE Header containing the key material the new Credential is to be bound to. It MUST NOT be present if `kid` or `x5c` is present.
* `x5c`: OPTIONAL. JOSE Header containing at least one certificate where the first certificate contains the key that the Credential is to be bound to, additional certificates may also be present. It MUST NOT be present if `kid` or `jwk` is present.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the Credential Issuer provided a `c_nonce`, the `nonce` claim in the key attestation MUST be set to a server-provided `c_nonce`.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the `nonce` claim is present in the key attestation, its value MUST be set to a server-provided `c_nonce` from the Nonce Endpoint as defined in (#nonce-endpoint). Note that including a `nonce` claim is left to the Wallet. In some environments, a `nonce` is unnecessary because the key material in the `key_attestation` already provides sufficient entropy and freshness. Omitting the `nonce` also enables pre-generation of attestations prior to interacting with a specific Issuer. If the Issuer returns an `invalid_nonce` error, this can be interpreted as an indication that the Issuer expects a `nonce` claim in the `key_attestation`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this can be interpreted as an indication -> can it be interpreted in another way as well?

* `jwk`: OPTIONAL. JOSE Header containing the key material the new Credential is to be bound to. It MUST NOT be present if `kid` or `x5c` is present.
* `x5c`: OPTIONAL. JOSE Header containing at least one certificate where the first certificate contains the key that the Credential is to be bound to, additional certificates may also be present. It MUST NOT be present if `kid` or `jwk` is present.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the Credential Issuer provided a `c_nonce`, the `nonce` claim in the key attestation MUST be set to a server-provided `c_nonce`.
* `key_attestation`: OPTIONAL. JOSE Header containing a key attestation as described in (#keyattestation). If the `nonce` claim is present in the key attestation, its value MUST be set to a server-provided `c_nonce` from the Nonce Endpoint as defined in (#nonce-endpoint). Note that including a `nonce` claim is left to the Wallet. In some environments, a `nonce` is unnecessary because the key material in the `key_attestation` already provides sufficient entropy and freshness. Omitting the `nonce` also enables pre-generation of attestations prior to interacting with a specific Issuer. If the Issuer returns an `invalid_nonce` error, this can be interpreted as an indication that the Issuer expects a `nonce` claim in the `key_attestation`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Considering that the issuer can still enforce the presence of the nonce in the key_attestation, it is not actually true that including a nonce claim is left to the Wallet. Saying this is left to the wallet makes one believe that the request will succeed in both cases.

@brentzundel

Copy link
Copy Markdown
Collaborator

@jogu can you re-review?

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.

"If the Credential Issuer provided a c_nonce" doesn't really make sense key attestation in the jwt proof header should be able to be pre-generated...

10 participants