Overview
AnonCreds is a credential format that provides:- Zero-knowledge proofs - Prove attributes without revealing them
- Selective disclosure - Share only required attributes
- Privacy-preserving - Unlinkable presentations
- Predicate proofs - Prove conditions (e.g., age > 18) without revealing exact values
- Revocation - Support for credential revocation
Installation
Dependencies
AnonCreds requires:@credo-ts/core- Core functionality@credo-ts/didcomm- DIDComm protocols (automatically installed)@hyperledger/anoncreds-shared- Native AnonCreds implementation- A registry module for ledger operations (e.g.,
@credo-ts/indy-vdr)
Registration
Configuration Options
Core Concepts
Schema
Defines the structure of a credential:Credential Definition
Public key for issuing credentials based on a schema:Revocation Registry
For supporting credential revocation:Issuer Operations
Create Schema and Credential Definition
Issue Credential (via DIDComm)
AnonCreds credentials are typically issued through DIDComm protocols:Holder Operations
Create Link Secret
Required before receiving credentials:Receive Credential
Verifier Operations
Request Proof
Verify Proof
Advanced Features
Predicate Proofs
Prove conditions without revealing values:Revocation
Non-Revocation Proofs
Request proof that credential hasn’t been revoked:Registry Support
The module supports multiple AnonCreds registries:Indy VDR
Cheqd
Hedera
API Reference
agent.modules.anoncreds.registerSchema()- Register schema on ledgeragent.modules.anoncreds.registerCredentialDefinition()- Register credential definitionagent.modules.anoncreds.registerRevocationRegistryDefinition()- Register revocation registryagent.modules.anoncreds.createLinkSecret()- Create link secret for holderagent.modules.anoncreds.revokeCredential()- Revoke a credential
Integration with DIDComm
AnonCreds credentials use DIDComm protocols for exchange:- Issue Credential Protocol v1/v2
- Present Proof Protocol v1/v2