hyperledger / anoncreds-spec

The specification for AnonCreds verifiable credential exchange.
https://hyperledger.github.io/anoncreds-spec/
Apache License 2.0
45 stars 24 forks source link

What happens to the nonces in the issuance flow? #137

Closed swcurran closed 8 months ago

swcurran commented 1 year ago

In the issuance flow, there is a nonce in the Credential Offer (issuer to holder) and a nonce in the credential request (holder to issuer). Likewise, there is a key_correctness_proof in the Credential Request and the Issue Credential. My guess is that:

This needs to be verified or corrected with the implementation and explained in the specification.

swcurran commented 1 year ago

@whalelephant -- would you be able to take a look at this issue? Trace through the implementation to see how the nonces are used? Thanks!

The current text implies that they are the same, but looking at running examples shows they are not the same.

whalelephant commented 1 year ago

Yes you are correct. Below is a simple flow with the nonce throughout the process

Credential Offer:

  1. Issuer creates cred_offer_nonce as part of the request

Credential Request:

  1. Holder uses the cred_offer_nonce to blind their link_secret with the cred_offer_nonce
  2. Holder creates cred_req_nonce as part of the request

Credential Create:

  1. Issuer checks the link_secret_blind_correctness_proof in the credential request with cred_offer_nonce
  2. Issuer uses cred_req_nonce to construct the signature_correctness_proof

Process (Unblind) Credential:

  1. Holder uses cred_req_nonce to unblind credential signature

Presentation Request:

  1. Verifier creates presentation_nonce

Presentation:

  1. Holder uses the presentation_nonce as input to the proof

Verification:

  1. Verifier verifies proof with presentation_nonce
swcurran commented 1 year ago

Perfect writeup - thanks.

swcurran commented 8 months ago

Resolved and covered in the spec.