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
issuer1
associated 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 ' { "credential_document_type": [ "VerifiableCredential", "PermanentResidentCard" ], "credential_format": "ldp_vc", "cryptographic_binding_methods": [ "did:key" ], "key_proof_types": { "ldp_vp": [ "Ed25519Signature2020" ] }, "credential_signing_algorithm": "Ed25519Signature2020", "schema_id": "d9e80072-58e3-44f0-ad39-be5dfa13a3c2" }'
The response includes the preceding configuration, a copy of the specified schema, and a unique ID for the credential definition.
What to do next
After the issuer initialization is complete, issuer1
can issue a credential to
user1
.