Credential schemas
A credential schema defines the set of attributes (claims) a credential of that type will contain, along with a version string. Schemas are published to a ledger or referenced by a DID Document so that any party can look up and validate the credential’s structure. CREDEBL supports two schema types, defined in theSchemaType enum:
- AnonCreds (Indy)
- W3C JSON-LD
Schemas are published to a Hyperledger Indy ledger. Each attribute has a name; the data type is expressed separately in the credential definition and issuance payload.Supported attribute data types (
IndySchemaDataType):stringnumberdatetime-localboolean
Creating a schema
Onlyowner and admin roles can create schemas. The endpoint supports Indy, Polygon, and W3C schemas through a single generic endpoint:
GET /orgs/:orgId/schemas and GET /orgs/:orgId/schemas/:schemaId.
Credential definitions
A credential definition links a schema to an issuer’s cryptographic keys. For AnonCreds credentials, a credential definition must exist before any credentials can be issued. It publishes the issuer’s public key material to the ledger so that holders can later prove possession without revealing the credential itself (using zero-knowledge proofs). Credential definitions are retrieved by schema ID:CredDefSortFields enum supports sorting by createDateTime, tag, schemaLedgerId, and credentialDefinitionId.
W3C JSON-LD credentials do not use credential definitions. The issuer’s signing key is referenced directly via the DID Document verification method.
The credential issuance lifecycle
Connection-based issuance
Establish a connection
The issuer and holder establish a DIDComm connection. The connection state transitions through:
start → invitation-sent → invitation-received → request-sent / request-received → response-sent / response-received → completed.Create a credential offer
The issuer sends a credential offer to the holder over the established connection:Supported
credentialType values: indy (AnonCreds) and jsonld (W3C JSON-LD).Holder receives and requests
The holder’s agent receives the offer. The issuance state transitions:
offer-sent → offer-received → request-sent → request-received.IssuanceProcessState):
| State | Description |
|---|---|
proposal-sent / proposal-received | Holder proposes a credential type |
offer-sent / offer-received | Issuer has sent a credential offer |
request-sent / request-received | Holder has accepted and requested the credential |
credential-issued | Issuer has signed and sent the credential |
credential-received | Holder’s agent has received the credential |
done | Issuance completed successfully |
declined | One party declined |
abandoned | Process abandoned |
Out-of-Band (OOB) issuance
OOB issuance allows credentials to be offered without a prior connection. CREDEBL supports two OOB modes: Email delivery — The issuer creates OOB credential offers and sends them directly to holder email addresses:Bulk issuance via CSV
CREDEBL supports issuing credentials to many holders simultaneously using a CSV file.Download the CSV template
Download a pre-formatted template that matches the schema’s attributes:The template includes column headers matching the credential schema attributes. The
email_identifier column (TemplateIdentifier.EMAIL_COLUMN) is used to identify each recipient.Fill and upload the CSV
Upload the completed CSV file:This returns a
requestId used to track the batch.The verification flow
Send a proof request
The verifier sends a proof request to a holder’s connection. CREDEBL supports two proof request types (For connectionless scenarios, use
ProofRequestType): indy (AnonCreds) and presentationExchange (DIF Presentation Exchange).POST /orgs/:orgId/proofs/oob.Holder presents proof
The holder’s agent receives the proof request and sends a presentation. The verification state transitions:
request-sent → request-received → presentation-sent → presentation-received.Verifier verifies the presentation
The verifier calls the verify endpoint to cryptographically check the presentation:
VerificationProcessState):
| State | Description |
|---|---|
proposal-sent / proposal-received | Holder proposes a proof type |
request-sent / request-received | Verifier has sent a proof request |
presentation-sent / presentation-received | Holder has sent a presentation |
done | Verification completed successfully |
declined | One party declined |
abandoned | Process abandoned |
Credential revocation
AnonCreds credentials support revocation. A revocation registry is created alongside a credential definition, and the issuer can revoke specific credentials without revealing which credential was revoked or the holder’s identity. The verifier requests a non-revocation proof as part of the proof request.OID4VC and OID4VP protocols
CREDEBL supports OpenID for Verifiable Credentials issuance (OID4VC) and OpenID for Verifiable Presentations (OID4VP). TheOpenId4VcIssuanceSessionState enum tracks OID4VC issuance sessions:
| State | Description |
|---|---|
OfferCreated | Credential offer has been created |
OfferUriRetrieved | The offer URI has been fetched by the wallet |
AuthorizationInitiated | Authorization flow has started |
AuthorizationGranted | Authorization has been granted |
AccessTokenRequested | Wallet has requested an access token |
AccessTokenCreated | Access token has been issued |
CredentialRequestReceived | Wallet has sent a credential request |
CredentialsPartiallyIssued | Some credentials in a batch have been issued |
Completed | All credentials have been issued |
Error | An error occurred during the session |
OID4VP supports
indy and presentationExchange request types, mirroring the connection-based verification flow. The response modes direct_post, direct_post.jwt, dc_api, and dc_api.jwt are defined in the ResponseMode enum.