Overview
Verifiable credentials are digital credentials that can be cryptographically verified. Credo supports three major credential formats:- W3C Verifiable Credentials (JSON-LD and JWT)
- SD-JWT VC (Selective Disclosure JWT Verifiable Credentials)
- AnonCreds (Anonymous Credentials)
W3C Verifiable Credentials
W3C Verifiable Credentials follow the W3C VCDM (Verifiable Credentials Data Model) specification. Credo supports both version 1.1 and version 2.0.W3cCredentialsModule
TheW3cCredentialsModule is a default module that provides W3C VC functionality:
packages/core/src/modules/vc/W3cCredentialsModule.ts:20
Data Model v1.1
W3C VCDM 1.1 credentials are accessible throughagent.w3cCredentials:
Data Model v2.0
W3C VCDM 2.0 credentials are accessible throughagent.w3cV2Credentials:
Proof Formats
- JSON-LD
- JWT
JSON-LD credentials use Data Integrity proofs (formerly Linked Data Proofs).Features:
- Semantic interoperability
- Context-based vocabulary
- Multiple signature suites
- Linked data ecosystem
Ed25519Signature2018Ed25519Signature2020
packages/core/src/modules/vc/W3cCredentialsModule.ts:40
When to Use W3C VCs
Use W3C Verifiable Credentials when:
- You need semantic interoperability with JSON-LD
- You’re building for broad ecosystem compatibility
- You want to use standard W3C specifications
- You need simple, straightforward credentials
- You’re integrating with OpenID4VC
SD-JWT VC (Selective Disclosure JWT)
SD-JWT VC enables selective disclosure of credential claims, allowing holders to reveal only specific information.SdJwtVcModule
TheSdJwtVcModule is a default module that provides SD-JWT VC functionality:
packages/core/src/modules/sd-jwt-vc/SdJwtVcModule.ts:10
Creating SD-JWT VCs
Selective Disclosure
The holder can choose which claims to disclose:Verification
When to Use SD-JWT VC
Use SD-JWT VC when:
- You need selective disclosure of claims
- Privacy is a primary concern
- You want to minimize data sharing
- You’re building for OpenID4VC with SD-JWT support
- You need JWT-based credentials with privacy
AnonCreds (Anonymous Credentials)
AnonCreds provides advanced privacy features including zero-knowledge proofs and credential revocation.AnonCredsModule
AnonCreds support requires the@credo-ts/anoncreds package:
AnonCreds Architecture
AnonCreds has a more complex architecture:- Schema: Defines the attributes of a credential
- Credential Definition: Links schema to an issuer
- Revocation Registry: Manages credential revocation
- Credential: The actual credential issued to a holder
- Proof: Zero-knowledge proof presentation
Creating AnonCreds
AnonCreds Proofs
AnonCreds enables zero-knowledge proofs:Revocation
AnonCreds supports efficient revocation:When to Use AnonCreds
Use AnonCreds when:
- You need zero-knowledge proofs
- You need predicates (prove age >= 18 without revealing age)
- You need efficient revocation
- You’re building on Hyperledger Indy networks
- Privacy is critical
- You need unlinkability between presentations
Credential Format Comparison
| Feature | W3C VC (JSON-LD) | W3C VC (JWT) | SD-JWT VC | AnonCreds |
|---|---|---|---|---|
| Selective Disclosure | ❌ No | ❌ No | ✅ Yes | ✅ Yes |
| Zero-Knowledge Proofs | ❌ No | ❌ No | ❌ No | ✅ Yes |
| Predicates | ❌ No | ❌ No | ❌ No | ✅ Yes |
| Revocation | ⚠️ Limited | ⚠️ Limited | ⚠️ Limited | ✅ Efficient |
| Setup Complexity | ✅ Low | ✅ Low | ✅ Low | ❌ High |
| Infrastructure | ✅ None | ✅ None | ✅ None | ❌ Ledger Required |
| Semantic Interop | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Unlinkability | ❌ No | ❌ No | ⚠️ Partial | ✅ Yes |
| Standard Status | ✅ W3C Standard | ✅ W3C Standard | ✅ IETF Draft | ⚠️ Community |
Storage and Repositories
Each credential format has its own repository for storage:W3C Credential Storage
SD-JWT VC Storage
AnonCreds Storage
AnonCreds uses multiple repositories:packages/core/src/storage/Repository.ts:13
Presentation Exchange
Credo includes the DIF Presentation Exchange module for requesting and presenting credentials:Best Practices
Format Selection:
- Start with W3C VCs for simple use cases
- Add SD-JWT VC when you need selective disclosure
- Use AnonCreds for maximum privacy and ZKP features
- Consider your infrastructure requirements
- Always verify credentials before trusting them
- Check credential status (revocation)
- Validate issuer DIDs
- Verify proof signatures
- Use selective disclosure to minimize data sharing
- Consider unlinkability requirements
- Implement proper data retention policies
- Use predicates instead of revealing exact values when possible
- Use W3C VCs for maximum interoperability
- Document which formats your application supports
- Test with multiple verifier implementations
- Follow credential type conventions
OpenID4VC Integration
Credo supports OpenID for Verifiable Credentials (OpenID4VCI and OpenID4VP):Related Topics
- Agent - Learn about agent architecture
- DID Methods - DIDs used for credential issuance
- Modules - Understanding credential modules
- Storage - How credentials are stored