JSON-LD issuer initialization
Procedure
-
Write the issuer DID of the agent to a ledger or set the agents DID method to
did:web. -
Create or retrieve a credential schema.
- For JSON-LD and BBS+ credentials, the credential schema consists of JSON-LD context URLs or inline objects.
For example, the following command creates a credential schema for issuing a credential to a citizen of a country.
curl --location 'https://${service_url}/v2.0/diagency/credential_schemas' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ${issuer1_verifiable_credentials_access_token}' \ --data '{ "name": "citizen", "version": "1.0", "contexts": [ "https://www.w3.org/2018/credentials/v1", "https://w3id.org/citizenship/v1" ] }' -
Create a credential definition: A credential definition uniquely identifies the issuing agent and the attributes that are included in the credential. It is created by using the schema ID. A credential schema contains the data model for issuing credentials whereas a credential definition defines the encoding and security aspects of the issued credential.
Create a credential definition for
issuer1associated with the credential schemaid.curl --location 'https://${service_url}/v1.0/diagency/credential_definitions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ${issuer1_verifiable_credentials_access_token}' \ --data ' { "schema_id": "d9e80072-58e3-44f0-ad39-be5dfa13a3c2", "credential_document_type": ["VerifiableCredential", "PermanentResidentCard"], "credential_format": "ldp_vc", "cryptographic_binding_methods": ["did:key"], "key_proof_types": { "di_vp": [ "Ed25519Signature2020" ] }, "cryptographic_binding_methods": [], "credential_signing_algorithm": [ "eddsa-rdfc-2022" ], // Or [ "Ed25519Signature2020" ] }The response includes the preceding configuration, a copy of the specified schema, and a unique ID for the credential definition.
- For
ldp_vp, the value must be an array that containsEd25519Signature2020oreddsa-rdfc-2022. - The supported values for
credential_signing_algorithmare:- For non-BBS credentials:
Ed25519Signature2020oreddsa-rdfc-2022. - For BBS credentials:
BbsBlsSignature2020orbbs-2023.
- For non-BBS credentials:
- For
- Optional:
To enable status information for credentials issued from this credential definition, add a credential status provider by including the following in the credential definition request body:
{ “credential_status_provider”: { “id”: “79d219ee-6da8-45b1-9920-01bb901486c” “enabled_status_purposes”: [“revocation”, “suspension”] } }For more information, see Enabling status information.
Note: Enabling the status information for BBS+ is currently not supported.
What to do next
After the issuer initialization is complete, issuer1 can issue a credential to user1.