This flow refers to Postman, but the general steps are the same however you use the API. The Issue Store Verify collection includes the scripts that automatically propagate results into the next request bodies when you follow the below steps.
To issue a credential and or a presentation on the holder's behalf, the following steps are required:
1. Create a DID
To create a new DID to issue with, go to Create DID and click Send. The id property denotes a job ID in the system that you can use to query for blockchain transaction status.
The Dock API supports did:dock, did:polygonid and did:key method creation.
Creating a Dock DID submits a transaction to the blockchain, this could take some time to process. Please hit the `/jobs` endpoint to check the status of the job to see if it's finalized or not.
When creating a Polygon ID DID, be sure to set the `keyType` field to `bjj`.
2. Update the DID
To add information about your Organization to the DID, e.g. name and logo, you will need to update the DID profile.
You only need to create a DID once and then you can issue many credentials with it. A subject/holder DID should not be the same as the issuer DID in a real world credential.
3. Create a Schema
To issue a credential you will need to set a schema that will define which attributes need to be included in the credential.
Body
{"$schema":"http://json-schema.org/schema","name":"Postman test schema","description":"describing Postman test schema","type":"object","properties": {"id": {"type":"string" },"emailAddress": {"type":"string","format":"email" },"alumniOf": {"type":"string" } },"required": ["emailAddress","alumniOf" ],"additionalProperties":false }
To create a Verifiable Credential using the the new issuer DID, update Issuer with the DID you have created in the first step and add the required information to the attributes. It will return a Verifiable Credential that conforms to the W3C spec.
Body
{"persist":true,"password":"1234","anchor":false,"recipientEmail":"agne@dock.io","distribute":true,"format":"jsonld","credential": {"name":"VPI test credential","description":"describing vpi test credential","schema":"https://schema.dock.io/VPITestSchema-V1-1723546475527.json","type": ["VPITestSchema" ],"subject": {"id":"agne@dock.io","emailAddress":"agne@dock.io","alumniOf":"University of Vilnius" },"issuer":"did:dock:5DciJXakYFsCfpFzQzrHCdoRvRwi1gu2uUGJnys5Aj4cvWUx","issuanceDate":"2024-08-13T11:03:35.610Z" }}
200 Response
{"@context": ["https://www.w3.org/2018/credentials/v1", {"VPITestSchema":"dk:VPITestSchema","alumniOf":"dk:alumniOf","description":"http://schema.org/description","dk":"https://ld.dock.io/credentials#","emailAddress":"dk:emailAddress","name":"dk:name" } ],"id":"https://creds-testnet.dock.io/43800063042edf33e7092653e487aeb795e528d24664be5ea641b62f279dc69d","type": ["VerifiableCredential","VPITestSchema" ],"credentialSubject": {"id":"agelzinyte@gmail.com","emailAddress":"agelzinyte@gmail.com","alumniOf":"University of Vilnius" },"issuanceDate":"2024-08-13T11:03:35.610Z","issuer": {"name":"VPI test issuer","id":"did:dock:5DciJXakYFsCfpFzQzrHCdoRvRwi1gu2uUGJnys5Aj4cvWUx" },"credentialSchema": {"id":"https://schema.dock.io/VPITestSchema-V1-1723546475527.json","type":"JsonSchemaValidator2018" },"name":"VPI test credential","description":"describing vpi test credential","proof": {"type":"Ed25519Signature2018","created":"2024-08-16T12:14:55Z","verificationMethod":"did:dock:5DciJXakYFsCfpFzQzrHCdoRvRwi1gu2uUGJnys5Aj4cvWUx#keys-1","proofPurpose":"assertionMethod", "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..IbZADG6nhKe7lSHUuQ4OyEAToeGybN7nYl2Pp8rsUzc-oVAKYzBzZX2gMM8Bj4Np1cNK9WvpjlyRWjgVviz_Bg"
}}
5. Verify the Signed Credential
To verify if the credential's cryptographic proof, revocation status and more go to Verify Signed Credential and click Send.
CREDENTIAL VERIFIED - 200 Response
{"verified":true,"results": [ ... ]}
6. Import the credential into the wallet
Download Dock wallet and click on the email link that was sent when issuing the credential. If not using the email distribution download the json of the credential an import it to the wallet using the json import option.
5. Create a verification/proof template
To verify a credential you will need a verification template, that will indicate which attributes need to be fullfilled for successfull verification. Verification templates can be reused.
Using the verification template created in the previous step in the endpoint POST/proof-templates/{id}/ request a single use verification or proof presentation will be created.
The proof request is one time use so that the information from the credential can be associated to a specific transaction event. However, the proof template can be used as many times as needed.
If there is a need to have a static QR code for multiple verification, a small service can be created to make proof requests from the verification template as and when needed.
6. Verify the Presentation
Scan the QR code from the proof presentation using your wallet to verify the credential.