Create a Token Status List JWT or CWT as a DID-Linked Resource
Users are able to create Token Status List entries on-ledger, which may be used to represent whether a Verifiable Credential is active, inactive or suspended. This implementation on cheqd is a derivation from the core spec made by cheqd to support a more decentralised and resilient approach to storing Token Status Lists.
Make sure you have set up your account with cheqd Studio and are logged in, using our guide below:
Before you can create a Status List, you need to create a DID which is used to link the Status List on-ledger. Use the API in the page below to create a DID:
Token Status Lists are JWT or CWT files that reference lists of bits formatted in JSON or CBOR.
Save this file locally and call it something like statusListToken.json
Note that each JWT or CWT must be below ~45kb in size.
Prepare a file with resource and encode it into base64, base64url
or hex
. On Unix systems, you can use the following command input:
Expected output:
DID-Linked Resources are grouped by having identical names and types. This means if you want to create a new version of the same Resource, you will need to specify the same name and type in the following request.
For Token Status Lists, the "type" MUST be: "TokenStatusList"
.
For example:
Ensure that you link this Token Status List to the DID that you created in step 3. This will sign the resource with the same verification method keys in your DID Document, ensuring cryptographic integrity and Controllership of the Status List.
As a DID-Linked Resource, the Token Status List will have a fully resolvable DID URL which can be referenced within the body of Verifiable Credentials, and queried by verification policies to establish the status of the specific credential.
Owing to the design of DID-Linked Resources, following the creation of the Token Status List, users are able to reference the specific version, or create a query to always fetch the latest version of the Token Status List.
Using a DID Resolver or the search DID endpoint, users can find the DID URL and unique resourceId of the Token Status List. The unique resourceId allows users to specify this exact version of the Token Status List.
In the DID Document Metadata, users should find "linkedResourceMetadata", like the following snippet:
Here, the "resourceURI
" specifies the DID URL of the specific Token Status List that was created.
In order to reference the latest version of the Token Status List, the following construction needs to be used:
did:cheqd:<namespace>:<resourceCollectionId>?resourceName=<resourceName>&resourceType=<resourceType>
For example:
did:cheqd:testnet:0a5b94d0-a417-48ed-a6f5-4abc9e95888d?resourceName=DegreeCredentialStatus&resourceType=TokenStatusList
In order to reference the Token Status List at a particular point in time, the following construction needs to be used:
did:cheqd:<namespace>:<resourceCollectionId>?resourceName=<resourceName>&resourceType=<resourceType>&resourceVerionTime=<XMLDateTime>
For example:
did:cheqd:testnet:0a5b94d0-a417-48ed-a6f5-4abc9e95888d?resourceName=DegreeCredentialStatus&resourceType=TokenStatusList&resourceVersionTime=2023-02-22T06:58:18.61Z
Set up your account
Set up your account with cheqd Studio and log in to start using the APIs.
Create an Issuer DID
Create a W3C conformant DID on cheqd using the did:cheqd
DID Method.
This endpoint creates a DID-Linked Resource. As input, it can take the DID identifier and the resource parameters via a form, or the fully-assembled resource itself.
DID identifier to link the resource to.
Encoded string containing the data to be stored in the DID-Linked Resource.
Encoding format used to encode the data.
Name of DID-Linked Resource.
Type of DID-Linked Resource. This is NOT the same as the media type, which is calculated automatically ledger-side.
Optional field to assign a set of alternative URIs where the DID-Linked Resource can be fetched from.
Optional field to assign a human-readable version in the DID-Linked Resource.
List of key references (publicKeys) which will be used for signing the message. The should be in hexadecimal format and placed in the wallet of current user.
The request was successful.
"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"
"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
"398cee0a-efac-4643-9f4c-74c48c72a14b"
"cheqd-issuer-logo"
"CredentialArtwork"
"image/png"
"1.0"
"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"
"2021-09-01T12:00:00Z"
"d4829ac7-4566-478c-a408-b44767eddadc"
"ad7a8442-3531-46eb-a024-53953ec6e4ff"
Resolve a DID Document by DID identifier. Also supports DID Resolution Queries as defined in the W3C DID Resolution specification.
DID identifier to resolve.
"did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0"
Return only metadata of DID Document instead of actual DID Document.
Unique UUID version identifier of DID Document. Allows for fetching a specific version of the DID Document. See cheqd DID Method Specification for more details.
"3ccde6ba-6ba5-56f2-9f4f-8825561a9860"
Returns the closest version of the DID Document at or before specified time. See DID Resolution handling for did:cheqd
for more details.
"1970-01-01T00:00:00Z"
This directive transforms the Verification Method key format from the version in the DID Document to the specified format chosen below.
Query DID Document for a specific Service Endpoint by Service ID (e.g., service-1
in did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1
). This will typically redirect to the Service Endpoint based on DID Resolution specification algorithm.
"service-1"
Relative reference is a query fragment appended to the Service Endpoint URL. Must be used along with the service
query property above. See DID Resolution specification algorithm for more details.
"/path/to/file"
The request was successful.
"https://w3id.org/did-resolution/v1"
"application/did+ld+json"
"2021-09-01T12:00:00Z"
"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
"cheqd"
"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
This input field contains either a complete DID document, or an incremental change (diff) to a DID document. See Universal DID Registrar specification.
DID appended with Service fragment ID (e.g., #service-1
in did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1
)
"did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1"
Service type as defined in DID Specification Registries.
"LinkedDomains"
Service endpoint as defined in DID Core Specification.
"https://example.com"
"2021-09-01T12:00:00Z"
false
"2021-09-10T12:00:00Z"
"3ccde6ba-6ba5-56f2-9f4f-8825561a9860"
"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"
"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"
"398cee0a-efac-4643-9f4c-74c48c72a14b"
"cheqd-issuer-logo"
"CredentialArtwork"
"image/png"
"1.0"
"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"
"2021-09-01T12:00:00Z"
"d4829ac7-4566-478c-a408-b44767eddadc"
"ad7a8442-3531-46eb-a024-53953ec6e4ff"