Verify your first credential
This guide builds on the previous guide by walking you through a simple verification workflow.
You can use the provided curl requests directly (with minor modifications), or you can start the development server and import the API schema into your preferred API client for a more interactive experience.
Verifiers usually request a "proof" and wallet holders usually submit a "proof" or a "presentation", as opposed to a "credential". This is because requests and presentations are often made up of a subset of claims from one or more credentials.
In this guide we keep things simple by asking for all claims of the single credential we issued in the previous guide.
Prerequisites
- You've completed Issue your first credential
and have:
- The credential in your wallet
- The credential schema in your system
- The organization, key, and DID in your system
1
Create a proof schema
First, you'll need to define what information you want to request. You do this by creating a proof schema - a reusable template that lets you consistently request the same information across different interactions.
Make the following curl request, making sure to use your stored UUIDs for:
- Organization
- Credential schema
- Claims
Lose your UUIDs?
The easiest way to retrieve UUIDs is by calling the list endpoint for the desired resource. Here's a cheat sheet of list endpoints for resources you will use in this guide:
- GET
/api/organisation/v1
- GET
/api/credential-schema/v1
- GET
/api/credential-schema/v1/{{YOUR-CREDENTIAL-SCHEMA-UUID}}
(retrieve details for claim UUIDs) - GET
/api/did/v1
curl -L '/api/proof-schema/v1' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "My first proof schema",
"organisationId": "{{YOUR-ORG-UUID}}",
"proofInputSchemas": [
{
"claimSchemas": [
{
"id": "{{NAME-CLAIM-UUID}}",
"required": true
},
{
"id": "{{BIRTHDATE-CLAIM-UUID}}",
"required": true
},
{
"id": "{{EMAIL-CLAIM-UUID}}",
"required": true
}
],
"credentialSchemaId": "{{YOUR-CREDENTIAL-SCHEMA-UUID}}"
}
]
}'
The system responds with the UUID of your new proof schema.
{
"id": "{{YOUR-PROOF-SCHEMA-UUID}}"
}
Store this value for later use.
2
Request a proof
You'll need to tell the system how you want to request the proof in this interaction. In this case we use OpenID4VC. Make the following curl request, making sure to use your stored UUIDs:
curl -L -X POST '/api/proof-request/v1' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"exchange": "OPENID4VC", // Value from your configuration
"proofSchemaId": "{{YOUR-PROOF-SCHEMA-UUID}}",
"verifierDid": "{{YOUR-DID-UUID}}"
}
Issues with exchange
?
The exchange
field must reference a configured instance of an
exchange protocol. The value in the sample comes from the default
one-core
configuration. Always
check your configuration.
The system responds with the UUID of your new proof request:
{
"id": "{{YOUR-PROOF-REQUEST-UUID}}"
}
Store this value for later use.
With your request created, you can now share it. The share endpoint creates a URL that can be encoded as a QR code for the wallet to connect to. Make the following curl request:
curl -L -X POST '/api/proof-request/v1/{{YOUR-PROOF-REQUEST-UUID}}/share' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
The system responds with the request URL:
{
"url": "{{YOUR-REQUEST-URL}}",
}
-
Encode the URL as a QR code.
-
Scan the QR code with your wallet and "Share" your information. The system now verifies the shared data.
Start integrating
Ready to start integrating? Find an integration guide.