Product Docs
Product DocsTechnical DocsLearning & GovernanceUseful Links
  • Product Docs
  • Node Docs
  • Learning Docs
  • โ„น๏ธGetting Started
    • Product Overview
    • โžก๏ธGet Started with cheqd Studio
      • ๐Ÿ‘‰Set Up Your Account
      • ๐Ÿ—๏ธCreate API Keys
      • ๐Ÿช™Token Top Up
      • ๐Ÿ”„Advanced Configuration Options
    • โ˜‘๏ธUse Trust Registries for AI Agents
      • ๐Ÿ—๏ธBuild an AI Agent Trust Registry
        • Setup AI Agent Trust Registry
          • Issue Verifiable Credentials to AI Agent
        • Setup and Configure MCP Server
          • Create AI Agent DID
          • Import Credential to AI Agent
          • Advanced functionality
            • Issue a Verifiable Credential
            • Verify a Credential
      • ๐ŸคValidate AI Agent Trust Chain
  • ๐ŸŸขStart using cheqd
    • ๐Ÿ†”Create DIDs and Identity Keys
      • Create Issuer DID
      • Create Identity Keys and Subject DIDs
      • Resolve a DID
      • Update a DID
      • Deactivate a DID
    • โœ…Issue Credentials and Presentations
      • Issue Credential
      • Setup Verida Wallet
      • Verify Credential
      • Verify Presentation
      • Revoke Credential
      • Suspend or Unsuspend Credential
    • โ™ป๏ธCharge for Verifiable Credentials
      • Understanding Credential Payments
        • Access Control Conditions
        • Privacy Considerations
      • Charge for Status List
      • Issue Credential with Encrypted Status List
      • Create Verifier Pays Issuer flow
      • Bulk Update or Rotate Encryption Keys
    • ๐ŸคBuild Trust Registries
      • Decentralized Trust Chains (DTCs)
        • Root Authorisations
        • RTAO -> TAO
        • TAO -> SubTAO
        • TAO -> Trusted Issuer (TI)
        • Referencing Trust Registry within a Verifiable Credential
      • Set up Trust Chain
        • Issue Verifiable Accreditation
        • Verify Verifiable Accreditation
      • Get Started with TRAIN
        • Deploy TRAIN and Anchor rTAO in DNS
        • Validate Trust Chain
    • ๐ŸŽ‹Create Status Lists
      • Bitstring Status List
        • Create Bitstring Status List
        • Update Bitstring Status List
        • Check Bitstring Status List
        • Search Bitstring Status List
      • Token Status List
        • Create Token Status List
        • Update Token Status List
    • โ†•๏ธCreate DID-Linked Resources
      • Understanding DID-Linked Resources
        • Context for developing DID-Linked Resources
        • Technical composition of DID-Linked Resources
        • Referencing DID-Linked Resources in VCs
      • Create DID-Linked Resource
      • Search DID-Linked Resource
  • ๐Ÿ› ๏ธIntegrate an SDK
    • Choosing the right SDK
    • ๐ŸCredo
      • Setup Credo Agent
      • Decentralized Identifiers (DIDs)
        • Create a DID
        • Update a DID
        • Deactivate a DID
      • DID-Linked Resources
        • Create DID-Linked Resource
        • Resolve DID-Linked Resource
        • Create AnonCreds Schema
        • Create AnonCreds Credential Definition
      • Verifiable Credentials and Presentations
        • Issue a Verifiable Credential (AnonCreds)
        • Present a Verifiable Credential (AnonCreds)
    • ๐ŸŠACA-Py
      • Setup ACA-Py Agent
      • Decentralized Identifiers (DIDs)
        • Create a DID
        • Update a DID
        • Deactivate a DID
      • DID-Linked Resources
        • Create AnonCreds Schema
        • Create AnonCreds Credential Definition
      • Verifiable Credentials and Presentations
        • Issue a Verifiable Credential
        • Present a Verifiable Credential
        • Revoke a Verifiable Credential
    • ๐ŸˆVeramo
      • Setup Veramo CLI for cheqd
        • Troubleshooting Veramo CLI setup
      • Decentralised Identifiers (DIDs)
        • Create a DID
        • Querying a DID
        • Update an existing DID
        • Deactivate a DID
        • Create an off-ledger holder DID
        • Managing Identity Keys
        • Troubleshooting
      • Verifiable Credentials and Presentations
        • Issue a Verifiable Credential
        • Verify a Verifiable Credential
        • Create a Verifiable Presentation
        • Verify a Verifiable Presentation
      • Credential Payments
        • Charge for Status List
        • Issue Credential with Encrypted Status List
        • Verifier pays Issuer
      • Bitstring Status List
        • Create Status List
        • Issuing a Verifiable Credential referencing Status List
      • DID-Linked Resources
        • Create a DID-Linked Resource
        • Create a new Resource version within existing Collection
    • ๐ŸซWalt.id Community Stack
  • ๐Ÿ—๏ธArchitecture
    • Architecture Decision Record (ADR) Process
    • List of ADRs
      • ๐Ÿ”ตADR 001: cheqd DID Method
      • ๐ŸŸขADR 002: DID-Linked Resources
      • ๐ŸŸกADR 003: DID Resolver
      • ๐ŸŸ ADR 004: DID Registrar
      • ๐ŸŸฃADR 005: DID Resolution & DID URL Dereferencing
  • ๐Ÿ’ซAdvanced features and alternatives
    • โžก๏ธDID Registrar
      • Setup DID Registrar
      • Create a DID
      • Create a DID-Linked Resource
    • โฌ…๏ธDID Resolver
      • Setup DID Resolver
    • โšกAnonCreds Object Method
      • Schemas
      • Credential Definitions
      • Revocation Registry Definitions
      • Revocation Status Lists
    • ๐ŸŒ Advanced Tooling
      • cheqd Cosmos CLI for identity
        • Create a DID
        • Update a DID
        • Deactivate a DID
        • Query a DID
        • Create a DID-Linked Resource
        • Update a DID-Linked Resource
      • Direct interaction with ledger code
      • VDR Tools CLI with cheqd (deprecated)
      • Demo Wallet for Identity Setup
  • โš›๏ธNetwork
    • Get started with cheqd Network
      • Identity Write Pricing
      • Comparison to Hyperledger Indy
    • โฉSetup your Wallet
      • Setup Leap Wallet
        • Congifure cheqd testnet for Leap
      • Setup Keplr Wallet
      • Migrate from Keplr to Leap Wallet
    • โ†ช๏ธUseful Tools and APIs
      • Block Explorer
      • Testnet Faucet
      • Validator Status API
      • Cheqd x Cosmos Data APIs
      • Cosmos Airdrop Helpers
      • Cosmos Address Convertor
      • Ethereum Bridge
    • โฌ†๏ธNetwork Upgrades
      • 2021
        • 0.1.x
        • 0.2.x
        • 0.3.x
      • 2022
        • 0.4.x
        • 0.5.x
        • 0.6.x
      • 2023
        • 1.x
      • 2024
        • 2.x
        • 3.x
      • Root Cause Analysis of Outages
        • v1.x upgrade RCA
  • โš–๏ธLegal
    • License
    • Code of Conduct
    • Security Policy
  • ๐Ÿ†˜Support
    • System Status
    • Discord
    • Bugs & Feature Requests
Powered by GitBook
LogoLogo

General

  • Website
  • Blog
  • Get $CHEQ

Product Docs

  • Product Docs
  • cheqd Studio
  • Creds.xyz
  • Bug/Feature Requests

Technical Docs

  • Node Docs
  • GitHub
  • Block Explorer

Learning Docs

  • Learning Docs
  • Governance Docs
  • Governance Forum
  • Governance Explorer
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Start using cheqd
  2. Create DID-Linked Resources

Create DID-Linked Resource

Create a DID-Linked Resource (DLR) associated with a cheqd Decentralized Identifier (DID) over REST API, using cheqd Studio.

Last updated 7 days ago

Was this helpful?

Using the /resource/create API, users are able to create custom DID-Linked Resources, including:

  1. Schemas

  2. Credential Definitions

  3. Trust Registries

  4. Status Lists

  5. Logos associated with DIDs

  6. Governance files

Step 1: Set up your account

Make sure you have set up your account with cheqd Studio and are logged in, using our guide below:

Step 2: Create a DID

Before you can create a DID-Linked Resource, you need to create a "parent" DID which is used to link the Resource on-ledger. Use the API in the page below to create a DID:

Step 3. Create your Resource content and save the file locally

DID-Linked Resources can be any type of file or content that is below ~45kb in size.

For the purpose of an example, lets use an AnonCreds schema (JSON file) as the resource:

{
  "name": "degreeSchema",
  "version": "1.5.7",
  "attrNames": ["name", "age", "degree", "grade"]
 }

Save this file locally and call it something like resource.json.

Step 4: Encode the file

Prepare a file with resource and encode it into base64, base64url or hex. On Unix systems, you can use the following command input:

$ base64 -w 0 resource.json
<path-to-the-resource-file>

Expected output:

$ base64 -w 0 resource.json
SGVsbG8sIHdvcmxk

Step 5: Set a consistent name and type

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.

Step 6: Populate the request inputs and hit the API

๐ŸŸข
โ†•๏ธ

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.

Learn more about DID-Linked Resources

Understand the context and technical composition of cheqd's DID-Linked Resources.

  • Step 1: Set up your account
  • Step 2: Create a DID
  • Step 3. Create your Resource content and save the file locally
  • Step 4: Encode the file
  • Step 5: Set a consistent name and type
  • Step 6: Populate the request inputs and hit the API
  • POSTCreate a DID-Linked Resource.

Create a DID-Linked Resource.

post

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.

Authorizations
Path parameters
didstringRequired

DID identifier to link the resource to.

Body

Input fields for DID-Linked Resource creation.

datastringRequired

Encoded string containing the data to be stored in the DID-Linked Resource.

encodingstring ยท enumRequired

Encoding format used to encode the data.

Possible values:
namestringRequired

Name of DID-Linked Resource.

typestringRequired

Type of DID-Linked Resource. This is NOT the same as the media type, which is calculated automatically ledger-side.

versionstringOptional

Optional field to assign a human-readable version in the DID-Linked Resource.

publicKeyHexsstring[]Optional

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.

Responses
200
The request was successful.
application/json
400
A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.
401
Access token is missing or invalid
500
An internal error has occurred. Additional state information plus metadata may be available in the response body.
post
POST /resource/create/{did} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 94

"data='SGVsbG8gV29ybGQ='&encoding='base64url'&name='ResourceName'&type='TextDocument'"
{
  "resourceURI": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b",
  "resourceCollectionId": "55dbc8bf-fba3-4117-855c-1e0dc1d3bb47",
  "resourceId": "398cee0a-efac-4643-9f4c-74c48c72a14b",
  "resourceName": "cheqd-issuer-logo",
  "resourceType": "CredentialArtwork",
  "mediaType": "image/png",
  "resourceVersion": "1.0",
  "checksum": "a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559",
  "created": "2021-09-01T12:00:00Z",
  "nextVersionId": "d4829ac7-4566-478c-a408-b44767eddadc",
  "previousVersionId": "ad7a8442-3531-46eb-a024-53953ec6e4ff"
}