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

Replace instances of `prover_did` and `entropy` from `credential_request` and have issuer generate it #149

Closed aritroCoder closed 8 months ago

aritroCoder commented 1 year ago

The current structure of a credential request is:

pub struct CredentialRequest {
    #[serde(skip_serializing_if = "Option::is_none")]
    entropy: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    prover_did: Option<String>,
    cred_def_id: CredentialDefinitionId,
    pub blinded_ms: ursa::cl::BlindedCredentialSecrets,
    pub blinded_ms_correctness_proof: ursa::cl::BlindedCredentialSecretsCorrectnessProof,
    pub nonce: Nonce,
}

The credential request contains prover_did, while anoncreds does not use DIDs for credential issuance. As in the specification, the entropy is used to add randomness in credential signature generation, and receiving this value from prover does not add any direct security enhancements. Supporting links:

  1. https://hyperledger.github.io/anoncreds-spec/#constructing-the-credential-request
  2. https://github.com/hyperledger/anoncreds-clsignatures-rs/blob/f1ae666656054cd73fe765928c0dada64ef21d87/src/issuer.rs#L242

Proposed solution

If backward compatibility with Indy is not a requirement, we can add entropy generation with the issuer. This also eliminates the confusion of prover_did and entropy being used for the same purpose in signatures (to add randomness).

swcurran commented 8 months ago

Completed — but added to the final checklist #175 to be sure.