Movatterモバイル変換


[0]ホーム

URL:


§ AnonCreds Specification

Specification Status: v1.0 Draft

Latest Draft:

https://github.com/hyperledger/anoncreds-spec

Editors:

Participate:
GitHub repo
Commit history
Discord

§ Abstract

The AnonCreds (Anonymous Credentials) specification is based on the open source verifiable credentialimplementation of AnonCreds that has been in use since 2017, initially as part of theHyperledger Indy opensource project and now in theHyperledger AnonCreds project. The extensive use of AnonCreds around the world has made it a defacto standard for ZKP-based verifiable credentials, and this specification is theformalization of that implementation.

For more details on what AnonCreds are and how they work you can refer to theAnonymous credentials with type-3 revocation by Dmitry Khovratovisch, Michael Lodder and Cam Parra which is the compiled pdf from theirofficial TeX document published under CC4.0 license.

§ Status of This Memo

This is a proposal for version v1.0 of AnonCreds which aims at AnonCreds being ledger agnostic.

This document is a product of theAnonCreds Working Group.It represents the consensus of the AnonCreds community.The proposal for v1.0 has partly been worked out at theRWOT2022 event in the Hague, Netherlands.

Information about the current status of this document, any errata,and how to provide feedback on it may be obtained athttps://github.com/hyperledger/anoncreds-spec.

§ Copyright Notice

This specifications is subject to theCommunity Specification License 1.0available athttps://github.com/CommunitySpecification/1.0.

If source code is included in the specification, that code is subject to theApache 2.0 license unless otherwise marked. In the case of any conflict orconfusion within this specification between the Community Specification Licenseand the designated source code license, the terms of the Community SpecificationLicense shall apply.

§ Introduction

AnonCreds ZKP verifiable credentials provide capabilities that many see as important for digital identity use cases in particular, and verifiable data in general. These features include:

This version (v1.0) removes any dependence on Hyperledger Indy by removing any requirements related to the storage of the objects used in AnonCreds, whether they be stored remotely on a “verifiable data registry” (including Hyperledger Indy) or in local secure storage.

The following diagram and explanation below give a high-level overview of all AnonCreds Data objects, their relations and the owner respectively receiver of each of the data objects.

AnonCreds Data Model Overview

AnonCreds require aVerifiable Data Registry (VDR). AVDR (box in green) is a public registry (often a ledger) used for storing some of the AnonCreds data objects.

Schemas are public and reusable templates, which define the attributes of issued AnonCredscredentials and can be written (e.g. by anIssuer) to theVDR.

Based on aSchema, arbitraryIssuers (box in yellow) can create a Credential Definition (Credential Definition) which references theSchema. ACredential Definition enablesIssuers to issue AnonCredsCredentials toHolders and enablesVerifiers (box in red) to verifyCredentials issued to and presented by aHolder. ACredential Definition consists of two pieces of information: First, thePrivate Credential Definition includes the private signing keys of theIssuer for signing and issuing AnonCredsCredentials toholders and is kept private by theIssuer. Second, thePublic Credential Definition includes the public keys of theIssuer, has to be stored on aVDR and is used byholders and arbitraryVerifiers in order to verify AnonCredsCredentials issued to and presented byHolders.

EachHolder (box in blue) has alink secret, which enablesCredential toHolder binding: Whenever aCredential is issued to aHolder by anIssuer, theHolder generates ablinding factor and uses this to commit to a blinded version of thelink secret which is sent to theIssuer. TheIssuer verifies the commitment, before producing a blind signature over the blindedlink secret along with the other attributes within the AnonCredsCredential. This blind signature is sent to theHolder, who removes theblinding factor to retrieve a credential signature over theCredential attributes including the unblindedlink secret. By using the samelink secret for everyCredential that is issued to theHolder, theHolder can prove the affiliation of multipleCredentials at presentation time.

Holders never present the raw signed credential data they - received fromIssuers - toVerifiers for verification purposes. Instead aVerifiable Presentation is created by theHolder and sent to theVerifier. AVerifiable Presentation is a derivation of an AnonCredsCredential which allows aHolder to proof the correctness of the revealed credential data, without revealing the original raw credential signature(s). Additionally,Holders prove knowledge thelink secret attribute within theCredential, without revealing this value to theVerifiers.Verifiers processVerifiable Presentations for verification ofcredential data.

AnonCreds allows the revocation ofCredentials issued toHolders byIssuers. In case revocation is required, at least one (Revocation Registry Definition), which references the associatedPublic Credential Definition, has to be stored to theVDR by theIssuer in addition to thePublic Credential Definition. ARevocation Registry Definition can haveRevocation Status Lists. When one or more credentials have to be revoked, theIssuer stores aRevocation Status List with the updated status of the credentials in question to theVDR.Holder use these additional pieces of information in order to generate aNon-Revocation Proof. ANon-Revocation Proof proves to aVerifier, that the credential theHolder presented to theVerifier, has not been revoked.Verifiers use the information provided by aRevocation Registry Definition and associatedRevocation Status Lists to verify theHolder`sNon-Revocation Proof. ATails File supports the revocation mechanism. EachRevocation Registry Definition requires exactly one Tails File.

§ Requirements, Notation and Conventions

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALLNOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”,“MAY”, and “OPTIONAL” in this document are to be interpreted asdescribed in BCP 14 [RFC2119] [RFC8174] when, and only when, theyappear in all capitals, as shown here.

§ Terminology

Accumulator
A [cryptographic accumulator] is used in the AnonCreds v1.0 Revocation scheme as a space- and time-efficient method of proving a value membership in a set of values without revealing the individual members of the set. In AnonCreds v1, an accumulator is a core element of theverifiable credential revocation mechanism.
AnonCreds Method
AnonCreds methods specify how AnonCreds objects are written (registered) and read (resolved) on a givenverifiable data registry implementation. AnonCreds was originally written to useHyperledger Indy as its onlyVDR implementation, but the evolution of AnonCreds to enable storing objects on anyVDR implementation means that AnonCreds methods (comparable toDID Methods from theW3C DID Core specification) are necessary. AnonCreds Methods are defined in theAnonCreds Methods Registry repository.
AnonCreds Objects
The published and shared data objects used in AnonCreds v1.0 including the published objectsschema,credential definition,revocation registry definition,revocation registry entry and the shared objectscredential offer,credential request, andpresentation request.
BigNumber
ABigNumber is an data object which safely allows mathematical operations on numbers of any magnitude. BigNumbers are commonly used in cryptography schemes, including those underlying AnonCreds v1.0.
Blinded Secret
A cryptographic technique where a secret value (a number) is blinded before it is shared such that the sender can later prove knowledge of the secret value without sharing it. The AnonCreds v1.0link secretmechanism is based on the use of a blinded secret.
Blinded Secrets Correctness Proof
AZKP-based proof that can be verified to show that ablinded secret was produced correctly from anunblinded secret without exposing the secret.
Blinding Factor
A blinding factor is a randomBigNumber selected from the set of integers up to the order of the RSA group,n. It is generated by theholder to blind theirlink secret during credential issuance. Knowledge of the blinding factor can be used to create aBlinded Secrets Correctness Proof.The blinding factor can be removed from the signature theissuer produces to retrieve a valid signature over theunblinded link secret. A blinding factor and associatedBlinded Secrets Correctness Proof are similarly generated for each non-disclosed attribute during credential presentation, such that aholder can prove they know these values without revealing them to theverifier.
Call Home
Call home is a term used when evaluating the privacy characteristics ofverifiable credential deployments. If aholder presenting data from a verifiable credential must always contact (“call home to”) theissuer,holder actions are open to the actual, or perception of, tracking of the holder by the issuer.Verifiable credential schemes that do not make possible the tracking ofholder activities byissuers are preferred.
Claim
A claim is a part of digital identity related to asubject. A claim can be attested by the identity subject itself, or it can be asserted by another entity.
Correlatability
When a verifiable credential scheme that has the attribute ofunlinkability, the data from the process of sharing averifiable presentations with different verifiers cannot be correlated to identify theholder.
Credential
A credential is a set ofclaims about an identitysubject. A verifiable credential is a tamper-proof credential whose authorship is cryptographically verifiable. An anonymous credential, also known as AnonCreds, is a verifiable credential that has privacy-preserving properties to enable data minimization and correlation resistance.
Credential Definition
A credential definition (also known as CRED_DEF or CLAIM_DEF) contains the public data required forcredential issuances (used by theissuer) as well ascredential validation data (used byholders andverifiers). Any number of credentials can be issued based on a single credential definition. A credential definition is generated by theissuer beforecredential any issuances and published for anyone (primarilyholders andverifiers) to use. In generating the published credential definition, related private data is also generated and held as a secret by the issuer. The secret data includes the private keys necessary to generate signedverifiable credentials that can be presented and verified using the published credential definition. A credential definition can optionally be generated such that its generated credentials can be revoked.
Credential Key Correctness Proof
A proof generated during the creation of thecredential definition and included in thecredential offer so that theholder can verify that theissuer is in control of the private data associated with the publishedcredential definition.
Credential Offer
A credential offer is a data object sent by anissuer to aholder offering to issue acredential. The credential offer contains the details about the claims theissuer intends to issue to theholder. Aholder can reply to theissuer with acredential request. A credential offer also includes anonce and aCredential Key Correctness Proof.
Credential Request
A credential request is a request from anholder towards aissuer to get a credential issued by theissuer. The credential request references a precedingcredential offer and defines the claims theholder wants to get issued, including aBlinded Secret and associatedBlinded Secrets Correctness Proof. A credential request also includes anonce that is used in issuing the credential.
Data Minimization
An attribute of verifiable data sharing schemes that considers privacy of a scheme based on the amount of data shared in a given interaction. Ideally, the minimum amount of data is shared for the purpose of the interaction. Techniques such asselective disclosure,predicates, andunlinkability, all available in AnonCreds v1.0 support the goal of privacy-preserving, minimal data sharing.
DID
A Decentralized Identifier (DID), defined by theW3C DID Core Specification, is a type of identifier that is useful in enabling verifiable, decentralized digital identity. A DID refers to any subject (e.g., a person, organization, thing, data model, abstract entity, etc.) as determined by the controller of the DID. DIDs are not used in AnonCreds itself but there must be a verifiable identifier (usually a DID) with an enforced relationship betweenschema publishers andissuers and the AnonCreds objects they publish. This is outlined in a note inthis specification section.
DID Method
DID methods specify how DID documents are created and resolved (read) on a givenverifiable data registry implementation, allowing DIDs to be created and resolved in a wide variety of storage containers. The capabilities required by DID Methods are defined in the [DID Core specification], and the (many) DID Methods are defined in theDID Methods Registry repository.
Holder

In this specification, the holder is a software component (agent) used by an entity (person, organization, etc.) in possession ofcredentials issued to them. Where “holder” is used in the specification we mean the software component. In some places where required, we clearly refer to an entity using holder software as separate from the holder software component. Holders interact withissuers to obtaincredentials, and derivepresentations from thecredentials they hold.

Issuer

An issuer is one of the three entities that interact with each other within the domain of digital identities. It can assertclaims about asubject in the form of a tamper-proof credential whose origins are cryptographically verifiable.

Issuer Identifier

An issuer identifier is a unique identifier for anissuer. It is used to identify theissuer of AnonCreds objects published to aVerifiable Data Registry.

Link secret

A link secret is a unique identifier known only to theholder used in AnonCreds to bind credentials issued to aholder to thatholder, and to demonstrate that all of the source verifiable credentials in a presentation are bound to the same link secret that is known to theholder. During issuance and presentation processes theholder's link secret is blinded with ablinding factor such that it is not correlatable, and aBlinded Secrets Correctness Proof is provided by the holder to demonstrate they know the link secret without revealing it.

Link secret is also known by the deprecated termmaster_secret in some AnonCreds source code.

Nonce

A nonce is an arbitrary unique number that is often required as an input to the generation of a cryptographic proof to ensure it is uniquely generated and once produced, cannot be replayed. Within AnonCreds, nonces are used during the issuance and presentation processes to prevent replay attacks.

Non-Revocation Proof

A non-revocation proof is a proof provided by aholder to demonstrate that a revocable credential they are presenting has not been revoked, without revealing a unique, correlatable identifier for the credential. Averifier verifies a non-revocation proof using information from therevocation registry to which thecredential belongs.

Predicates

Azero-knowledge proof predicate is a boolean assertion (operators<=,<,>,>=) in an presentation about the value of an integerclaim without disclosing the value of the claim.

Presentation Request

An AnonCreds presentation request is an object constructed by theverifier and sent to theholder defining the verifiable data that theverifier wants from theholder for some purpose.

Prover

A prover is a synonym for holder that is sometimes used in aholder-verifier interaction. In this specification, we use the term “holder” in all cases. However the underlying AnonCreds implementations use “prover” in code.

Revocation

A unilateral action by theissuer of averifiable credential issued to aholder to revoke that credential for some reason. Once an issued credential has been revoked, theholder can no longer produce anon-revocation proof for thecredential.Verifiers usually (but not always) are interested if a data is presented from a revokedcredential.

Revocation Registry

A Revocation registry is a set of objects related to one another and acredential definition that holds information about the revocation status of a set of revocable credentials issued from thecredential definition. Each revocation registry consists of arevocation registry definition and one or morerevocation registry entries. There can be 0 or more revocation registries related to acredential definition, and every issued AnonCreds revocable credential is in a revocation registry.

Revocation Registry Definition

A revocation registry definition is an object with public and private information about arevocation registry. The public part is published such that it an be resolved and used by anyone, while the private part is a secret held by theissuer for use when publishingrevocation registry entries that update the revocation status of one or more credentials.

Revocation Registry Entry

A revocation registry entry is an object that is published by theissuer to set/update the revocation status of one or more issued credentials that are in arevocation registry. Each revocation registry entry has an identifier (sometimes called atimestamp), a cryptographic accumulator that summarizes the revocation state of all the credentials in therevocation registry and, depending on theAnonCreds Method being used to publish the object, either the revocation state of all of the credentials in the registry, or the set of credentials whose revocation state has changed (“deltas”) since the last revocation registry entry was published.

Revocation Status List

A Revocation status list is an object that contains the revocation status (“revoked” or “not revoked”) of all credentials in aRevocation Registry at the time of a givenrevocation registry entry. For [[AnonCreds Methods]] that storerevocation registry entries as deltas (changes to the revocation state of credentials from the previousrevocation registry entry), the set of deltas from the initial publication of therevocation registry must be collected and used to calculate the full revocation state of all of the credentials.

Schema

A Schema is a object that defines the set ofclaims (also known as attributes) that will be populated byissuers in issuing a give type of AnonCredsverifiable credentials. Schemas have a name, version, and are published to averifiable data registry by aschema publisher using anAnonCreds Method.Credential definitions are generated from a specific schema.

Schema Publisher

A Schema publisher is an entity that publishes aSchema to averifiable data registry. The schema publisher could be the oneissuer of a type of credential, but could also be another entity that creates aSchema to be used by manyissuers to issue the same type of credential.

Selective Disclosure

Selective disclosure is the ability to minimize data the shared data from an issuedcredential in apresentation by revealing to averifier only a subset ofclaims in thecredential. The source credential is still verified by theverifier, but only the revealed values are disclosed.

Signature Correctness Proof

AZKP-based proof that can be verified to show that a signature over a message is valid, without revealing the message or signature.

Subject

A subject, also known as an identity subject, is the entity about whom theclaims in a credential are asserted. In AnonCreds, the credential subject is not formally defined incredential. Rather, the issuance of acredential is always to a specificholder. The semantics of the credential defines the relationship between theholder and the subject, with theholder frequently being the subject.

Tails File

A tails file is a part of the AnonCreds v1.0 scheme that enables aholder to produce anon-revocation proof. A tails file is a static file generated as part of the creation of arevocation registry by theissuer, published, and retrieved by theholder of a credential that is in the relatedrevocation registry. Theholder must have the tails file in order to generate anon-revocation proof for a sourcecredential they are providing in apresentation.

Unlinkability

Unlinkability is the attribute of some verifiable credentials schemes (notably AnonCreds) such that nocorrelatable identifiers are shared in carrying out verifiable credential issuance and presentation processes. Unlinkability requires that when the processes are repeated with the same or different parties (issuers,verifiers) no common unique identifiers are shared. Note that unlinkability may be lost if there are unique identifiers shared in the revealedclaim values ofpresentations.

Verifiable Data Registry

DIDs, DID documents and publishedAnonCreds objects are stored in a verifiable data registry (VDR) such that an identifier for an object can be resolved (by anyone, in most cases), and the identified object returned. A VDR can be a distributed ledger, a blockchain, a web server, database or any other type of storage system. The process of going from the identifier to discovering and resolving the object is a DID Method (for DIDs) andAnonCreds Method (forAnonCreds objects). Resolved objects must adhere to their specified data model, regardless of the discover/resolution method used and the verifiable data registry in which the objects are stored.

Verifiable Presentation

An AnonCreds verifiable presentation is a collection ofclaims andpredicates derived from one or morecredentials with an added proof that theverifier can verifier. AnonCreds enable the holder to prove it holds a claim from a VC without revealing the VC itself. Verifying a presentation shows theissuer of the sourcecredentials, to whom the credentials where issued, that theclaims have not been tampered with, and, if applicable, that the source credentials have not been revoked. AnonCreds presentations are designed to maximize the privacy of theholder sharing the presentation.

Verifier

A verifier is an entity that verifies the information from aholder in apresentation.

Zero-knowledge proof

In cryptography, a zero-knowledge proof is a method by which an entity can prove that they know a certain value without disclosing the value itself. Zero-knowledge proofs in AnonCreds enable a number of privacy-preserving capabilities.

  • Usepredicates to minimize the data shared by theholder, such as proving based on a date of birthclaim that they are older than 18without sharing their date of birth.
  • Prove that the sourcecredentials shared in a presentation have not been revoked without sharing unique identifiers for thecredentials.

§ Cryptographic Notations

This specification contains the cryptographic calculations necessary to produce the data objects exchanged in using Hyperledger AnonCreds, and to verify the various proofs embedded in those objects. The following is information about the notations used in displaying the cryptographic calculations:

a || b : Denotes the concatenation of octet stringsa andb.

I \ J : For setsI andJ, denotes the difference of the two sets i.e., all the elements ofI that do not appear inJ, in the same order as they were inI.

X[a..b] : Denotes a slice of the arrayX containing all elements from and including the value at indexa until and including the value at indexb. Note when this syntax is applied to an octet string, each element in the arrayX is assumed to be a single byte.

range(a, b) : For integersa andb, witha <= b, denotes the ascending ordered list of all integers betweena andb inclusive (i.e., the integersi such thata <= i <= b).

length(input) : Takes as input either an array or an octet string. If the input is an array, returns the number of elements of the array. If the input is an octet string, returns the number of bytes of the inputted octet string.

H(...) : Any hash function.

Terms specific to pairing-friendly elliptic curves are:

E1, E2 : elliptic curve groups defined over finite fields. This document assumes thatE1 has a more compact representation thanE2, i.e., becauseE1 is defined over a smaller field thanE2.

G1, G2 : subgroups ofE1 andE2 (respectively) having prime orderr.

GT : a subgroup, of prime orderr, of the multiplicative group of a field extension.

e :G1 x G2 -> GT a non-degenerate bilinear map.

r : The prime order of theG1 andG2 subgroups.

P1, P2 : points onG1 andG2 respectively. For a pairing-friendly curve, this document denotes operations inE1 andE2 in additive notation, i.e.,P + Q denotes point addition andx * P denotes scalar multiplication. Operations inGT are written in multiplicative notation, i.e.,a * b is field multiplication.

§ AnonCreds Setup Data Flow

The following sequence diagram summarizes the setup operations performed by aSchema Publisher, theIssuer (one required and one optional) in preparing to issue an AnonCred credential based on providedSchema, and the one setup operation performed by eachHolder. On successfully completing the operations, theIssuer is able to issue credentials based on the givenSchema to theHolder. The subsections below the diagram detail each of these operations.

sequenceDiagram autonumber participant L as Verifiable
Data Registry participant SP as Schema Publisher participant I as Issuer participant H as Holder Note over L, H: Schema Publisher: Publish Schema SP ->> L: Publish Schema (Schema) L ->> I: Schema ID,
Schema Transaction ID Note over L, H: Issuer: Create, Store and Publish CredDef I ->> I: create_and_store_credential_def
(Schema, tag, support_revocation) Note right of I: store public /
private keys and
correctness proof I ->> L: Publish CredDef (CredDef) Note over L, H: Issuer: Create, Store and Publish Revocation Registry (Optional) I ->> I: create_and_store_revoc_reg (intCredDef) Note right of I: get keys Note right of I: store revoc_reg_def,
revoc_reg_accum,
priv_key,
tails_generator I ->> L: Publish RevReg
(revoc_reg_id,
revoc_reg_def_json,
revoc_reg_entry_json) Note over L, H: Holder: Create and Store Link Secret H ->> H: anoncreds_prover_create_link_secret H ->> H: store link secret rect rgb(191, 223, 255) Note left of H: 💡The "Verifier" role is
omitted in this
diagram, since
it is not required
for the setup end
NOTE

Those with a knowledge of DIDs might expect that in the flow above, the firststep would be for theissuer to publish a DID. However, in AnonCreds,DIDs are not used in the processing of credentials, and notably, the public keysused in AnonCreds signatures come not from DIDs, but rather fromCredential Definition objects. DIDs may be used to identify the entity publishing theobjects that are then used in the processing of credentials – theSchema,Credential Definition,Revocation Registry Definition andRevocation Status Listobjects. There is an enforced relationship between an identifier (such as a DID)for the entity publishing the AnonCred objects, and the objects themselves. Forexample, in the Hyperledger Indy implementation of AnonCreds, for a credentialissuer to publish aCredential Definition on an instance of Indy it must have a DIDon that instance, and it must use that DID to sign the transaction to write theCredential Definition.

The DID of the publisher of an AnonCreds object MUST be identifiable from thepublished object and enforcement of the relationship between the DID and theobject must be enforced. For example, in the Hyperledger Indy implementation ofAnonCreds, the DID of the object publisher is part of the identifier of theobject – given the identifier for the AnonCreds object (e.g. one found inproving a verifiable credential), the DID of the publisher can be found.Further, the Hyperledger Indy ledger enforces, and makes available forverification, the requirement that the writing of the AnonCreds object must besigned by the DID that is writing the object.

If a DID-based messaging protocol, such asDIDComm is used betweenthe AnonCreds participants (theissuer,holder andverifier) the use of DIDs for messaging is independent of their use (or not)in the publishing AnonCreds objects. Such DIDs are used to facilitate securemessaging between the participants to enable the issuing of credentials and thepresentation of proofs.

§ Schema Publisher: Publish Schema Object

Each type of AnonCred credential is based on aSchema published to a VerifiableData Registry (VDR), an instance of Hyperledger Indy in this version ofAnonCreds. TheSchema is defined and published by theSchema Publisher. Any issuerwho can reference theSchema (including theSchema Publisher) MAY issuecredentials of that type by creating and publishing aCredential Definition based on theSchema. This part of the specification covers the operation to create andpublish aSchema. The flow of operations to publish aSchema is illustrated intheSchema Publisher: Publish Schema section of theAnonCreds Setup DataFlow sequence diagram.

TheSchema is a JSON structure that can be manually constructed,containing the list of attributes (claims) that will be included in eachAnonCreds credential of this type. The following is an exampleSchema:

{"issuerId":"https://example.org/issuers/74acabe2-0edc-415e-ad3d-c259bac04c15","name":"Example schema","version":"0.0.1","attrNames":["name","age","vmax"]}

Once constructed, theSchema is published to a Verifiable Data Registry(VDR) using the Schema Publishers selectedAnonCreds Objects Method.For example, seethisSchema that is published onthe Sovrin MainNet instance of Hyperledger Indy. TheschemaId for that objectis:Y6LRXGU3ZCpm7yzjVRSaGu:2:BasicIdentity:1.0.0.

The identifier for theschema is dependent on where theSchemais published and theAnonCreds method used.

§ Issuer Create and Publish Credential Definition Object

Each Issuer of credentials of a given type (e.g. based on a specificSchema) mustcreate aCredential Definition for that credential type. The flow of operations to create andpublish aCredential Definition is illustrated in theIssuer: Create, Store and Publish Credential Definitionsection of theAnonCreds Setup Data Flow sequencediagram.

In AnonCreds, theCredential Definition andCredential Definition identifier include the following elements.

We’ll initially cover the generation and data for aCredential Definition created without theoption of revoking credentials. In the succeedingsection, we describe theadditions to the generation process and data structures whencredential revocation is enabled for a givenCredential Definition.

§ Retrieving the Schema Object

Prior to creating aCredential Definition, the Issuer must get an instance of theSchema upon which theCredential Definition will be created. If the Issueris also theSchema Publisher, they will already have theSchema. If not, the Issuer must request that information from theVDRon which theSchema is published. In someAnonCreds Objects there is a requirement that theSchema andCredential Definitionmust be on the sameVDR.

§ Generating a Credential Definition Without Revocation Support

TheCredential Definition is a JSON structure that is generated using cryptographic primitives(described below) given the following inputs.

The operation produces two objects, as follows.

The following describes the process for generating theCredential Definition andPrivate Credential Definition data.

Here is the rust implementation of the above process.

ThePrivate Credential Definition produced by the generation process has the following format:

{"p_key":{"p":"123...782","q":"234...456"},"r_key":null}
WARNING

A weakness in this specification is that theIssuer does not provide akey correctness proof to demonstrate that the generated private key issufficiently strong enough to meet the unlinkability guarantees of AnonCreds.

The proof should demonstrate that:

TheIssuerSHOULD provide a published key correctness proof basedon the approach described inJan Camenisch and Markus Michels. Proving inzero-knowledge that a number is the product of two safe primes (pages 12-13).In a future version of AnonCreds, the additional key correctness proof could bepublished separately or added to theCredential Definition prior topublication. In the meantime,Issuers in existing ecosystems can sharesuch a proof with their ecosystem co-participants in an ad hoc manner.

The lack of such a published key correctness proof allows a maliciousIssuer to deliberately generate a private key that lacks the requirementslisted above, enabling the potential of a brute force attack that breaks theunlinkability guarantee of AnonCreds.

TheCredential Definition has the following format (based on thisexampleCredential Definition on the SovrinMainNet):

{"issuerId":"did:indy:sovrin:SGrjRL82Y9ZZbzhUDXokvQ","schemaId":"did:indy:sovrin:SGrjRL82Y9ZZbzhUDXokvQ/anoncreds/v0/SCHEMA/MemberPass/1.0","type":"CL","tag":"latest","value":{"primary":{"n":"779...397","r":{"birthdate":"294...298","birthlocation":"533...284","citizenship":"894...102","expiry_date":"650...011","facephoto":"870...274","firstname":"656...226","link_secret":"521...922","name":"410...200","uuid":"226...757"},"rctxt":"774...977","s":"750..893","z":"632...005"}}}

TheCredential Definition contains a cryptographic public key that can be used toverify CL-RSA signatures over a block ofL messagesm1,m2,...,mL. TheCredential Definition contains a public key fragment for each message being signed bysignatures generated with the respective private key. The length of the block ofmessages,L, being signed is defined by referencing a specific Schema with acertain number of attributes,A = a1,a2,.. and settingL toA+1. Theadditional message being signed as part of a credential is for alink_secret(called thelink secret everywhere except in the existing open sourcecode and data models) attribute which is included in all credentials. This valueis blindly contributed to the credential during issuance and used to bind theissued credential to the entity to which it was issued.

All integers within the aboveCredential Definition example json are shown with ellipses (e.g.123...789). They are 2048-bit integers represented as617 decimal digits. These integers belong to an RSA-2048 group characterised by then defined in theCredential Definition.

The identifier for theCredential Definition is dependent on where theCredential Definition is published and theAnonCreds method used.

§ Generating a Credential Definition With Revocation Support

The issuer enables the ability to revoke credentials produced from aCredential Definition bypassing to theCredential Definition generation process the flagsupport_revocation astrue.When using revocation in a credential, private key material is addedto thePrivate Credential Definition to allow the issuer torevoke credentials, and public key material is added to theCredential Definition to allow a verifier to check revocationstatus. The following describes the fields added to thePrivate Credential Definition and theCredential Definition.

The revocation scheme uses a pairing-based dynamic accumulator definedas a variant of theCKS scheme but with aType 3 elliptic curve pairing instead of a Type 1 pairing. The curveEE isBN254, which is definedover a 254-bit primepp. The pairing is an Ate pairinge:G1×G2GTe : G_1\times G_2 \rightarrow G_T whereG1=E(Fp)G_1 = E(\mathbb{F}_p),G2=E(Fp2)G_2 =E(\mathbb{F}_{p^2}), andGTG_T is the group ofqthq^{\text{th}} rootsof unity inFp12\mathbb{F}_{p^{12}} whereq=E(Fp)q=|E(\mathbb{F}_p)|, whichis another 254-bit prime.

In the amcl library used for the elliptic curve arithmetic, points arerepresented using projective co-ordinates, i.e. a point(X/Z,Y/Z)(X/Z,Y/Z) onthe curveEE is mapped to a projective point(X:Y:Z)(X: Y: Z).Additionally, the big-integer co-ordinates are strings of 64hexadecimal characters, meaning there are up to 64 * 4 - 254 = 2 bits of‘excess’ in each encoding. The library includes the excess number ofbits as an integer (i.e.1 or2) before the hexadecimalstring. The upshot is:

NOTE

In this section, multiplicative notation is used: a pointPPon an elliptic curveEE is considered an elementgg in the groupGGof points on the curveEE, and for an integerkk modulo the grouporderqq, we writegkg^k to mean the pointkPk \cdot P.

§ Private Revocation Keys

APrivate Credential Definition with revocation enabled has the following format. In this, thedetails of thep_key element are omitted, as they are the same as was coveredinthe section above. The implementation can be found in theanoncreds-clsignatures-rs repository.

{"p_key":{"p":"123...782","q":"234...456"},"r_key":{"x":"332...566","sk":"992...237"}}

The valueqq is the order of the groupG1=E(Fp)G_1=E(\mathbb{F}_p) on the curve BN254 (see above:qq is a 254-bit prime).x andsk are used to generate parts of the revocation public key as described below.

NOTE

The issuer additionally holds a secret valuegamma used to constructthe accumulator. This is inside theRevocationKeyPrivate object inanoncreds-clsignatures-rs,which is separate from theCredentialRevocationPrivateKey objectthat storessk andx.

§ Public Revocation Keys

ACredential Definition with revocation enabled has the following format (fromthisexample Credential Definition on theSovrin MainNet). In this, the details of theprimary element are omitted, asthey are the same as was covered above.

{"issuerId":"did:indy:sovrin:F72i3Y3Q4i466efjYJYCHM","schemaId":"did:indy:sovrin:F72i3Y3Q4i466efjYJYCHM/anoncreds/v0/SCHEMA/state_license/4.2.0","type":"CL","tag":"latest","value":{"primary":{...},"revocation":{"g":"1 154...813 1 11C...D0D 2 095..8A8","g_dash":"1 1F0...3B5 1 229...41D 1 04B...F7D 1 061...8B7 2 095...8A8 1 000...000","h":"1 131...0DD 1 0D5...66E 2 095...8A8","h0":"1 1AF...246 1 127...361 2 095...8A8","h1":"1 242...F14 1 1AC...2FF 2 095...8A8","h2":"1 072...7A1 1 09E...622 2 095...8A8","h_cap":"1 196...C53 1 238...38B 1 196...C7E 1 198...D31 2 095...8A8 1 000...000","htilde":"1 1D5...797 1 034...232 2 095...8A8","pk":"1 0E7...A88 1 007...4B8 2 095...8A8","u":"1 18E...44B 1 018...F71 1 0D8...2C2 1 003...4CF 2 095...8A8 1 000...000","y":"1 068...F6B 1 16C...F7E 1 01F...68A 1 1E3...9F9 2 095...8A8 1 000...000"}}}

In the following, only therevocation item is described, as the rest of items (primary,ref, etc.) are described in the previous section of this document.

§ Publishing the Credential Definition on a Verifiable Data Registry

Once constructed, theCredential Definition is published by the Issuer to aVerifiable Data Registry using the issuers preferredAnonCreds Objects.

For example, seethisCredential Definition that is publishedin the Sovrin MainNet instance of Hyperledger Indy. Note that the contents of theCredential Definition that have are published to the Hyperledger Indy ledger, do not exactly match theCredential Definition data model. The specificAnonCreds Objects can describe how to resolve the contents stored on the ledger into theCredential Definition data model.

§ Issuer Create and Publish Revocation Registry Objects

Once theissuer has created aCredential Definition with revocationenabled, theissuer must also create and publish aRevocation Registry Definition andcreate and publish the firstRevocation Status List for the registry.

In this section, we’ll cover the create and publish steps for eachof theRevocation Registry Definition andRevocation Status List objects. The creation andpublishing of theRevocation Registry Definition includes creating and publishing theTAILS_FILE for theRevocation Registry.

§ Creating the Revocation Registry Object

A secure process must be run to create the revocation registry object, takingthe following input parameters.

Three outputs are generated from the process to generate theRevocation Registry: theRevocation Registry object itself, theTAILS_FILE content, and thePrivate Revocation Registry object.

§ Revocation Registry Definition Object Generation

TheRevocation Registry Definition object has the following data model. This example is fromthis transaction on theSovrin MainNet and instance of Hyperledger Indy.

{"issuerId":"did:web:example.org","revocDefType":"CL_ACCUM","credDefId":"Gs6cQcvrtWoZKsbBhD3dQJ:3:CL:140384:mctc","tag":"MyCustomCredentialDefinition","value":{"publicKeys":{"accumKey":{"z":"1 0BB...386"}},"maxCredNum":666,"tailsLocation":"https://my.revocations.tails/tailsfile.txt","tailsHash":"91zvq2cFmBZmHCcLqFyzv7bfehHH5rMhdAG5wTjqy2PE"}}

The items within the data model are as follows:

TODO

Update this to be the inputs for generating a Revocation Registry vs. the already published object

As noted, most of the items come directly from the input parameters provided bytheissuer. ThezRevocation Registry accumulator public key isgenerated using (TODO: fill in details) algorithm. The use of the accumulatorpublic key is discussed in the Credential Issuance section, when the publicationof revocations is described. The calculation of the tailsHash is described inthenext section onTAILS_FILEgeneration.

The identifier for theRevocation Registry is dependent on where theRevocation Registry is published and theAnonCreds method used.

§ Tails File and Tails File Generation

The second of the outcomes from creating of aRevocation Registry is aTAILS_FILE. The contents of aTAILS_FILE is an array of calculatedpoints on curveG2, one for each credential in the registry. Thus, if theRevocation Registry has a capacity (maxCredNum) of 1000, theTAILS_FILE holdsan array of 1000G2 curve points. Each credential issued using theRevocation Registry isgiven its own index (1 to the capacity of theRevocation Registry) into the array,the index of the point for that credential. The contents of theTAILS_FILE is needed by theholder to produce(if possible) a “proof of non-revocation” to show their issued credential hasnot been revoked.

The process of generating the points that populate theTAILS_FILE aretail[index] = g_dash * (gamma ** index)

NOTE

Detailed process for tails file generation:

Relevant links:Anoncreds-rs repository,Anoncreds-CLSignatures repository

The process for hashing theTAILS_FILE is as follows:

The SHA256 hash of the array of points is returned to be inserted into thetailsHashitem of theRevocation Registry object (as described in theprevioussection). Typically, the array is streamed into afile (hence, the term “Tails File”) and published to aURL indicated bythetailsLocation input parameter provided by theissuer.

The format of aTAILS_FILE is as follows:

Thus the total size of a Tails File is 2+ 12*Size of the Revocation Registry+6 (the L+1 entry).

While not required, the Hyperledger Indy community has created a component, the “Indy TailsServer,” which is basically a webserver for tails files.Holders get thetailsLocation during theissuance process, download theTAILS_FILE (ideally) once and cache itfor use when generating proofs of non-revocation when creating a presentationthat uses its revocable verifiable credential. How theTAILS_FILE isused is covered elsewhere in this specification:

§ Revocation Registry Definition Object Generation

In addition to generating theRevocation Registry object, aPrivate Revocation Registry object is generated and securely stored by theissuer. The data model and definition of the items in thePrivate Revocation Registry is as follows:

TODO

To Do: Fill in the details about the Revocation Registry Definition

§ Publishing the Revocation Registry Object

Once constructed, theRevocation Registry is published by theissuer in aVerifiable Data Registry using the issuer’sAnonCreds Objects. For example, seethisRevocation Registry that is publishedon the Sovrin MainNet instance of Hyperledger Indy. The binaryTAILS_FILE associated with theRevocation Registry can be downloaded from thetailsLocation in theRevocation Registry object.

§ Creating the Initial Revocation Status List Object

PublishedRevocation Status List objects contain the state of theRevocation Registry at a given point in time such thatholders can generate aproof of non-revocation (or not) about their specific credential andverifiers can verify that proof. An initialRevocation Status List isgenerated and published immediately on creation of theRevocation Registry so thatit can be used immediately byholders. Over time, additionalRevocation Status List objects are generated and published as the revocation status ofone or more credentials within theRevocation Registry change.

A secure process must be run to create the initialRevocation Status List object,taking the following input parameters.

The process collects from the identifiedPrivate Revocation Registry information tocalculate the cryptographic accumulator value for the initialRevocation Status List, including:

With the collected information, the initial cryptographic accumulator for theRevocation Registry can be created. The format of the identifier for theRevocation Status List is dependent on theAnonCreds Objects Methodused by the issuer.

In simple terms, the cryptographic accumulator at any given point in time is the(modulo) product of the primes for each non-revoked credential in theRevocation Registry.

If all of the credentials are initially revoked (revocationList only contains1 values), the accumulator value is0.

The accumulator is calculated using the following steps:

TODO

To Do: Adding the algorithm for calculating the accumulator

THe following is an example of an initial, publishedRevocation Status List object:

{"revRegDefId":"4xE68b6S5VRFrKMMG1U95M:4:4xE68b6S5VRFrKMMG1U95M:3:CL:59232:default:CL_ACCUM:4ae1cc6c-f6bd-486c-8057-88f2ce74e960","revocationList":[0,1,1,0],"currentAccumulator":"21 124C594B6B20E41B681E92B2C43FD165EA9E68BC3C9D63A82C8893124983CAE94 21 124C5341937827427B0A3A32113BD5E64FB7AB39BD3E5ABDD7970874501CA4897 6 5438CB6F442E2F807812FD9DC0C39AFF4A86B1E6766DBB5359E86A4D70401B0F 4 39D1CA5C4716FFC4FE0853C4FF7F081DFD8DF8D2C2CA79705211680AC77BF3A1 6 70504A5493F89C97C225B68310811A41AD9CD889301F238E93C95AD085E84191 4 39582252194D756D5D86D0EED02BF1B95CE12AED2FA5CD3C53260747D891993C","timestamp":1669640864487}

The items in the data model are:

§ Publishing the Initial Initial Revocation Status List Object

Once constructed, the initialRevocation Status List is published by theissuer in aVerifiable Data Registry using their selectedAnonCreds Objects Method.

It is not required for theVerifiable Data Registry to store the revocation list as defined in this model. For example, the Indy ledger uses deltas (Revocation Registry Entries) to store the change in revoked/un-revoked indices instead of storing the entire revocation list. It is also possible to compress therevocationList entry using e.g. GZIP to reduce the size on the ledger.

§ Holder Create and Store Link Secret

To prepare to use AnonCreds credentials, theHolder must create alink secret, a unique identifier that allows credentials issued to aHolder to be bound to thatHolder and presented withoutrevealing a unique identifier, thus avoiding correlation of credentials byVerifiers. Thelink secret is kept private by theHolder. Thelink secret is used during the credential issuanceprocess to bind the credential to theholder and in the generation of apresentation. For the latter, it allows theholder to create a zeroknowledge proof that they were issued the credential.This proof demonstrates knowledge thelink secret and prove that it is one of the signed credential attributes, without revealing thelink secret to theverifier. The details of howthelink secret is used to do this is provided in the issuance,presentation generation and verification sections of this specification.

Thelink secret is a sufficiently random unique identifier. Forexample, in the Hyperledger Indy implementation, thelink secret isproduced by a call to the Rustuuid Crate’snew_v4() method toachieve sufficient randomness.

Once generated, thelink secret is stored locally by theHolder for use in subsequent issuance and presentation interactions. If lost,theHolder will not be able to generate a proof that the credential wasissued to them. Theholder generates only a singlelink secret, using it for all credentials theholder is issued. Thisallows forverifiers to verify that all of the credentials used ingenerating a presentation with attributes from multiple credentials were allissued to the sameHolder without requiring theHolder todisclose the unique identifier (link secret) that binds thesecredentials together.

There is nothing to stop aHolder from generating multiplelink secrets and contributing them to different credential issuance processes.However, doing so prevents theHolder from producing a presentationcombining credentials issued to distinctlink secrets that can beproven to have been issued to the same entity. It is up to theVerifierto require and enforce the binding between multiple credentials used in apresentation.

§ AnonCreds Issuance Data Flow

The issuance of an anonymouscredential requires several steps and involves the rolesissuer,holder as well as theVerifiable Data Registry (see diagram below).

sequenceDiagram autonumber participant L as Verifiable
Data Registry participant I as Issuer participant H as Holder I ->> I: Create Credential Offer I ->> H: Send Credential Offer H ->> H: Verify Credential Offer opt H ->> L: Request Schema L ->> H: Return Schema end H ->> L: Request Credential Definition L ->> H: Return Credential Definition H ->> H: Create Credential Request H ->> I: Send Credential Request I ->> I: Verify Credential Request I ->> I: Issue Credential I ->> H: Send Credential H ->> H: Remove Credential Blinding H ->> H: Verify and Store Credential rect rgb(191, 223, 255) Note left of H: 💡The "Verifier" and "Schema Publisher" roles are
omitted in this diagram, since they do not participate
in the credential issuance data flow. end

Theissuer prepares aCredential Offer for theholder (step 1). ACredential Offer includes a commitment about thecredential (referencing aPublic Credential Definition) theissuer is intending to issue to theholder. Theissuer sends theCredential Offer to theholder (step 2), who evaluates the offer (step 3) and fetches data about the offer (thePublic Credential Definition) from theVerifiable Data Registry (steps 4-7).

Using the data from theCredential Offer and thePublic Credential Definition retrieved from theVerifiable Data Registry, theholder prepares aCredential Request (step 8), a formal request to theissuer to issue acredential based on the givenPublic Credential Definition to theholder. TheCredential Request includes a cryptographic commitment to theholder'slink secret. Theholder sends theCredential Request to theissuer (step 9).

Theissuer verifies and decides whether to accept theCredential Request (step 10) and if so, prepares thecredential (step 11). Theissuer sends thecredential to theholder (step 12). Theholder then removes the blinding factor from the credential (step 13), verifies thecredential and (usually) securely stores it (step 14).

Details about each step in the issuance process are covered in the following sections.

§ Credential Offer

The AnonCreds issuance process begins with theissuer constructing and sending aCredential Offer to the potentialholder. The Credential Offer contains the following JSON elements:

{"schema_id": string,"cred_def_id": string,"nonce": string,"key_correctness_proof": <key_correctness_proof>}

The JSON content of thekey_correctness_proof is:

"key_correctness_proof":{"c":"103...961","xz_cap":"563...205","xr_cap":[["<attribute 1>","821...452"],["master_secret","156...104"],["<attribute 1>","196...694"]]}

The values in the proof are generated as follows:

c=H(zriz~ri~)c = H(z || {r_i} || \tilde{z} ||\tilde{r_i})

where

Bothxz_cap and the second element in the tuple of thexr_cap vectorareBigNumbers.

Theissuer sends theCredential Offer to theholder.

§ Credential Request

ACredential Request is a formal request from aholder to anissuer to get acredential based on theCredential (and the referencedPublic Credential Definition) sent by theissuer to theholder.

On receipt of theCredential Offer, theholder retrieves thereferencedPublic Credential Definition from aVerifiable Data. The holder MAY want to retrieve theSchema referenced intheCredential Offer and verify the consistency between the list ofattributes in theSchema and in thePublic Credential.

In addition, theholder also requires access to theirlink.

The nonce of theCredential Offer is used to generate the proof of correctnessfor blinded credential secrets, where it is hashed with the blinded secrets tocreate the proof which is sent to theissuer.

§ Verifying the Key Correctness Proof

Theholder must first verify thekey_correctness_proof in theCredential Offer using data from the referencedPublic Credential Definition. Thekey_correctness_proof data is described in theprevioussection about theCredential Offer.

Thekey_correctness_proof verification is as follows:

  1. Check that all attributes inPublic Credential Definition andmaster_secret (anattribute that will be related to thelink secret) are included inxr_cap.
  2. Computecc', wherec=H(zriz^ri^)c' = H(z || {r_i} || \hat{z'} ||\hat{r_i'}).
  3. Ifz^==z~\hat{z'} == \tilde{z} andri^==ri~\hat{r_i'} == \tilde{r_i}, thenc==cc' == c. The proof is accepted.

Forz^\hat{z'}, we first find the multiplicative inverse ofzz

z1z=1 (Mod n)z^{-1}z = 1\ (Mod\ n)

Then

z^=zcsxz^ (Mod n)\hat{z'} = z^{-c} s^{\hat{x_z}} \ (Mod\ n)

=zcscxz+xz~ (Mod n)= z^{-c} s^{cx_z + \tilde{x_z}}\ (Mod\ n)

=zczcsxz~ (Mod n)= z^{-c} z^{c} s^{\tilde{x_z}}\ (Mod\ n)

z^=z~\hat{z'} = \tilde{z}

The same can be derived for allri^\hat{r_i'} by finding the multiplicative inverse ofrir_i, where {1 < i < L} forLL attributes.

§ Constructing the Credential Request

Theholder constructs the followingCredential Request JSON structure:

{"prover_did":"BZpdQDGp2ifid3u3Up17MG","cred_def_id":"GvLGiRogTJubmj5B36qhYz:3:CL:8:faber.agent.degree_schema","blinded_ms":{        # Structure detailed below},"blinded_ms_correctness_proof":{        # Structure detailed below},"nonce":"604812518357657692681285"}

Once constructed, theholder sends theCredential Request to theissuer, who then can reply to theholder by sending an issued credential.

§ Blinding the Link Secret

Theholder generates ablinding factor and uses this to create a cryptographic commitment to theirlink secret. This is theblinded_ms (blinded link secret) in theCredential Request. Theblinded_ms will be signed by theissuer along with the rest of the credential attributes to create a blinded Signature. Theholder removes theblinding factor from the blinded Signature to retrieve the Credential Signature over their unblindedlink secret and the credential attributes.

During presentations, theholder can prove knowledge of thelink secret within credential or set of credentials being presented, without revealing thelink secret itself. This is the capability that enables the binding of thecredentials to each other and to theholder without revealing a correlatable identifier.

TODO

Confirm purpose of the blinding factor and add how it is generated.

Theblinding factor is a secret generated by theholder for blindingthelink secret before sending it to theissuer. Theblinding factor,vv is created by selecting a random integer that is less than the order of the RSA group,n.

The process of blinding the link secret uses theissuer'sCredentialPrimaryPublicKey,PP, which is included in thePublic Credential Definition,and containsz,r,s andn (describedhere). Whiler containsthe public keys for all of the attributes to be signed, the only one of interestin this process isrlinksecretr_{link_secret}

Thelink secret,AlA_l is blinded by

Abl=rlinksecretAl Mod nA_{bl} = r_{link secret}^{A_l}\ Mod\ n

AblA_{bl} is multiplied by theblinding factor,vv',

(sv×Abl) Mod n(s^{v'} \times A_{bl})\ Mod\ n

The resulting blinded link secret data structure inserted into theCredential Offer is defined as follows:

"blinded_ms":{"u":"331...544","ur":null,  # Populated when the credential definition supports revoation"hidden_attributes":["master_secret"],"committed_attributes":{}}

Where:

§ The Blinded Link Secret Correctness Proof

In addition to creating the blinded link secret, theholder also creates a blinded link secret correctness proof and inserts it into theCredential Request. The data structure for the blinded link secret correctness proof is as follows:

"blinded_ms_correctness_proof":{"c":"702...737","v_dash_cap":"202...924","m_caps":{"master_secret":"907...913"},"r_caps":{}}

The values in the proof are generated as follows:

c=H(uu~n0)c = H(u || \tilde{u} || n_0)

where

§ Issue Credential

After theissuer receives theCredential Request from theholder, theissuer processes theCredential Request and decides whether to issue the credential as requested in theCredential Request to theholder. In this section, we’ll cover issuing a credential that cannot be revoked, and then cover the additional steps/data elements in issuing a credential that can be revoked.

§ Verifying the Credential Request

Before deciding to issue the credential, theissuer must first verify theCredential Request from theholder by using the nonce from credential offer (n0n_0) to verify the blinded link secret correctness proof.

Theblinded_ms_correctness_proof is verified byissuer. Theblinded_ms_correctness_proof verification is as follows:

  1. Computecc', wherec=H(uu^n0)c' = H(u || \hat{u} || n_0).
  2. Ifu^==u~\hat{u} == \tilde{u}, thenc==cc' == c. The proof is accepted.

Foru^\hat{u}, we first find the multiplicative inverse ofuu

u1u=1 (Mod n)u^{-1}u = 1\ (Mod\ n)

Then

u^=uc×rlinksecretm^×sv^ (Mod n)\hat{u} = u^{-c} \times r_{linksecret}^{\hat{m} } \times s^{\hat{v'}} \ (Mod\ n)

=uc×rlinksecretAl~+cAl×sv~+cv (Mod n)= u^{-c} \times r_{linksecret}^{\tilde{A_l}+ cA_l } \times s^{ \tilde{v'} + cv'}\ (Mod\ n)

=uc×uc×rlinksecretAl~×sv~ (Mod n)= u^{-c} \times u^{c} \times r_{linksecret}^{\tilde{A_l}} \times s^{\tilde{v'}}\ (Mod\ n)

u^=u~\hat{u} = \tilde{u}

Once the Credential Request is verified and if theissuer decides to proceed with issuing the credential, the credential creation process is performed.

§ Encoding Attribute Data

The Anoncreds signature is not applied on the data attributes themselves, but rather on 32-byte integers encoded from the data attribute values. In the current version of AnonCreds, the process of encoding the attributes (also known as canonicalization) isa task performed by theissuer, who should do the encoding in a manner understood byall potentialverifiers such that any verifier can confirm that the revealedraw attributes in the presentation producethe encoded value signed by theissuer. To enable the broadest possible interoperability, theHyperledger Aries community formalized thefollowing encoding rules for theraw attribute values in an AnonCreds credential, and those rules are adopted into this specification, as follows:

An example implementation in Python of these rules can be foundhere.

A gist of test value pairs can be foundhere.

NOTE

To enable broad interoperability, and to improve the security of AnonCreds byeliminating the risk of maliciousholders altering theraw datavalues in hopes that theverifier will not check the encoding as partof the overall presentation verification, future versions of AnonCredscredentials will not includeissuer-created encoded values in the AnonCredscredentials, and will insteadrequire the encoding of theraw data values on as needed basis.

Implementations of AnonCredsMAY

§ Constructing a Credential

To construct a non-revocablecredential, theissuer must have available:

Additional data is needed for issuing a revocable credential, as described in the sectionSupporting Revocation in a Credential.

The JSON of a generated AnonCreds credential is as follows:

{"schema_id": string,"cred_def_id": string,"rev_reg_id":null,"values":{"first_name":{"raw":"Alice","encoded":"113...335"},"last_name":{"raw":"Garcia","encoded":"532...452"},"birthdate_dateint":{"raw":"19981119","encoded":"19981119"}},"signature":{"p_credential":{"m_2":"992...312","a":"548...252","e":"259...199","v":"977...597"},"r_credential":null},"signature_correctness_proof":{"se":"898...935","c":"935...598"},"rev_reg":null,"witness":null}

Once constructed, theissuer sends the credential to theholder for verification and storage.

NOTE

Please note the data attribute “birth_dateint” in the example above. The convention ofputting a_dateint suffix on a credential attribute name is used to indicatethat the field contains a date in the form of an integer, such as “2022.11.21”as the integer “20221121” (the number 20,221,121). By putting the date in thatform, AnonCreds predicates can be applied to the data, such as proving “olderthan 21” based on date of birth without sharing the date of birth. Thisconvention was initially definedhereby theHyperledger Ariescommunity.

§ The Credential Signature

The credential signature elements are constructed as follows:

  1. Computeq=Zusvrlinksecretm (Mod n)q = \frac{Z}{us^{v''}r^{m}_{linksecret}\ (Mod\ n)} wherevv'' is a random 2724-bit number with most significant bit as11 andee is a random prime such that2596e2596+21192^{596} \leq e \leq 2^{596}+2^{119}
  2. Computea=qe1 (Mod pq) (Mod n)a = q^{e^{-1}\ (Mod\ p'q')}\ (Mod\ n) wherep,qp', q' are primes generated during issuer setup, ande1e^{-1} is the multiplicative inverse ofee.

§ The Credential Signature Correctness Proof

The credential signature correction proof elements are constructed as follows:

Using randomr<pqr<p'q', compute

a^=qr(Mod n)\hat{a} = q^r (Mod\ n)

c=H(qaa^n1)c = H(q||a||\hat{a}||n_1)

wheren1n_1 is thenonce from credential request andHH is SHA-256 hashing algorithm.Signature correctness proofse=rce1(Mod pq)s_e = r - ce^{-1} (Mod\ p'q').

§ Supporting Revocation in a Credential

When a credential is revocable, in addition to the listed inputs needed forconstructing a credential,theissuer also needs the ID and privateRevocation Registry data. Using the inputs, the revocation-related fields in thecredential JSON are populated. Thefollowing describes the elements and how they are produced.

rev_reg_id is the ID of theRevocation Registry Definition published on aVerifiable Data Registry that is to be used by theholder when trying to generate a Non-Revocation Proof for this credential as part of an AnonCreds presentation.

r_credential is the following JSON data structure:

"r_credential":{"sigma":"1 14C...8A8","c":"12A...BB6","vr_prime_prime":"0F3...FC4","witness_signature":{"sigma_i":"1 1D72...000","u_i":"1 0B3...000","g_i":"1 10D...8A8"},"g_i":"1 10D7...8A8","i":1,"m2":"FDC...283"}

The items in the data structure are:

σ=(h0h1m2 . ur . gi . h2vr)1x+c\sigma = (h_0h_1^{m_2}\ .\ u_r\ .\ g_i\ .\ h_2^{v_r''})^{\frac{1}{x+c}}

whereh0h_0,h1h_1 are from revocation public key,uru_r is from the blinded credential secrets,gi=gγig_i = g^{\gamma^i} whereii is the issuer’s accumulator index,h2h_2 is from revocation public key, andxx is from the revocation private key.

rev_reg is the following JSON data structure:

"rev_reg":{"accum":"21 118...1FB"}

The item in the data structure is:

witness is the following JSON data structure:

"witness":{"omega":"21 124...AC8"}

The item in the data structure is:

§ Receiving a Credential

On receipt of a credential from anissuer, theholder mustverify the credential and, if verified, will likely store the credential in asecure location.

To verify thesignature_correctness_proof, theholder does the following:

qZSiinCsRimi(Mod n)q \leftarrow \frac{Z}{S \prod\limits_{i in C_s} R_i^{m_i}} (Mod\ n)

The verifying and securely storing of the credential by theholdercompletes the AnonCreds issuance process.

An AnonCreds credential is expected to be retained by theholder thatparticipated in the issuance process. Theholder should not transferthe credential to others for their use, and should only use the credential togenerate an AnonCreds verifiable presentation, as outlined in theAnonCreds Presentation section of this specification.

§ AnonCreds Presentation Data Flow

sequenceDiagram autonumber participant L as Verifiable
Data Registry participant SP as Schema Publisher participant I as Issuer participant H as Holder participant V as Verifier Note over L, V: AnonCreds Presentation Data Flow V->>V: Create presentation request V->>H: Send presentation request H->>H: Select credentials to satisfy the presentation request H->>L: If necessary: Request revocation entries L->>H: Return revocation entries H->>H: Generate presentation H->>V: Send presentation V->>L: Request credential definitions, revocation entries L->>V: Return credential definitions, revocation entries V->>V: Verify presentation

The flow of operations to request, create, and verify a verifiable presentationis illustrated in theAnonCreds Presentation DataFlow sequence diagram.

The Verifier starts the process in step 1 by creating and sending a presentationrequest to the Holder.

In step 2, the Verifier sends the presentation request to the Holder.

In steps 3-6, the Holder collects the required information and creates theverifiable presentation to satisfy the presentation request received from theVerifier. If the Holder does not have the necessary credentials to satisfy therequest, the Holder may ignore the presentation.

In step 7, the Holder sends the verifiable presentation according to thepresentation request to the Verifier.

In step 8-10, the Verifier collects the required information and verifies theverifiable presentation and accepts it if the signature is valid, otherwiserejects the verifiable presentation.

TODO

Question: VDR access for schema, revocation etc. retrieval mandatory?

§ Create Presentation Request

Theverifier starts the presentation process in step 1 of theAnonCreds Presentation DataFlow by creating and sending apresentation to theholder.

Thepresentation request provides information about the attributes andpredicates theverifier is asking the theholder to reveal,restrictions on what verifiable credentials can be the sources for theattributes and predicates, and limitations on the freshness of the credentialrevocation status. Presentation requests are defined at the “business logic”layer, with any cryptographic processing applied. The verification processincludes verifications that the presentation satisfies the request. Theverifier SHOULD validate that the presentation satisfies the businessrequirements for which the presentation was provided.

In reading this section, the termattribute is used in two ways, and readersshould be aware of the context of each use. A presentation request has **requestedattributes that are to be included in the presentation provided from theholder. Those requested attributes in turn referenceattribute names andvalues from source verifiable credentials held by theholder.

Thepresentation request is created by theverifier in JSON format, as follows:

{"name": string,"version": string,"nonce": string,"requested_attributes":{"<attr_referent>": <attr_info>,        ...,},"requested_predicates":{"<predicate_referent>": <predicate_info>,        ...,},"non_revoked": Optional<non_revoc_interval>,"ver": Optional<str>}

attr_info has the following format:

{"name": <string>,"names": <[string, string]>,"restrictions": <restrictions>,"non_revoked": <non_revoc_interval>,}

All of the items are optional, but one ofname ornames MUST be included, and not both.

predicate_info has the following format:

{"name": string,"p_type": string,"p_value": int,"restrictions": <restrictions>,"non_revoked": <non_revoc_interval>,}

§ Restrictions

Therestrictions item on attributes (optional) and predicates (required) is aJSON structure that forms a logical expression involving properties of thesource verifiable credential. Theholder must use source verifiablecredentials that satisfy therestrictions expression for eachattribute/predicate entry. Each element of the logic expression is a property ofsource credentials and a value to be matched for that property. The followingproperties can be specified in the JSON. All except themarker property isspecified with a value that must match the property. For themarker property,the value is always1.

A boolean expression is formed by ORing and ANDing the source credentialproperties. The following JSON is an example. Any of the source credentialproperties listed above can be used in the expression components:

"restrictions":[{"issuer_did":"<did>","schema_id":"id"},{"cred_def_id":"<id>","attr::color::marker":"1","attr::color::value":"red"}]

The properties in each list item are AND’d together, and the array elements areOR’d together. As such, the example above defines the logical expression:

The attributes must come from a source verifiable credential such that:   issuer_did = <did> AND     schema_id = <id>   OR   cred_def_id = <id> AND      the credential must contain an attribute name "color" AND      the credential must contain an attribute name "color" with the attribute value "red"

§ Request Non-Revocation Proofs

Thepresentation request JSON itemnon_revoked allows theverifier to define an acceptable non-revocation interval for a requestedattribute(s) / predicate(s), as follows:

{"from": Optional<int>,"to": Optional<int>,}

As noted in thepresentation request specification above, anon-revoked itembe may at the outer level of thepresentation request such that it applies toall requested attributes and predicates, and/or at the attribute/predicate level, applyingonly to specific requested attributes and/or predicates and overriding the outer layer item.

Thenon-revoked items apply only to requested attributes/predicates in a presentationthat derive from revocable credentials. No proof of non-revocation is needed (orpossible) from credentials that cannot be revoked. Verifiers should be awarethat different issuers of the same credential type (sameschemaId) may or maynot use revocation for the credentials they issue.

The use of a “non-revoke interval” was designed to have the semantic meaningthat theverifier will accept a non-revocation Proof (NRP) from anypoint in thefrom toto interval. The intention is that by being as flexibleas the business rules allow, theholder and/orverifier mayhave cachedVDR revocation data such that they don’t have to go to theVDR to get additionalRevRegEntry data. The verification ofthe provided non-revocation interval in apresentation request islimited. For additional details, see theVerify Non-Revocation Proof section of thisspecification.

In practice, the use of the interval is not well understood and tends to causeconfusion amongst those buildingpresentation requests. The AnonCredscommunity recommends using matchingfrom andto values as outlined in theAries RFC 0441 Present Proof BestPractices.Theverifier can then use business rules (outside of AnonCreds) todecide if the revocation is sufficiently up to date.

While one might expect theto value to always be the current time (“Prove thecredential is not revoked now”), its inclusion allows theverifier toask for a non-revocation proof sometime in the past. This addresses use casessuch as “Prove that your car insurance policy was not revoked on June 12, 2021when the accident occurred.”

§ Presentation Request Example

The following is an example of a fullpresentation request for a presentationfor a set of revealed attribute names from a single source credential, a self-attestedattribute, and a predicate.

{"nonce":"168240505120030101","name":"Proof of Education","version":"1.0","requested_attributes":{"0_degree_uuid":{"names":["name","date","degree"],"restrictions":[{"schema_name":"degree schema"}]},"0_self_attested_thing_uuid":{"name":"self_attested_thing"},"non_revoked":{"from":1673885735,"to":1673885735,}},"requested_predicates":{"0_age_GE_uuid":{"name":"birthdate_dateint","p_type":"<=","p_value":20030101,"restrictions":[{"schema_name":"degree schema"}]}}}

In step 2 of theAnonCreds Presentation Data Flow,theverifier sends thepresentation request to theholder.

§ Generate Presentation

In step 3, 4, and 5 of theAnonCreds Presentation DataFlow, theholder collects the requiredinformation to create the verifiable presentation according to thepresentation request receivedfrom theverifier.

Each attribute and predicate in the presentation request must be satisfied by asource credential held by theholder that meets the associatedrestrictions item in the presentation request. The same source credential MAYbe used to satisfy multiple attributes and predicates. Each attribute in thepresentation request may specify (using thenames item) that multipleclaims from the source credential must be shared. If there is norestrictions itemin the presentation request, theholder MAY satisfy the presentation requestwith self-attested attributes.

NOTE

To prevent confusion, the term “attribute” in this sectionalways refers totherequired_attributes in a presentation request, and the term “claim” isused for the data elements in a verifiable credential.

Theverifier may specify in the presentation request that if some orall of the attributes/predicates are to be satisfied by revocable credentials,theholder must accompany the verifiable credential proofs withnon-revocation proofs (NRPs) for the source credentials. The generation of NRPsis describedin the generate non-revocation proofssection of the specification.

NOTE

Often in discussions about verifiable presentations, the term “prover”is used to indicate the participant generating the presentation. Throughout theHyperledger AnonCreds implementation the termprover is used in the names ofmethods performed by that participant. However, because in AnonCreds theholder and theprover are always the same entity, we’ll useholder to refer to the participant generating the requested presentation toemphasize that the same entity is both issued credentials and generatingpresentations from those credentials.

§ Collecting the Source Verifiable Credential Data

Before theholder can generate the presentation to satisfy a request,the source verifiable credentials that will be used in the presentation must becollected.

The source verifiable credentials found for use in generating a presentationmust meet the following requirements:

The mechanism to find the credentials in the holder’s wallet that satisfy apresentation request is outside the scope of this specification. As such, theremainder of this section covering how this process is done in Hyperledger Ariesimplementations is non-normative.

Aries implementations have historically used a mechanism calledWallet QueryLanguage (WQL) to find the source credentials in theholder agent’sstorage. Agents iterate through the presentation request attributes andpredicates, converting therestrictions item from each into a correspondingWQL query, and calling an Aries key management service, such asAries Askar,to return the credentials in the wallet that satisfy the query.

Completing the process results in a list of 0 or more source verifiablecredentials that satisfy each attribute and predicate. If there is not a sourceverifiable credential for each, a business process must be invoked to decide ifor how to proceed. For example, if some of the attributes or predicates cannotbe satisfied with a credential already in theholder's storage, aprocess to get the necessary additional verifiable credentials may be initiated.If more than one verifiable credential satisfy any of therestrictions items,theholder software might select one to use by default, such as themost recently issued, non-revoked of the credentials, and/or might invoke a userinterface to allow the entity that controls theholder software toselect from the set of possible credentials to use.

In order to proceed to the presentation generation step, there must be onecredential selected for each attribute and predicate in the presentationrequest.

§ Prepare Inputs to Presentation Generator

The next step of the process to create a presentation is to prepare the inputsto a call to AnonCreds to generate the presentation. The following are theinputs to the generation process(implementation).The holder must prepare each of the inputs by getting data either from localstorage or, in the case of public data, retrieving it from the appropriateverifiable data registry(ies). AnonCreds implementations may provide functionsto help in preparing some of the data.

Thecredentials data structure contains for each listed credential:

If the credential is not revocable, the latter two inputs arenull, and arenot used. See the later section ongenerating a presentation for a revocablecredential for details about populatingthetimestamp andwitness data elements.

The indicator of whether a claim is to be revealed or not in AnonCreds 1.0 mustbe carefully understood by verifiers. While a verifer requests a set of claimsfrom the prover, the prover may choose to not reveal theraw value of some ofthose claims. If the prover does not reveal all of the requested claims,AnonCreds treats the presentation as cryptographically verified. It is thenup to the verifier to decide, after cryptographic verification, if apresentation with unrevealed values is acceptable for the business purpose ofthe presentation.

§ Generate the Presentation

From the inputs, the presentation data is generated and put into the followingdata structure:

The following is an example of a multi-credential presentation withoutrevocation.

TODO

Replace this example with one that includes:

EXAMPLE
{"presentation_request":{"nonce":"182453895158932070575246","name":"Step 3 Send your Health Information","version":"1.0","requested_attributes":{"biomarker_attrs_0":{"names":["name","concentration","unit","range","collected_on","biomarker_id","researcher_share"],"restrictions":[{"schema_name":"MYCO Biomarker","attr::name::value":"Iron"}]},"consent_attrs":{"restrictions":[{"schema_name":"MYCO Consent Enablement","schema_version":"0.1.0","attr::jti_unique_identifier::value":"205b1ea0-7848-48d4-b52b-339122d84f62"}],"name":"jti_unique_identifier"}},"requested_predicates":{}},"presentation":{"proof":{"proofs":[{"primary_proof":{"eq_proof":{"revealed_attrs":{"biomarker_id":"33034450023603237719386825060766757598085121996569112944281451290292212516012","collected_on":"92231735610070911075924224447204218356256133056723930517696107260511721601349","concentration":"10","name":"85547618788485118809771015708850341281587970912661276233439574555663751388073","range":"106828626115908025842177441696860557581575579893927923198365300598359723920768","researcher_share":"101264834079306301897660576123112461042861436742738894013248454492965796383403","unit":"38351211041892038382023569421847544683371072212679556578649761181279472893849"},"a_prime":"80156520245352052628208149565161465200964633377479145197038408116901327106468493831807000641577246417448908134495822028339761705905365398613527463662816881507291787145610182891716009505407072490691097943029471835157968113065071523597746984296197661560454442163361095634052138951650373193896962906203169809352467024247772052836999799731422581068645748537557874869718897034120634529002420631012358510111427944993245065350416694516913472010105229188198167306183788520891926236449848811955646933539477960935319919207451858981065765523367984374104834278565184338252025155136368869580505679884921590811310587077071610172673","e":"115602723672843258810892161808995599340414281260248127600708536325470178701996999306086286379312077726886107268519700961209712187789855371","v":"1250383260306407741656763352595256748825474237767244783206569756476708112785930898966696687140808011529311298553822794830872826226191807175199015541611342880032928005827271961840046208463350458298210749103878893742434685172894883857423865293195542824393317226300133796527531436931435189766065404966370796699897584860421160155369018136946091524266742514828667575397735892093187106092545876795688095293610064164136737808333322708435913545499149948994191514980395955519036106660001526586674248282052492138917987323789012051794441548696998993861159018178474063785171288325900474499496141522583368982451169653258746506425495702762445790848698570457196767532483566475068200091609719957656394696938689265240025099424248587121592521826940348286940172887963179718337593603053496022182071613592070622825622277436966372346642772481567879001423472517233061740522533372490151585309457871632521280719357505751796940152868034526426510835","m":{"master_secret":"3455871040557234123393960708120725061759594951341120214330342075748561632734634451036095543889895409812764789858455375956895105746442946098665140470124325622343440794421325163223","client_share":"4233663763294709836704307308997831519311512039775169744174375585917035614714239153287862168426091336550799195245481707264207548331415960277065672755643752404180562900805493953484"},"m2":"12942698897200869280316481431207639453433287089474860040781378232999349549981799159560238504559317917040820580596635945161264308025301203452846862479261473387068350544024561412435"},"ge_proofs":[]}},{"primary_proof":{"eq_proof":{"revealed_attrs":{"jti_unique_identifier":"46414468020333259158238797309781111434265856695713363124410805958145233348633"},"a_prime":"52825780315318905340996188008133401356826233601375100674436798295026172087388431332751168238882607201020021795967828258295811342078457860422414605408183505911891895360825745994390769724939582542658347473498091021796952186290990181881158576706521445646669342676592451422000320708168877298354804819261007033664223006892049856834172427934815827786052257552492013807885418893279908149441273603109213847535482251568996326545234910687135167595657148526602160452192374611721411569543183642580629352619161783646990187905911781524203367796090408992624211661598980626941053749241077719601278347846928693650092940416717449494816","e":"40342480172543061520030194979861449480343743039487113094246205723322643070249538229638327935935486373873622430409109409257546971244601965","v":"217871997575635857881367472262154388060800564043554848081521162883333745687724235201324121915821236796357195214089699645741515836727882126142579489701412861659136426497703162695983681701205672924385915403141611021784136285588350763399255203187442277784718461565122805239422370067600654500115262174706580098147603414365915243447789285877195068031630371954678432401446457453517813298670236942253026249413255471803997869331683293818651006043399070308083119054618677128448043841313844695654424369871669436628257531643623230026240200330490039607166147891705813033761093730859310423856156850596341547950105490585959768382544221555877471751940512766452511773683786023245283041103270102119125303027835868565240336923422734962345750992898991606841120358203160628015844345063465293475128118937815965000466081345494616126511595974927544434058100817176268040385848789013718618727873445834393897904247054897801708217939187593785671914","m":{"iat_consent_timestamp":"7919242808448912829024078929834347184203169048480606699350973804205285806978474375691141504249426249676222104091995582731720654507393708298132400435805626192291975477967402460279","master_secret":"3455871040557234123393960708120725061759594951341120214330342075748561632734634451036095543889895409812764789858455375956895105746442946098665140470124325622343440794421325163223","data_controller":"16070549690575784944224634793654539357398383214512772967411296056738507137421264813779497172425030465490587794790393434847583852932544021088761347641812155158324233253206392974293","notice":"2790610958721083178459621377821800672322230987466716467063649577108407884592339521820875278264969393963213925568888672412150769438560815981777952572004955362915245795447078373509","sensitive":"13552814315985495030467505807226704038231487014593307078913973520081443107274508887651839292151852713782653522711975492131914644109941607616672243509214979259100892541150351227883","services":"14860984314279608355643170908802532226194914773406547259519961082467311361623076451869406343140860447342041426195737612897540117192702117380288330928866665314831926780606136352645","sub_subject_identifier":"11736177517163751882849070942823049196298287414132249166618760803125435466270948777194044507635346721244111946358927525083691171695431736819244809221351813271261283779276670885101","moc_method_of_collection":"10026360820367693771310999595495505533281326977349798360729122862705999157070660881611421445424239119786180921960380892002204780026072600494332540208429642332890963846523547470729","jurisdiction_data_processing":"15829143141425514118932461858094583045441924952665872659029333578019676797278419825311275014912077620757631693167948665554731430154156737419706553672424812320891308795411687679270","iss_internet_processing_uri":"6900796243066434651671715348976599009606292569990892886896520779618011026060325075822786686418461731663661832508437549373109822105600719490952253743950241384782222356411498407620","version_consent_specification":"7796257942256624260327966366702213561879098947042014532961291550019706546662478888172243088973621029223408695289700984802154645011280488167967047321149956253054269901250137513345","policy_url":"12241676508867847022708464707584814145889660003604359058532137895063826021524887759921830911553663255421852525705197991376264187781979066233701110706958983099645275940668404311601"},"m2":"6509130065158989037891281073557909501783443634141673890142284302459280804904096303151728187237486991775852971807701594247754409108836089746736345158069365449802597798950172729241"},"ge_proofs":[]}}],"aggregated_proof":{"c_hash":"81763443376178433216866153835042672285397553441148068557996780431098922863180","c_list":[[2,122,246,66,85,35,17,213,1],[1,162,117,246,95,154,129,32]]}},"requested_proof":{"revealed_attrs":{"consent_attrs":{"sub_proof_index":1,"raw":"205b1ea0-7848-48d4-b52b-339122d84f62","encoded":"46414468020333259158238797309781111434265856695713363124410805958145233348633"}},"revealed_attr_groups":{"biomarker_attrs_0":{"sub_proof_index":0,"values":{"researcher_share":{"raw":"bf712cb328a92862b57f0dc806dec12a","encoded":"101264834079306301897660576123112461042861436742738894013248454492965796383403"},"unit":{"raw":"μM","encoded":"38351211041892038382023569421847544683371072212679556578649761181279472893849"},"concentration":{"raw":"10","encoded":"10"},"name":{"raw":"Iron","encoded":"85547618788485118809771015708850341281587970912661276233439574555663751388073"},"range":{"raw":"9.00-30.0","encoded":"106828626115908025842177441696860557581575579893927923198365300598359723920768"},"collected_on":{"raw":"2020-07-05","encoded":"92231735610070911075924224447204218356256133056723930517696107260511721601349"},"biomarker_id":{"raw":"c9ace7dc-0485-4f3f-b466-16a27a80acf1","encoded":"33034450023603237719386825060766757598085121996569112944281451290292212516012"}}}},"self_attested_attrs":{},"unrevealed_attrs":{},"predicates":{}},"identifiers":[{"schema_id":"CsQY9MGeD3CQP4EyuVFo5m:2:MYCO Biomarker:0.0.3","cred_def_id":"CsQY9MGeD3CQP4EyuVFo5m:3:CL:14951:MYCO_Biomarker"},{"schema_id":"FbozHyf7j5q7TDn2s8MXZN:2:MYCO Consent Enablement:0.1.0","cred_def_id":"TUku9MDGa7QALbAJX4oAww:3:CL:531757:MYCO_Consent_Enablement"}]}}

Once the presentation data structure is generated, it is sent to the verifierfor processing.

The following describes the data structures listed above, including theprocess of generating the data of the various types of proofs.

The Presentation Request

Thepresentation_request is a copy of thepresentation_request data structure fromthe verifier, as describedearlier in the specification.

Presentation

Thepresentation contains:

Thepresentation data structure is as follows. As noted in the JSON commentsincluded, details for each section of thepresentation is provided below.

"presentation":{"proof":{"proofs":[{"primary_proof":{"eq_proof":{              # Described in detail below},"ge_proofs":[              # Described in detail below]}}],"aggregated_proof":{        # Described in detail below}},"requested_proof":{      # Described in detail below}"identifiers":{      # Described in details below}}

Theproofs array contains an entry for each source verifiable credential.For each is aprimary_proof covering the claims in the source credential calledtheeq_proof, and age_proof for each of the predicate proofs sourced fromthe verifiable credential.

Generating the Challenge Hash

For this step theholder follows the following steps:

cHH(T,C,n1)c_H \leftarrow H(\mathcal{T}, \mathcal{C}, n_1)

wheren1n_1 is the nonce sent byverifier in proof request.

Each primaryeq_proof is generated as follows:

"eq_proof":{"revealed_attrs":{"jti_unique_identifier":"46414468020333259158238797309781111434265856695713363124410805958145233348633"},"a_prime":"52825780315318905340996188008133401356826233601375100674436798295026172087388431332751168238882607201020021795967828258295811342078457860422414605408183505911891895360825745994390769724939582542658347473498091021796952186290990181881158576706521445646669342676592451422000320708168877298354804819261007033664223006892049856834172427934815827786052257552492013807885418893279908149441273603109213847535482251568996326545234910687135167595657148526602160452192374611721411569543183642580629352619161783646990187905911781524203367796090408992624211661598980626941053749241077719601278347846928693650092940416717449494816","e":"40342480172543061520030194979861449480343743039487113094246205723322643070249538229638327935935486373873622430409109409257546971244601965","v":"217871997575635857881367472262154388060800564043554848081521162883333745687724235201324121915821236796357195214089699645741515836727882126142579489701412861659136426497703162695983681701205672924385915403141611021784136285588350763399255203187442277784718461565122805239422370067600654500115262174706580098147603414365915243447789285877195068031630371954678432401446457453517813298670236942253026249413255471803997869331683293818651006043399070308083119054618677128448043841313844695654424369871669436628257531643623230026240200330490039607166147891705813033761093730859310423856156850596341547950105490585959768382544221555877471751940512766452511773683786023245283041103270102119125303027835868565240336923422734962345750992898991606841120358203160628015844345063465293475128118937815965000466081345494616126511595974927544434058100817176268040385848789013718618727873445834393897904247054897801708217939187593785671914","m":{"iat_consent_timestamp":"7919242808448912829024078929834347184203169048480606699350973804205285806978474375691141504249426249676222104091995582731720654507393708298132400435805626192291975477967402460279","master_secret":"3455871040557234123393960708120725061759594951341120214330342075748561632734634451036095543889895409812764789858455375956895105746442946098665140470124325622343440794421325163223","data_controller":"16070549690575784944224634793654539357398383214512772967411296056738507137421264813779497172425030465490587794790393434847583852932544021088761347641812155158324233253206392974293","notice":"2790610958721083178459621377821800672322230987466716467063649577108407884592339521820875278264969393963213925568888672412150769438560815981777952572004955362915245795447078373509","sensitive":"13552814315985495030467505807226704038231487014593307078913973520081443107274508887651839292151852713782653522711975492131914644109941607616672243509214979259100892541150351227883","services":"14860984314279608355643170908802532226194914773406547259519961082467311361623076451869406343140860447342041426195737612897540117192702117380288330928866665314831926780606136352645","sub_subject_identifier":"11736177517163751882849070942823049196298287414132249166618760803125435466270948777194044507635346721244111946358927525083691171695431736819244809221351813271261283779276670885101","moc_method_of_collection":"10026360820367693771310999595495505533281326977349798360729122862705999157070660881611421445424239119786180921960380892002204780026072600494332540208429642332890963846523547470729","jurisdiction_data_processing":"15829143141425514118932461858094583045441924952665872659029333578019676797278419825311275014912077620757631693167948665554731430154156737419706553672424812320891308795411687679270","iss_internet_processing_uri":"6900796243066434651671715348976599009606292569990892886896520779618011026060325075822786686418461731663661832508437549373109822105600719490952253743950241384782222356411498407620","version_consent_specification":"7796257942256624260327966366702213561879098947042014532961291550019706546662478888172243088973621029223408695289700984802154645011280488167967047321149956253054269901250137513345","policy_url":"12241676508867847022708464707584814145889660003604359058532137895063826021524887759921830911553663255421852525705197991376264187781979066233701110706958983099645275940668404311601"},"m2":"6509130065158989037891281073557909501783443634141673890142284302459280804904096303151728187237486991775852971807701594247754409108836089746736345158069365449802597798950172729241"},

Each primaryge_proof is generated as follows:

ge_proofs:[{    u,    r,    mj,    alpha,    t,    predicate}]

Theaggregated_proof proves that the samelinked secret was used toissue all of the source verifiable credentials in the presentation.

Theaggregated_proof structure is as follows:

"aggregated_proof":{"c_hash":"base10string","c_list":[["base10string"]]}

Here is an example:

"aggregated_proof":{"c_hash":"81763443376178433216866153835042672285397553441148068557996780431098922863180","c_list":[[2,122,246,66,85,35,17,213,1],[1,162,117,246,95,154,129,32]]}

where:

Therequested_proof is the mapping from the presentation request attributesand predicates to the data in the presentation that satisfies the request. Thisis divided into five parts:

A JSON summary, with comments, for the data in each of the parts is listed below:

Revealed Attributes

An entry for each singlename request attribute from the presentation request.

"revealed_attrs":{"consent_attrs":{      # The request attribute name from the presentation request"sub_proof_index":1, # The index of the source credential primary proof for the claim"raw":"205b1ea0-7848-48d4-b52b-339122d84f62",  # The raw and encoded claim values"encoded":"46414468020333259158238797309781111434265856695713363124410805958145233348633"}}
NOTE

It is important for all verifiers to understand that the revealed attributeproof (eq_proof described earlier) is a proof on theencoded value, not ontheraw value. As such, it is up to the verifier to know the “raw to encoded”algorithm used by the issuer, and to verify that the revealedraw value properlyencodes to the provenencoded value. It is possible for a malicious holder toput an unrelatedraw value into a presentation to fool a verifier that does notchecking the encoding process. In most Aries implementations, the encoding is checkedby the Aries framework, as a “post-cryptographic verification” step.

A future version of the AnonCreds specification is likely to do an “on the fly”encoding in AnonCreds rather than including both values in the sourcecredentials and presentations. This would prevent the holder from replacing theraw value without detection.

Revealed Attribute Groups

An entry for each groupnames request attribute from the presentation request.

"revealed_attrs":{"consent_attrs":{      # The request attribute name from the presentation request"sub_proof_index":1, # The index of the source credential primary proof for the claims"values":{           # An entry for the each of the names in the request attribute group"claim_name":{     # The name of the claim, its raw and encoded value"raw":"205b1ea0-7848-48d4-b52b-339122d84f62","encoded":"46414468020333259158238797309781111434265856695713363124410805958145233348633"}}}}

Self Attested Attributes

This is a set any other data thatholder wants to provide to theverifier that is not signed by any issuer thus it’s attested only by the holder. This is a set of attributes that the holder is attesting to the verifier. The holder is not claiming that the data is true, only that they are attesting to it.

"self_attested_attrs":{"consent_attrs":"I agree to share my data with the verifier"}

Unrevealed Attributes

These are a hashmap of unrevealed attributes that the verifier requested in the presentation request, but the holder has decided not to reveal, along with their sub proof index numbers. Theverifier can use the sub proof index numbers to retrieve thecorresponding primary proof from theproof array in the presentation.

"unrevealed_attrs":{"consent_attrs":{      # The request attribute name from the presentation request"sub_proof_index":1  # The index of the source credential primary proof for the claim}}

Predicates

An entry for each predicate request from the presentation request.

"predicates":{"consent_attrs":{      # The request predicate name from the presentation request"sub_proof_index":1, # The index of the source credential primary proof for the claim}}

Identifiers

Theidentifiers contains a list of the identifiers to be resolved by theverifier to retrieve the cryptographic material necessary to verify each of theproofs in the presentation. The identifiers are listed in an array with oneentry per source verifiable credential, ordered by theproofs list earlier inthe presentation.

The data structure is:

"identifiers":[{"schema_id":"CsQY9MGeD3CQP4EyuVFo5m:2:MYCO Biomarker:0.0.3","cred_def_id":"CsQY9MGeD3CQP4EyuVFo5m:3:CL:14951:MYCO_Biomarker",}]

The example above is for a source credential that is not revocable. For arevocable source credential, therev_reg_id andtimestamp (the identifierfor theRevocation Registry Entry used in the non-revocation proof) areadded. Those are described in the section below ongeneration of non-revocationproofs

§ Generate Non-Revocation Proofs

Aholder preparing an AnonCreds presentation must determine what, ifany, non-revocation proofs (NRPs) must be included the presentation based on acombination of what is in the proof request and what verifiable credentials areto be used in the presentation. As noted in thesection on revocation in thepresentation request, the presentationrequest may have thenon-revoked item at the outer-most level, applying to allsource credentials, or at therequested_attribute and/orrequested_predicatelevel, applying only to specific source credentials. Further, theholder must determine if the source verifiable credential for the requestedattributes/predicates where a NRP is requested is a revocable credential.Obviously, an NRP cannot be produced for a verifiable credential issued withoutthat does not support revocation. Where a revocation interval is specified inthe request, and where the source credential to satisfy the request isrevocable, the holder must provide a non-revocation proof.

Once theholder has determined the which source credentials willrequired an accompanying NRPs in the presentation, theholder mustcollect and prepare the necessary proof generation inputs.

§ Collecting Data for Generating the Non-Revocation Proof

Recall from the earlier section onpreparing inputs to the presentation generationprocess that for each revocablesource credential, the holder must provide the following data elements:

Thewitness is an integer that is used in the non-revocation zeroknowledge proof to demonstrate to the verifier that the holder’s credential hasnot been revoked. Recall that theaccumulator of aRevocation Registry is the product of the tails file entries for all of the unrevokedcredentials in the registry. For a specific holder, itswitness is the productof the tails file entries for all of the unrevoked credentials in the registryexcept for the holder’s own credential. Obviously, if the witness equals theaccumulator, the holder’s credential has been revoked. But, if not, then a validnon-revocation proof demonstrates that thewitness times the entry from the tailsfile for the holder’s credential equals the accumulator, without revealingeither thewitness, the credential’s index, or its tails file entry.

An AnonCreds process is used to calculate thewitness value, takes thefollowing inputs:

The holder must use thefrom andto timestamp revocation intervalrequirements from the presentation request and knowledge of theRevocation Registry Entries to determine whichRevocation Registry to retrieve and use in generating the NRP for a given credential. TheselectedRevocation Registry Entry must either have been active at thetime of thefrom value or have been published by the issuer between thefromandto values. How to determine an appropriateRevocation Registry to use is up to the holder, and their use of the capabilities of therelevantVerifiable Data Registry.

NOTE

When Hyperledger Indy is theVerifiable Data Registry for theRevocation Registry Entry, the state is received from Indy ledger as the“deltas” (state changes) from either the initial state of the Registry or from apreviousRevocation Registry Entry. While the older Indy version ofAnonCreds used the “deltas” representation directly, the newer AnonCreds versionrequires that the holder software convert the Indy “deltas” format into therev_status_list representation, with every credential in the registry is givenarevoked ornot revoked boolean value.

The benefit of the “full state” representation forRevocation Registry is that the:Verifiable Data Registry can be “dumb”,returning the same static file given to it by the Issuer. With the Indy “deltas”approach, the [[Verifiable Data Registry (VDR)]] must be an active servicereturning an on-the-fly calculated result based on the inputs of the holder’srequest.

In collecting therevocation_list data in therev_status_list, the holdermay discover that their credential has been revoked by the issuer. The holdermay choose at that point to stop the presentation process. If the holder decidesto proceed, they will not be able to create a valid non-revocation proof for thesource credential.

The output of the process is the newwitness for a credential that will beused as input to the generate presentation process.

§ Non-Revocation Proof Generation Steps

Init proof generation:

ww.jV\VoldgL+1j+ijVold\VgL+1j+iw \leftarrow w. \frac{\prod_{j \in V \backslash V_{old}} g'_{L+1-j+i}}{\prod_{j \in V_{old} \backslash V} g'_{L+1-j+i}}

HereVoldV_{old} is taken fromwitiwit_i and updated there.

Ehρho~E \leftarrow h_{ρ}\tilde{h^o}

Dgrh~oD \leftarrow g^r\tilde{h}^{o'}

Aσh~ρA \leftarrow \sigma\tilde{h}^\rho

Ggih~r\mathcal{G} \leftarrow g_i\tilde{h}^r

Wwh^r\mathcal{W} \leftarrow w\hat{h}^{r'}

Sσih^r\mathcal{S} \leftarrow \sigma _i\hat{h}^{r''}

Uuih^r\mathcal{U} \leftarrow u_i\hat{h}^{r'''}

and adds these values toC\mathcal{C}

T1ˉhρ~h~o~\bar{T_1} \leftarrow h^{\tilde{\rho}} \tilde{h} ^ {\tilde{o}}

T2ˉEc~hm~h~t~\bar{T_2} \leftarrow E^{\tilde{c}}h^{-\tilde{m}}\tilde{h}^{-\tilde{t}}

T3ˉe(A,h^)c~.e(h~,h^)r~.e(h~,y)ρ~.e(h~,y)m~.e(h~,y)m2~.e(h~,y)s~\bar{T_3} \leftarrow e(A,\hat{h})^{\tilde{c}}.e(\tilde{h}, \hat{h})^{\tilde{r}}.e(\tilde{h}, y)^{-\tilde{\rho}}.e(\tilde{h}, y)^{-\tilde{m}}.e(\tilde{h}, y)^{-\tilde{m_2}}.e(\tilde{h}, y)^{-{\tilde{s}}}

T4ˉe(h~,acc)r~.e(1/g,h^)r~\bar{T_4} \leftarrow e(\tilde{h}, acc)^{\tilde{r}}.e(1/g, \hat{h})^{\tilde{r'''}}

T5ˉgr~h~o~\bar{T_5} \leftarrow g^{\tilde{r}}\tilde{h}^{\tilde{o'}}

T6ˉDr~gm~h~t~\bar{T_6} \leftarrow D^{\tilde{r''}}g^{-\tilde{m'}}\tilde{h}^{-\tilde{t'}}

T7ˉe(pk.G,h^)r~.e(h~,h^)m~.e(h~,S)r~\bar{T_7} \leftarrow e(pk. \mathcal{G}, \hat{h})^{\tilde{r''}}.e(\tilde{h}, \hat{h})^{-\tilde{m'}}.e(\tilde{h}, \mathcal{S})^{\tilde{r}}

T8ˉe(h~,u)r~.e(1/g,h^)r~\bar{T_8} \leftarrow e(\tilde{h}, u)^{\tilde{r}}.e(1/g, \hat{h})^{\tilde{r'''}}

and add these values toT\mathcal{T}.

ρ^ρ~cHρmodq\widehat{\rho} \leftarrow \widetilde{\rho} - c_H\rho\bmod{q}

o^o~cHomodq\widehat{o} \leftarrow \widetilde{o} - c_H\cdot o\bmod{q}

c^c~cHcmodq\widehat{c} \leftarrow \widetilde{c} - c_H\cdot c\bmod{q}

o^o~cHomodq\widehat{o'} \leftarrow \widetilde{o'} - c_H\cdot o'\bmod{q}

m^m~cHmmodq\widehat{m} \leftarrow \widetilde{m} - c_H m\bmod{q}

m^m~cHmmodq\widehat{m'} \leftarrow \widetilde{m'} - c_H m'\bmod{q}

t^t~cHtmodq\widehat{t} \leftarrow \widetilde{t} - c_H t\bmod{q}

t^t~cHtmodq\widehat{t'} \leftarrow \widetilde{t'} - c_H t'\bmod{q}

m2^m2~cHm2modq\widehat{m_2} \leftarrow \widetilde{m_2} - c_H m_2\bmod{q}

s^s~cHsmodq\widehat{s} \leftarrow \widetilde{s} - c_H s\bmod{q}

r^r~cHrmodq\widehat{r} \leftarrow \widetilde{r} - c_H r\bmod{q}

r^r~cHrmodq\widehat{r'} \leftarrow \widetilde{r'} - c_H r'\bmod{q}

r^r~cHrmodq\widehat{r''} \leftarrow \widetilde{r''} - c_H r''\bmod{q}

r^r~cHrmodq.\widehat{r'''} \leftarrow \widetilde{r'''} - c_H r'''\bmod{q}.

and add them toX\mathcal{X}.

Each NRP is added alongside the credential to which the NRP is applied, to thepresentation generated by theholder using this datamodel:

"non_revoc_proof":{"x_list":{"rho":"...","r":"...","r_prime":"...","r_prime_prime":"...","r_prime_prime_prime":"...","o":"...","o_prime":"...","m":"...","m_prime":"...","t":"...","t_prime":"...","m2":"...","s":"...","c":"..."},"c_list":{"e":"...","d":"...","a":"...","g":"...","w":"...","s":"...","u":"..."}}

The values in the data model are:

As well, in the presentation data model, added to theidentifiers item, is thetimestamp (Unix epoch format) of theRevRegEntry used to construct the NRP(see example below). Theverifier needs therev_reg_id andtimestamp to getthe correct accumulator to use in verifying the NRP.

"identifiers":[{"schema_id":"7BPMqYgYLQni258J8JPS8K:2:degree schema:46.58.87","cred_def_id":"7BPMqYgYLQni258J8JPS8K:3:CL:70:faber.agent.degree_schema","rev_reg_id":"7BPMqYgYLQni258J8JPS8K:4:7BPMqYgYLQni258J8JPS8K:3:CL:70:faber.agent.degree_schema:CL_ACCUM:61d5a381-30be-4120-9307-b150b49c203c","timestamp":1656269796}]

In step 6 of theAnonCreds Presentation DataFlow, theholder sends the verifiablepresentation, including any embedded NRPs, to theverifier.

Link: indy-anoncreds/docs/dev/anoncred.pdf

§ Verify Presentation

In step 8, 9, and 10 of theAnonCreds Presentation DataFlow, theVerifier collects the requiredinformation necessary to verify the verifiable presentation, attempts to verifythe proofs that make up the presentation and returns either atrue if successful,and afalse if any of the proofs fail, or if the presentation does not meetthe presentation request.

In theprevious section on presentation generation,the contents of the presentation is described. In verifying the presentation,each proof is extracted from the presentation and verified. The followingsub-sections cover the verification of the proofs related to the sourcecredentials (theeq_proof, anyge_proofs, and theaggregate_proof), andany non-revocation proofs in the presentation.

For each source credential in the presentation, theVerifier mustretrieve (possibly from its cache, otherwise from theVDR) thepublishedSchema andCredential Definition based on theschema_id andcred_def_id values from theidentifiers data item. For thenon-revocation proof, additional issuer published data must be collected, asdescribed below.

While in this section we mostly focus on the verification of the proofs in thepresentation, there are other data elements included, such as the revealedattributes, self-attested attributes, and thePresentation Request forwhich the presentation was generated. Some of these values contribute to theverification process, as noted below. Finally, an important part of theverification process isnot carried out in AnonCreds v1.0 and must beperformed by the callingverifier. We highlight that as well.

§ Verify Validity Proofs

An AnoncCreds validity proof is the combination of both equality and inequality predicate proofs. The validity proof is bound to the primary credential by them2^\widehat{m_2} value that is presented in both proofs. The validity proof is verified by the following steps:

T^(Z(jArRjmj)(A)2596)c(A)e^(j(Ar~)Rjmj^)(Sv^)(modn). \widehat{T} \leftarrow \left( \frac{Z} { \left( \prod_{j \in \mathcal{A}_r}{R_j}^{m_j} \right) (A')^{2^{596}} }\right)^{-c} (A')^{\widehat{e}} \left(\prod_{j\in (\mathcal{A}_{\widetilde{r}})}{R_j}^{\widehat{m_j}}\right)(S^{\widehat{v}})\pmod{n}.

AddT^\widehat{T} toT^\widehat{\mathcal{T}} .

Δ{zj;if  zj1;if  <zj;if  zj+1;if  > \Delta' \leftarrow \begin{cases}z_j; & if\ * \equiv\ \leqz_j-1; & if\ * \equiv\ <z_j; & if\ * \equiv\ \geqz_j+1; & if\ * \equiv\ >\end{cases}

a{1if or<1if or>a \leftarrow \begin{cases}-1 & if\ * \equiv \leq or <1 & if\ * \equiv \geq or >\end{cases}

Ti^TicZui^Sri^(modn)1i4;TΔ^(TΔaZΔ)cZmj^SarΔ^(modn);Q^(TΔc)i=14Tiui^(Sα^)(modn),\widehat{T_i} \leftarrow T_i^{-c}Z^{\widehat{u_i}} S^{\widehat{r_i}}\pmod{n}_{1\leq i \leq 4};\widehat{T_{\Delta}} \leftarrow \left(T_{\Delta}^{a}Z^{\Delta'}\right)^{-c}Z^{\widehat{m_j}}S^{a\widehat{r_{\Delta}}}\pmod{n};\widehat{Q}\leftarrow (T_{\Delta}^{-c})\prod_{i=1}^{4}T_i^{\widehat{u_i}}(S^{\widehat{\alpha}})\pmod{n},

and add these values toT^\widehat{\mathcal{T}} in the orderT1^,T2^,T3^,T4^,TΔ^,Q^\widehat{T_1},\widehat{T_2} ,\widehat{T_3},\widehat{T_4},\widehat{T_{\Delta}},\widehat{Q}.

§ Verify Non-Revocation Proof

If the presentation includes one or more Non-Revocation Proofs (NRPs) theverifier must also extract from the verifiable presentation the NRPsand process each of them. If any of the NRPs cannot be verified because oneor more of the attributes/predicates came from a revoked credential, theoverall status of the presentation is rejected as not verifiable. The followingoutlines the process for verifying an NRP.

Theverifier begins by extracting from the section of the presentationfor a given revocable credential thenon_revoc_proof andidentifiers dataitems. Theverifier must retrieve (possibly from its cache, otherwisefrom theVDR) the publishedRevRegEntry given therev_reg_idandtimestamp values from theidentifiers data item. Theverifierextracts theaccumulator item from theRevRegEntry retrieved. Notethat theverifier does not need to collect the revocation status of allof the credentials in the registry, nor the contents of the tails file for theRevReg. Only the issuer andholder needs that data. During theverification process, theverifier does not learn the index of theholder's credential in theRevReg.

Once theverifier gets the data in thenon_revoc_proof data item fromthe presentation for the NRP being processed, plus the accumulator fromappropriateRevRegEntry, the following steps are carried out to verifythe NRP.

Calculation for NRP:

T1^EcHhρ^h~o^\widehat{T_1} \leftarrow E^{c_H}\cdot h^{\widehat{\rho}} \cdot \widetilde{h}^{\widehat{o}}

T2^Ec^hm^h~t^\widehat{T_2} \leftarrow E^{\widehat{c}}\cdot h^{-\widehat{m}}\cdot\widetilde{h}^{-\widehat{t}}

T3^(e(h0G,h^)e(A,y))cHe(A,h^)c^e(h~,h^)r^e(h~,y)ρ^e(h~,h^)m^e(h1,h^)m2^e(h2,h^)s^\widehat{T_3} \leftarrow\left(\frac{e(h_0\mathcal{G},\widehat{h})}{e(A,y)} \right)^{c_H} \cdot e(A,\widehat{h})^{\widehat{c}}\cdot e(\widetilde{h},\widehat{h})^{\widehat{r}}\cdot e(\widetilde{h},y)^{-\widehat{\rho}}\cdot e(\widetilde{h},\widehat{h})^{-\widehat{m}}\cdot e(h_1,\widehat{h})^{-\widehat{m_2}}\cdot e(h_2,\widehat{h})^{-\widehat{s}}

T4^(e(G,acc)e(g,W)z)cHe(h~,acc)r^e(1/g,h^)r^\widehat{T_4} \leftarrow\left(\frac{e(\mathcal{G},\mathrm{acc})}{e(g,\mathcal{W})z}\right)^{c_H} \cdot e(\widetilde{h},\mathrm{acc})^{\widehat{r}}\cdot e(1/g,\widehat{h})^{\widehat{r'}}

T5^DcHgr^h~o^\widehat{T_5} \leftarrow D^{c_H}\cdot g^{\widehat{r}}\widetilde{h}^{\widehat{o'}}

T6^Dr^gm^h~t^\widehat{T_6} \leftarrow D^{\widehat{r''}}\cdot g^{-\widehat{m'}} \widetilde{h}^{-\widehat{t'}}

T7^(e(pkG,S)e(g,g))cHe(pkG,h^)r^e(h~,h^)m^e(h~,S)r^\widehat{T_7} \leftarrow \left(\frac{e(pk\cdot\mathcal{G},\mathcal{S})}{e(g,g')}\right)^{c_H}\cdot e(pk\cdot \mathcal{G},\widehat{h})^{\widehat{r''}}\cdot e(\widetilde{h},\widehat{h})^{-\widehat{m'}}\cdot e(\widetilde{h},\mathcal{S})^{\widehat{r}}

T8^(e(G,u)e(g,U))cHe(h~,u)r^e(1/g,h^)r^\widehat{T_8} \leftarrow \left(\frac{e(\mathcal{G},u)}{e(g,\mathcal{U})}\right)^{c_H}\cdot e(\widetilde{h},u)^{\widehat{r}}\cdot e(1/g,\widehat{h})^{\widehat{r'''}}

Then all these values are added toT^\widehat{T}. This is then added with the validity proof which when hashed withC\mathcal{C} andn1n_1(received fromholder) re constructs the challenge hashcH^\widehat{c_H}.IfcH^=cH\widehat{c_H} = c_H, then the proof is valid.

The NRP is bound to the primary credential by them2^\widehat{m_2} value that is presented in both proofs.

The verification code MUST surface to theverifier if any part of thepresentation, including any NRP(s), fail cryptographic verification. Theverification code MAY surface additional detail about what part of thepresentation failed, such as which NRP failed verification (if any).

Theverifier SHOULD evaluate the presentation to make sure that theholder provided all requested NRPs. Notably, if any expected NRPsare not received in the presentation, theverifier SHOULD check to seeif the given credential type is revocable. If not, it is acceptable that noNRP was received. However, if the credential used in the generation of theproof is revocable, and theholder did not provide the NRP, theverification code SHOULD surface to theverifier that the presentationfailed cryptographic verification.

§ Other Verification

The AnonCreds verification code checks some additional non-cryptographicelements of the presentation.

§ Encoding Not Verified

Verifiers using AnonCreds 1.0MUST verify that revealed attributespresented by theHolder encode to the values signed by theIssuer. AIf not done, a maliciousHolder could successfullysubstitute a different revealed attribute than what the issuer encoded andsigned.

As noted in theissuance section of thisspecification the encoding of raw attribute data tothe integers that are actually signed by theIssuer is defined andhandled by theIssuer, and is not defined in this specification, norperformed by the implementation. As such, the verification of the encoding islikewise delegated to theVerifier, enabling the risk to the verifieroutlined above.

§ AnonCreds Revocation Data Flow

AnonCreds includes a mechanism that supports the revocation of verifiablecredentials. This mechanism includes:

A fundamental goal of AnonCreds is to not provide a correlatable identifier foreither aholder or a credential as part of generation and verificationof an AnonCreds presentation. Applying that goal to revocation means that therevocation mechanism must support theholder proving a credential usedin generating a presentation is not revoked without providing a correlatableidentifier for that credential or the holder itself. As such, the AnonCredsrevocation mechanism uses a Zero Knowledge Proof (ZKP) that allows theholder to prove a credential they hold is not revoked without revealing anidentifier for their credential or the holder.

§ AnonCreds Issuer Setup With Revocation

The details ofissuer setting up revokable credential types are coveredin theissuer setupsection of this specification. Note thewarning and recommendation against theuse ofISSUANCE_ON_DEMAND in that partof the specification.

§ AnonCreds Issuance with Revocation

The details of anissuer issuing a revokable credential to aholder are covered in theissuance dataflow section of this specification.

§ AnonCreds Credential Activation/Revocation and Publication

When anissuer decides to revoke a previously issued credential (oractivate a previously inactive/revoked credential), they do so by publishinganother instance of theRevRegEntry object. Recall from the issuersetup section, the specification aboutRevRegEntry[creating and publishing the firstRevRegEntry](data_flow_setup.md#creating-the-initial-revocation-registry-entry-object)for aRevReg. In that process, the accumulator for the initial state oftheRevReg is published. When subsequentRevRegEntrytransactions are published to the ledger, each includes an updated value of theaccumulator. The update of the accumulator is necessary with each revocation or(re)activation of a credential or set of credentials since the last publishedRevRegEntry. This is because only the factors (all factors are listedin the respective tails file) of credentials which are active (meaning not beingrevoked) contribute to the accumulator. Therefore in addition to the updatedaccumulator value, everyRevRegEntry contains lists of indices ofcredential factors which have been either revoked or (re)activated within theRevRegEntry. This list of factor indices is a so calledWitness and enables theHolder to successfully generate a proof of nonrevocation.

An example of thedata in theRevRegEntry is shown in the following example of aRevRegEntry, pulled fromthis transaction on the SovrinMainNet.

"data":{"revocDefType":"CL_ACCUM","revocRegDefId":"4xE68b6S5VRFrKMMG1U95M:4:4xE68b6S5VRFrKMMG1U95M:3:CL:59232:default:CL_ACCUM:4ae1cc6c-f6bd-486c-8057-88f2ce74e960","value":{"accum":"21 116...567","prevAccum":"21 128...C3B","issued":[],"revoked":[172]}},

In the above:

In the example transaction above no credentials areissued (meaning changedfrom statusrevoked toissued) and only one, the credential with index172, is changed torevoked. Both lists can have an arbitrary number ofentries, up to the total number of credentials in theRevReg.

The algorithm to calculate the value of aRevRegEntry accumulator atany time is the same: determine the (modulo) product of the primes for eachnon-revoked credential in theRevocation Registry, as describedhere.

NOTE

Theissuer MUST track of the revocation status of all of thecredentials within aRevReg so that it can both calculate the correctaccumulator and send to theVDR accurate lists (issued andrevoked)of the indices of the credentials whose status has changed since the lastRevRegEntry was published. If the list and accumulator published toVDR get out ofsync aholder will not be able to generate a valid NRP.

AVDR publishing aRevReg MAY perform its own calculation ofthe accumulator based on the list updates received in aRevRegEntrytransaction to ensure that the calculation of the accumulator after all of therevocation status updates to the credentials within theRevReg havebeen applied, rejecting the transaction if the calculated accumulator does notmatch that from theissuer.

If anissuer's local revocation information gets out of sync with whatis in the VDR, theissuer MUST rationalize the differences and produceaRevRegEntry transaction that accounts for both the last publishedRevRegEntry published in theVDR and the desired revocationstatus of all of the credentials in theRevReg.

Theholder is not involved in the process of revoking a credential.There is no technical requirement for anissuer to notify theholder that a credential they were issued has been revoked. That said, it is acourtesy that may improve the user experience of theholder.Aries RFC0183 RevocationNotificationis an example of how that can be done. Even if not notified by theissuer of the revocation of a credential, theholder can detect theircredential has been revoked when they retrieve the list of revoked credentialsfrom theVDR and discover the index of their credential in the list.

§ AnonCreds Presentation Request with Revocation

Carrying out an AnonCreds presentation with revocation is a two-step process, beginning with arequest from theverifier asking theholder to include anon-revocation proof (NRP) in the presentation, and then theholdercreating the NRP and including it in the presentation sent to theverifier.

The verifier requesting a non-revocation proof, and theholdergenerating the non-revocation proof are covered in the sections of thisspecification aboutrequesting andgenerating presentations, respectively.

§ AnonCreds Verification with Revocation

Averifier receives the presentation from theholder andprocesses thenon-revocation-related parts of the presentation andtherevocation-related parts of the presentation(if any) in the presentation. The resulting status of the presentation combines theverification outcomes from processing all proofs within the presentation. Ifverification of one or more of the embedded proofs is unsuccessful, thepresentation is rejected as unverifiable.

§ AnonCreds Methods

In the AnonCreds data flows are specifications of data models that containidentifiers to public AnonCreds objects (Schemas,CredDefs,Revocation Registry Definitions andRev_Reg_Entrys) that are published by issuersto locations (Verifiable Data Registries or VDRs) that must beaccessible to holders and verifiers to enable presentation generation andverification. The format of the objects identifiers and thelocation of the objects are not defined in this specification. Rather, similarto the approach ofDID Methods defined in theW3C DIDSpecification,AnonCreds methodsallow for the registration and resolution mechanisms for AnonCreds objectsacross a range of VDRs. A registry of supportedAnonCreds methods canbe found in theAnonCreds Methods Registry.

EachAnonCreds method specifies the format of the object identifiers,to whatVerifiable Data Registry the objects are published, how issuersregister (publish) objects, and how issuers and verifiers can resolve theidentifiers to retrieve the published objects. Implementations of agents(issuers, holders, verifiers) with AnonCreds support should be organized so asto allow issuers to use at least oneAnonCreds method for registration,and to allow holders and verifiers to use one or moreAnonCreds Methodsfor resolution. AnonCreds issuers will likely choose just a single AnonCredsregistration method(s) they will use, and all AnonCreds participants will choosethe set of AnonCreds resolvers they will require based on the issuers and typesof credentials they want to support. As with DIDs, an external UniversalAnonCreds Resolver is possible, as is a Universal AnonCreds Registrar.

§ AnonCreds Identifiers

AnonCreds identifiers MUST be a Uniform Resource Identifier (URI)conformant withRFC3986, althoughone notable exception is permitted. The exception is that for backwardscompatibility, the AnonCreds identifiers used in the early (predid:indy) open source Hyperledger Indy AnonCreds implementation are permitted.In theAnonCreds Method Registry,this is theHyperledger Indy Legacy AnonCreds Method.

§ Issuer Identifiers

All AnonCreds objects that are published to aVerifiable Data Registry (Schema,Credential Definition,Revocation Registry Definition, andRevocation Status List) contain anissuerId reference. This identifier references the creator (issuer) of the specific AnonCreds object.

AnonCreds identifiers MUST be a Uniform Resource Identifier (URI)conformant withRFC3986, althoughone notable exception is permitted. The exception is that for backwardscompatibility, the Indy DIDs used in the early (predid:indy) open sourceHyperledger Indy implementation are permitted.

An AnonCreds object issuer identifier MAY be publicly resolvable. AnonCreds methods MUST define the format of the issuer identifier, and MUST verify that the publisher of the AnonCreds object controls the issuer identifier before publishing the object.

§ Revocation Support

Implementers only familiar with the “deltas”-style data format of Hyperledger IndyRevRegEntries may not be aware that other VDRs maystore the contents of eachRevRegEntry as“full state”, meaning the status of each credential in the registry(revoked or not) is stored, vs. only the differences from the previousRevRegEntry as in Hyperledger Indy. Either approach is fineas long as data is normalized by the AnonCreds method to theRevRegformat expected for AnonCredsgenerate presentationprocessing. This allows a AnonCreds Methods to trade-off the size of theRevRegEntry in the VDR with the need for VDR-side processing to collectall of the deltas needed by the holder.

An AnonCreds Method may opt to not supportrevocation at all, and generatean error if the issuer attempts to create aCredDef that includes revocationsupport.

§ AnonCreds Method Registry

The AnonCreds Method Registry is publishedhere. Theregistry contains a description, metadata and a link to a specification for eachAnonCreds Method submitted by its implementers/maintainers. The registry is a web pagegenerated fromthisrepository.

The AnonCreds Methods registry repository and published registry ismanaged by the AnonCreds Specification Working Group based on thisgovernanceframework.

Each entry in theAnonCreds MethodRegistrylinks to a specification for the associatedAnonCreds objects method.The method specifications must include information about the AnonCreds identifiersused by the method, along with the mechanisms for AnonCreds objects registrationand resolution. In some cases, theAnonCreds methodspecification is defined within aDID Method specification, while inother cases, theAnonCreds method is a standalonespecification.

§ W3C Verifiable Credentials Representation

This section describes how legacy AnonCreds credentials and presentations can be represented in the form ofW3C Verifiable Credentials standard.

§ Credential

This section describes howW3C credential concepts are applied toAnonCreds W3C credential representation.

Example AnonCreds W3C Credential

EXAMPLE
{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiableCredential","AnonCredsCredential"],"issuer":"did:sov:3avoBCqDMFHFaKUHug9s8W","issuanceDate":"2023-11-15T10:00:00.036203Z","credentialSchema":{"type":"AnonCredsDefinition","definition":"did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default","schema":"did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"},"credentialSubject":{"firstName":"Alice","lastName":"Jones","age":"18"},"proof":[{"type":"AnonCredsProof2023","signature":"AAAgf9w5.....8Z_x3FqdwRHoWruiF0FlM"},{"type":"Ed25519Signature2020","created":"2021-11-13T18:19:39Z","verificationMethod":"did:sov:3avoBCqDMFHFaKUHug9s8W#key-1","proofPurpose":"assertionMethod","proofValue":"z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"}]}

§ Context

W3CContext section requires including of@context property toverifiable credential.

The value of the@context property must be one or more resolvableURIthat result in machine-readableJSON-LD information about the objectformat.

Thecontext definition used for AnonCreds W3C credentials representation can bediscoveredhere.

In the case of W3C AnonCreds credentials, the@context attribute includes an extraentryhttps://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.jsonwhich is required for the resolution of custom structure definitions and looks the following:

{  ..."@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],  ...}

§ Identifiers

W3CIdentifiers section defines an optional capability to assignsome kind of identifier to the verifiable credential so that others can express statements about the same thing.

In the case of W3C AnonCreds credentials, theid attribute is not included intoCL credential proof signature, butitcan be optionally set in credential to support other integrity proof types.

§ Types

W3CTypes section requires including oftype property to verifiablecredential.The value of thetype property must be one or moreURI resolvablethrough the defined@context to the information required for determining whether a verifiable credential hasa valid structure.

In the case of W3C AnonCreds credentials, thetype attribute includes an extra entryAnonCredsCredentialpointing to the difference in a base credential structure and looks the following:

{  ..."type":["VerifiableCredential",// general verifiable credential definition"AnonCredsCredential",// definition for AnonCreds credentials]  ...}

§ Credential Subject

W3CCredential Subject section requires includingofcredentialSubject property to verifiable credential.

Credential subject value containsclaims about one or more subjects.

In the context of W3C AnonCreds credentials, credential subject property is compliant with the following statements:

In the case of W3C AnonCreds credentials, thecredentialSubject attribute looks the following:

{  ..."credentialSubject":{"firstName":"Alice","lastName":"Jones","age":"18"}  ...}

§ Data Schemas

W3CCredential Schema section defines an optional capability toincludecredentialSchema property to enforce a specific structure on a given verifiable credential and encoding usedto map the claims of a verifiable credential to an alternative representation format.

In the case of W3C AnonCreds credentials, thecredentialSchema attribute defines a customAnonCredsDefinitionschema in order to include the information about AnonCreds related definitions to credential and looks the following:

{  ..."credentialSchema":{"type":"AnonCredsDefinition","definition":"did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default","schema":"did:sov:3avoBCqDMFHFaKUHug9s8W:2:fabername:0.1.0"},  ...}

Credential Schema Data:

§ Issuer

W3CIssuer section requires including ofissuer property to express theissuer of a verifiable credential.

In the case of W3C AnonCreds credentials, theissuer attribute should be represented as aresolvableDID URL and looks the following:

{  ..."issuer":"did:sov:3avoBCqDMFHFaKUHug9s8W",  ...}

§ Issuance Date

W3CIssuance Date section requires including ofissuanceDateproperty to express the date and time when a credential becomes valid.The value of theissuanceDate property must be a string value ofanXMLSCHEMA11-2 combined date-time.

In the case of W3C AnonCreds credentials, theissuanceDate attribute should contain the time when a credential wasissued ortransformed from legacy form, and looks the following:

{  ..."issuanceDate":"2010-01-01T19:23:24Z",  ...}

§ Proofs (Signatures)

W3CProofs (Signatures) section requires including ofproofproperty to express confirmation of the credential’s validity.

According to the specification, one or many proof objects can be added to verifiable credentials.In the case of W3C AnonCreds credentials, theproof attribute must containAnonCreds CL proofand may contain moreNon-AnonCreds Data Integrity proofs.

§ AnonCreds CL proof

AnonCreds CL proof constructed from theCL signature of a verifiable credential.

The defined@context includes a definition for theAnonCredsProof2023 type describing the format of theproofentry:

{  ..."proof":[{"type":"AnonCredsProof2023","signature":"AAAgf9w5lZg....RYp8Z_x3FqdwRHoWruiF0FlM"}]  ...}

Credential Proof Signature Data:

§ Non-AnonCreds Integrity proof

In order to better conform to the W3C specification AnonCreds based credential allows includingof non-AnonCredsData Integrity Proof which must begenerated using one of NIST-approved algorithms (RSA, ECDSA, EdDSA).

§ Status

W3CStatus section defines an optional capability to includecredentialStatus property to express credential status information, such as whether it is revoked.

In the case of W3C AnonCreds credentials, if a credential is revocable, thetype attribute ofcredentialStatus mustbeAnonCredsCredentialStatusList2023 (defined in the scope of@context) pointing thatAnonCreds Credential Revocation Flow is used for credential issuance.Theid attribute ofcredentialStatus must contain id of revocation registry.

Also, credential revocation data including revocation registry and witness values (rev_reg andwitness) must beincluded into the credential proof signature as demonstrated above inAnonCreds CL proof section.

A description of generation process when the credential is revocable is in thesectionSupporting Revocation in a Credential.

{  ..."credentialStatus":{"type":"AnonCredsCredentialStatusList2023","id":"did:sov:NcYxiDXkpYi6ov5FcYDi1e:4:NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag:CL_ACCUM:TAG_1"},  ...}

§ Expiration

W3CExpiration section defines an optional capability to includecredential expiration information.

In the case of W3C AnonCreds credentials, instead of includingexpirationDate property there is defined anotherAnnounced Revocation Data Flow implementing throughthe using ifcredentialStatus property.

{  ..."credentialStatus":{"type":"AnonCredsCredentialStatusList2023","id":"did:sov:NcYxiDXkpYi6ov5FcYDi1e:4:NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag:CL_ACCUM:TAG_1"},  ...}

§ AnonCreds W3C Revocable Credential

EXAMPLE
{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiableCredential","AnonCredsCredential"],"issuer":"did:sov:3avoBCqDMFHFaKUHug9s8W","issuanceDate":"2023-11-15T10:00:00.036203Z","credentialSchema":{"type":"AnonCredsDefinition","definition":"did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default","schema":"did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"},"credentialStatus":{"type":"AnonCredsCredentialStatusList2023","id":"did:sov:3avoBCqDMFHFaKUHug9s8W:4:3avoBCqDMFHFaKUHug9s8W:3:CL:3avoBCqDMFHFaKUHug9s8W:2:basic_person:1.0:tag:CL_ACCUM:TAG_1"},"credentialSubject":{"firstName":"Alice","lastName":"Jones","age":"18"},"proof":[{"type":"AnonCredsProof2023","signature":"AAAgf9w5.....8Z_x3FqdwRHoWruiF0FlM"},{"type":"Ed25519Signature2020","created":"2021-11-13T18:19:39Z","verificationMethod":"did:sov:3avoBCqDMFHFaKUHug9s8W#key-1","proofPurpose":"assertionMethod","proofValue":"z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"}]}

§ Presentation

This section describes howW3C presentation concepts are applied toAnonCreds W3C presentation representation.

Example AnonCreds W3C Presentation:

EXAMPLE
{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiablePresentation","AnonCredsPresentation"],"verifiableCredential":[{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiableCredential","AnonCredsCredential"],"credentialSchema":{"type":"AnonCredsDefinition","definition":"did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default","schema":"did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"},"credentialSubject":{"firstName":"Alice","age":[{"type":"AnonCredsPredicate","predicate":">=","value":18}]},"issuanceDate":"2023-11-15T10:59:48.036203Z","issuer":"did:sov:3avoBCqDMFHFaKUHug9s8W","proof":{"type":"AnonCredsPresentationProof2023","proofValue":"eyJzdWJfcHJvb2Yi...zMTc1NzU0NDAzNDQ0ODUifX1dfX19"}}],"proof":{"type":"AnonCredsPresentationProof2023","challenge":"413296376279822794586260","proofValue":"eyJhZ2dyZWdhdGVkIjp7ImNfaGFzaCI6IjEwMT...IsMzAsMTM1LDE4MywxMDcsMTYwXV19fQ=="}}

§ Context

W3CContext section requires including of@context property toverifiable presentation.

The value of the@context property must be one or more resolvableURIthat result in machine-readableJSON-LD information about the objectformat.

Thecontext definition used for AnonCreds W3C presentations representation can bediscoveredhere.

In the case of W3C AnonCreds presentations, the@context attribute includes an extraentryhttps://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.jsonwhich is required for the resolution of custom structure definitions and looks the following:

{  ..."@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],  ...}

§ Types

W3CTypes section requires including oftype property to verifiablepresentation.The value of thetype property must be one or moreURI resolvablethrough the defined@context to the information required for determining whether a verifiable presentationhas a valid structure.

In the case of W3C AnonCreds presentations, thetype attribute includes an extra entryAnonCredsPresentationpointing to the difference in a base presentation structure and looks the following:

{  ..."type":["VerifiablePresentation",// general verifiable presentation definition"AnonCredsPresentation"// definition for AnonCreds presentation]  ...}

§ Verifiable Credential

W3CVerifiable Credential section requires includingofverifiableCredential property to a verifiable presentation constructed from one ormoreverifiable credentials.

The listedcredentials must include attributes and predicated requested inthepresentation request.

Verifiable credentials mostly looks same as described at theCredential Structuresection but with some differences.

§ Credential Subject

In the case of W3C AnonCreds presentations, in contrast to the general verifiable credential structure(when all attributes represented as key value pairs), thecredentialSubject attribute values can be representedin two forms:

§ Proof (Signature)

In the case of W3C AnonCreds presentations, theproof attribute for each verifiable credential must be an object ofAnonCredsPresentationProof2023 type which looks the following:

"proof":{"type":"AnonCredsPresentationProof2023","proofValue":"AAEBAnr2Ql...0UhJ-bIIdWFKVWxjU3ePxv_7HoY5pUw","timestamp": Option<1234567>,}

Verifiable Credential Proof Data

§ Proof

W3CProofs (Signatures) section requires including ofproofproperty to express confirmation of the presentation’s validity.

As we described in the above section verifiable credentials can contain two proof entries (CL AnonCreds of Non-AnonCredsData Integrity).Unlike verifiable credentials, presentations can contain only one proof object.

It isverifier andholder responsibility to negotiate which proof must be used(CL AnonCreds of Non-AnonCreds Data Integrity) in the presentation:

{  ..."proof":{"type":"AnonCredsPresentationProof2023","challenge":"182453895158932070575246","proofValue":"AAAgtMR4DrkY--ZVgKHmUANE04ET7TzUxZ0vZmVcNt4nCkwBABUACQJ69kJVIxHVAQAIAaJ19l-agSA"}  ...}

Presentation Proof structure

§ AnonCreds W3C Presentation containing Revocable Credential

EXAMPLE
{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiablePresentation","AnonCredsPresentation"],"verifiableCredential":[{"@context":["https://www.w3.org/2018/credentials/v1","https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"],"type":["VerifiableCredential","AnonCredsCredential"],"credentialSchema":{"type":"AnonCredsDefinition","definition":"did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default","schema":"did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"},"credentialStatus":{"type":"AnonCredsCredentialStatusList2023","id":"did:sov:3avoBCqDMFHFaKUHug9s8W:4:3avoBCqDMFHFaKUHug9s8W:3:CL:3avoBCqDMFHFaKUHug9s8W:2:basic_person:1.0:tag:CL_ACCUM:TAG_1"},"credentialSubject":{"firstName":"Alice","age":[{"type":"AnonCredsPredicate","predicate":">=","value":18}]},"issuanceDate":"2023-11-15T10:00:00.036203Z","issuer":"did:sov:3avoBCqDMFHFaKUHug9s8W","proof":{"type":"AnonCredsPresentationProof2023","proofValue":"eyJzdWJfcHJvb2Yi...zMTc1NzU0NDAzNDQ0ODUifX1dfX19"}}],"proof":{"type":"AnonCredsPresentationProof2023","challenge":"413296376279822794586260","proofValue":"eyJhZ2dyZWdhdGVkIjp7ImNfaGFzaCI6IjEwMT...IsMzAsMTM1LDE4MywxMDcsMTYwXV19fQ=="}}

§ Proof data encoding

  1. Almost all properties of AnonCredscredential signature andpresentation are big numbers.The traditional JSON serialization os such data is not very compact.Instead, we useMessagePack binary data serialization format which is faster and producessmaller value.You can find more details on howMessagePack works readingthespecification.

  2. Encoding the resulting bytes asBase64Url string without padding

§ Context

The AnonCreds context, locatedathttps://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json can be used toimplement a local cached copy.For convenience, the AnonCreds context is also provided in this section.

:::

EXAMPLE
{"@context":{"@version":1.1,"@protected":true,"ac":"https://anoncreds.example/2022/ns#","xsd":"http://www.w3.org/2001/XMLSchema#","AnonCredsCredential":"ac:AnonCredsCredential","AnonCredsDefinition":{"@id":"ac:AnonCredsDefinition","@context":{"@version":1.1,"@protected":true,"definition":{"@id":"ac:definition","@type":"@id"},"schema":{"@id":"ac:schema","@type":"@id"}}},"AnonCredsCredentialStatusList2023":"ac:AnonCredsCredentialStatusList2023","AnonCredsPresentation":"ac:AnonCredsPresentation","AnonCredsPresentationProof2023":{"@id":"ac:AnonCredsPresentationProof2023","@context":{"@version":1.1,"@protected":true,"proofValue":{"@id":"ac:proofValue","@type":"xsd:string"},"challenge":{"@id":"ac:challenge","@type":"xsd:string"}}},"AnonCredsProof2023":{"@id":"ac:AnonCredsProof2023","@context":{"@version":1.1,"@protected":true,"signature":{"@id":"ac:signature","@type":"xsd:string"}}},"AnonCredsPredicate":{"@id":"ac:AnonCredsPredicate","@context":{"@version":1.1,"@protected":true,"predicate":{"@id":"ac:predicate","@type":"xsd:string"},"value":{"@id":"ac:value","@type":"xsd:decimal"}}}}}

§ AnonCreds Conventions

Over the years of using Hyperledger AnonCreds, several conventions (listed here) have been defined can or must be usedin deploying AnonCreds. The conventions are not required in the currentAnonCreds implementation, butare necessary to follow for interoperability with other AnonCreds implementations.

§ Encoding Credential Claims

As described in this specification, the claim data that is actually signed inproducing an AnonCreds verifiable credential is not the “raw”, human-readabledata of the claims, but rather an integer derived from the raw data. The act ofencoding the data was defined to be done by the issuer. However, unless theissuer implements exactly the encoding expected by all others in an ecosystem,the signatures produced for a presentation will not verify. Thus, although theissuer is nominally in control of the encoding, practically, all issuers MUSTfollow theencoding defined in this specification.

In a future version of AnonCreds we expect to move the encoding process awayfrom the issuer and into AnonCreds.

§ Date and Date/Time Predicates

A powerful capability in AnonCreds is the ability to use predicates on dates,such as proving based on a date of birth (a strongly correlatable value) that aperson is older than a certain age without revealing the date of birth. However,because ofhow credential claims are encoded(above), for a date-based predicate to work, the date must be an integer. Thus,a “date of birth” claim in anISO 8601 Standard DateString will not be ableto be used in a predicate. Rather, the convention of the AnonCreds community hasbeen to put the data into the form of the date as an integer of valueYYYYMMDDThis convention was initially definedhereby theHyperledger Ariescommunity.

For the same reasons, AnonCredsdatetime claims that are to be used in predicatesSHOULD be issued inUnix Time format.

In a future version of AnonCreds we expect to define the type of each claim in acredential so that thedate anddatetime values as strings can beautomatically encoded as integers and Unix Time values (respectively). Thisenables supporting both human-friendly displaying of the claims as well assupport for predicates.

§ Presentation Request Revocation Intervals

While the AnonCredsPresentation Request format allows the flexibleapplication offrom toto ranges for when theHolder must provetheir credential was not revoked, those deploying AnonCreds have found that it israrely practical or necessary to use such flexibility, and the best practicesare to set the two values (from,to) to be the same inPresentation. ForVerifiers interested in the current revocation statusof the credential, both values should be set to the current time, while if theverifier wants to see the revocation status of the credential at some point inthe past, both values should be set to point in time.

Details about this convention can be found in thePresentation Request sectionof this specification.

Since theHolder must prove non-revocation based on aRevocation published by the issuer, the actual interval that theHolder must use is notfrom toto, but rather from theRevocation active at timefrom to theRevocation Registry Entryactive at timeto, where “time” is as determined by the transaction timesrecorded at the location on which the issuer published theRevocation.

§ IANA Considerations

This document has no IANA actions.

§ Security Considerations

There are a number of security considerations that issuers, holders, andverifiers should be aware of when processing data described by thisspecification. Ignoring or not understanding the implications of this sectioncan result in security vulnerabilities.

While this section attempts to highlight a broad set of security considerations,it is not a complete list. Implementers are urged to seek the advice of securityand cryptography professionals when implementing mission critical systems usingthe technology outlined in this specification.

§ Zero Knowledge Proofs in AnonCreds

The security of AnonCreds is primarily based on the security of the AnonCredscryptography, and in particular, thezero knowledge proofs (ZKPs), uponwhich this specification is based. Each ZKP used in AnonCreds requiresthe following security properties be met, as introduced in many ZKP articles,such as this one onnon-interactive zero knowledge proofs:

The security of the ZKPs is based on the security of RSA cryptography, andspecifically that the factoring ofn, wheren is the product of twosafe primes, is a computationally hard problem.

These properties apply in the places where zero knowledge proofs are used in AnonCreds:

§ Eavesdropping

The prevention of eavesdropping during the exchange of AnonCreds objects duringissuance and verification is outside the scope of this specification. Thesecurity of the data shared between parties shall be protected by implementingbest practices in communications amongst mobile wallet and IT infrastructure,likeISO27001 andInformation Security Management systems (ISMS). That said,the AnonCreds cryptography prevents an eavesdropper from gaining other than anyplaintext information the parties of an interaction might intentionally oraccidentally share.

§ Replay

Replay prevention in AnonCreds for both issuances and presentations areprevented through the use of nonces. During the 3-step issuance process theissuer (in the Credential Offer) and then theholder (in theCredential Request) provide and verify the use of nonces before proceeding.Likewise in the presentation request, theverifier provides a noncethat is incorporated by theholder in generating the presentation, andverified by theverifier.

§ Message Tampering

Message tampering during AnonCreds exchanges is ineffective whenthe secrets are securely protected by theissuers andholders.Arbitrary modification of AnonCreds data without access to the appropriate secret data isdetectable through the failure of the verification of the data objects. See thesecurity considerations sections about theprotection ofdata andprotection of keymaterial for more on protecting those secrets andthe potentials impacts if those secrets are disclosed.

§ Holder Collusion

Holders that collude by sharing theirlink secret could eachbe issued credentials to the samelink secret. Subsequently,suchholders could present any combination of the credentials together,including generating a proof that they were all issued to the samelink. Where such collusion is deemed a significant risk, such as with amobile wallet application, the agent software should protect thelink so as to prevent access or extraction.Issuers andVerifiers may choose to implement verifications that theholder isusing a mobile wallet that is known to prevent such extraction and subsequentcollusion.

§ Protection of data

The protection of data, both at rest and in motion, is outside the scope of thisspecification. Protection of data should be accomplished by the participantsexchanging AnonCreds verifiable data implementing best practices in dataprotection for mobile wallet and IT infrastructure, likeISO27001 andInformation Security Management systems (ISMS). See the section on theprotection of key material for more on thepotential impact of disclosed secrets.

When verifiable credentials are stored on a device and that device is lost orstolen, it might be possible for an attacker to use the victim’s verifiablecredentials. Mitigating the impacts of such a loss include:

The potential risks in not adequately protecting data are covered in theeavesdropping,message insertion andmodification andreplaysubsection of the Security Considerations.

§ Protection of Key Material

The private keys associated with the public keys used by theissuermust be kept secret. Eachissuer is responsible for storing and usingtheir private keys and (for theholder) thelink secret in asufficiently secure manner.

Unintended disclosure ofissuer secret information could allow otherswith access to the secrets issue credentials as if from the originalissuer.

Unintended disclosure of theholder'slink secret could, ifaccompanied by the disclosure of the holder’s verifiable credentials, allowothers to present those credentials as their own. A malicious presenter couldnot present their own credentials issued to a differentlink secretalongside the compromised verifiable credentials.

§ Man-In-The-Middle

The prevention and detection of Man-In-The-Middle (MITM) attacks during theexchange of AnonCreds objects during issuance and verification is outside thescope of this specification. Best practices in preventing MITM attacks whileestablishing the communications channel between the parties through which thedata objects are exchanged should be followed by all of the participants.

As covered in the previous section onMessage Insertion andModification issuance and presentationsprocesses are not susceptible to alteration by a MITM. The primary risk of MITMattacks are the potential for collusion betweenholders interactingwith averifier. For example, a MITM interacts with a verifier torespond to a presentation request by colluding (in real-time) with a set of oneor moreholders to pass on each presentation request and get apresentation from the most suitableholder for each individualpresentation request. This attack can be mitigated by requesting presentationsthat are satisfied from multiple source credentials, which will be verified toshow all are bound to the samelink secret.

§ Deletion

The handling of the deletion of AnonCreds objects by the various participants isoutside the scope of this specification. Such objects may be deleted by theparticipants at any time, understanding that once done, the operations enabledby the possession of those objects cannot be performed. For example, an issuerlosing the issuance and revocation private keys can no longer issue or revokecredentials. Likewise, aholder can’t provide a presentation of adeleted source credential. Protection from inadvertent deletion of such datashall be protected by implementing best practices in data management by mobilewallet and IT infrastructure, likeISO27001 andInformation SecurityManagement systems (ISMS).

§ Denial of Service

Denial of Service attacks against the various participants in AnonCredsexchanges are outside the scope of this specification.

§ Storage or Network Amplification

Storage or network amplification attacks against the various participants inAnonCreds exchanges are outside the scope of this specification.

§ Residual Risks

The residual risks inherent in AnonCreds include:

§ Privacy Considerations

The business expression of the AnonCreds privacy goal is to allow a verifiablecredential holder to minimize the amount of information they share with othersin presentations and to minimize the opportunities for holdercorrelation (also calledunlinkability) across issuers and verifierswhen using verifiable credentials and presentations. While it is understood thattheclaims that a holder shares in a verifiable presentation may becorrelatable, the act of providing an AnonCreds verifiable presentation must notprovidecorrelatable data.

AnonCreds accomplishes its privacy goals using the following techniques, all ofwhich are based on forms ofzero-knowledge proofs, as described in thisspecification.

The further privacy properties are stated according toSection 5 ofRFC6973.

§ Surveillance

In the strict scope of this specification, the activities of the parties are notsubject to surveillance due to the presentationdata minimization andunlinkability characteristics of the credential issuance and presentationactions. However, in any digital trust ecosystem, there are other componentsthat could lead to surveillance depending on how they are implemented. Theseinclude:

§ Stored Data Compromise

The compromise of stored data held by the various agents in a digital trustecosystem must be mitigated by the respective agent software and hardware, andis out of scope of this specification. The stored data of an individual agentshall be protected by implementing best practices in securing mobile walletapplications and IT infrastructure, likeISO27001 andInformation SecurityManagement systems (ISMS).

§ Unsolicited Traffic

The issue of unsolicited traffic is out of scope of this specification. It is aconcern of the agents into which the AnonCreds library is embedded. Theprevention of unsolicited traffic shall be accomplished by implementing bestpractices in securing mobile wallet applications and IT infrastructure, likeISO27001 andInformation Security Management systems (ISMS).

§ Misattribution

The risk of misattribution when using AnonCreds is mitigated by the participantsfollowing the specification. However, as noted in thewarning found in thissection of thisspecification, a maliciousissuer could deliberately generate a weakprivate key for use in issuing AnonCreds credentials such that a uniqueidentifier for a holder can be determined via a brute force attack. In thatcase, anyone applying the brute force attack could issue credentials as it theywere from theIssuer, possibly with false information. This riskfurther incentivizeIssuers not to deliberately weaken their keys.

If a third party gains access to the secure storage of aHolder (or acopy thereof), they could present information as if they were theHolder. The stored data of an individual agent shall be protected byimplementing best practices in securing mobile wallet applications and ITinfrastructure, likeISO27001 andInformation Security Management systems(ISMS).

§ Correlation

As noted in the introduction to this section, AnonCreds v1 uses two importanttechniques to prevent correlation in the issuance and presentation of verifiabledata:

§ Identification

AnonCreds v1 enables, but does not itself provide, identification. Theunlinkability anddata minimization capabilities inherent inAnonCreds enable theHolder to provide presentations anonymously.However, theclaims within the presentation are from verifiably issuedcredentials, and as such, may be used for identification.

§ Secondary Use

The disclosedclaims andpredicates presented by theHolder to theVerifier are necessarily visible to theverifier. The secondary use of that data is outside the scope of the AnonCredsspecification, and is a governance issue. Aholder that presents datato averifier using AnonCreds cannot “revoke” that the presentation wasmade as theverifier already possesses the disclosed data.

§ Disclosure

The disclosedclaims andpredicates presented by theHolder to theVerifier are necessarily visible to theverifier. The disclosure of that data by theverifier is outside thescope of the AnonCreds specification, and is a governance issue. Aholder that presents data to averifier using AnonCreds cannot“revoke” that the presentation was made as theverifier already possesses thedisclosed data.

§ Exclusion

The participants (issuers,holders,verifiers) usingAnonCreds may apply whatever policies (including refusal) they want in issuing,holding, requesting, presenting, and verifying AnonCreds verifiable credentialand presentations. Such policies are out outside thescope of the AnonCreds specification, and are governance issues.

§ References

§ Normative References

TODO

Add normative references

§ Informative References

TODO

Add informative references

§ Resources on cryptography

§ Sigma protocols

§ Acknowledgements

AnonCreds was initially created as part of the Open Source HyperledgerIndy project.

This specification is the work of the AnonCreds Working Group, which includes dozensof active and dedicated participants. In particular, the following individualscontributed ideas, feedback, and wording that influenced this specification:

§ Authors’ Addresses

TODO

Add authors’ addresses.

Table of Contents

[8]ページ先頭

©2009-2025 Movatter.jp