Decentralized Identities

Decentralized identities (DIDs) are a type of digital identity that is not controlled by any central authority or organization. Instead, DIDs are created and managed by the individual user, giving them greater control and ownership over their personal data and online presence.

DIDs are typically based on blockchain technology, which provides a secure and transparent way to store and manage identity information. Each DID is assigned a unique identifier, which can be used to authenticate and verify the identity of the user in a variety of contexts, such as logging into websites, accessing financial services, or participating in online communities.

One of the key benefits of DIDs is that they allow individuals to maintain their privacy and control over their personal data. Instead of relying on centralized databases or third-party identity providers, DIDs are stored locally on the user's device and can be selectively shared with others as needed.

DIDs are also designed to be interoperable, meaning that they can be used across different platforms and applications. This enables users to maintain a consistent identity across different services, without having to create and manage multiple accounts or identities.

Create DID for Issuer

Verifiable credentials are a form of digital identity that allows individuals and organizations to securely and selectively share information about themselves. By creating an Issuer DID, an entity can establish a trusted identity on a decentralized network.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/did/createIssuerDid' \
--header 'Content-Type: application/json' \
--data '{
  "domainId": 1,
  "method": "key",
  "name": "Broadcom R&D",
  "description": "R&D department of Broadcom"
}'
POST https://api.did.kloudlearn.com/api/v1/did/createIssuerDid
{
  "domainId": 1,
  "method": "key",
  "name": "Broadcom R&D",
  "description": "R&D department of Broadcom"
}

Access Token

Authorization Key Required

HTTP Request

POST https://api.did.kloudlearn.com/api/v1/did/createIssuerDid

Query Parameters

ParameterDescription
methodThe specific DID method used to create the DID (e.g. key, brcm).
domainIdThe company or organization using the service.
nameThe name of the issuer.
descriptionAdditional information about the issuer.

HTTP Response

{
  "id": "did:key:z6MkkHNepDyi2FYcNAwAHaujXaPFZG8dAzUFPJvneySxmXAK",
  "code": 200,
  "message": "Successfully created DID",
  "status": "Success"
}

Create DID for Holder

A Holder DID is a Decentralized Identifier (DID) used by a user to store and control their own verifiable credentials.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/did/createHolderDid' \
--header 'Content-Type: application/json' \
--data '{
  "method": "brcm",
  "domainId": 1,
  "walletUserId": 104,
  "issuerId": 126,
  "name":"Hema",
  "description":"This is a backend Test"
}'
POST /api/v1/did/createHolderDid HTTP/1.1
{
  "method": "brcm",
  "domainId": 1,
  "walletUserId": 104,
  "issuerId": 126,
  "name":"Hema",
  "description":"This is a backend Test"
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/did/createHolderDid HTTP/1.1

Query Parameters

ParameterDescription
methodThe specific DID method to use for creating the DID.
domainIdThe company or organization the user is part of.
walletUserIdThe unique ID of the user.
issuerIdThe ID of the issuer associated with this holder.
nameA user-friendly name or label for the credentials.
descriptionAdditional context about the identity.

HTTP Response

{
  "id": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "code": 200,
  "message": "Successfully created DID",
  "status": "Success"
}

DID List

The DID List API enables users to access and retrieve a list of available Decentralized Identifiers registered on a decentralized network.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/did/DIDList' \
--header 'Content-Type: application/json' \
--data '{
  "domainId": 1,
  "issuerId": 2,
  "userId": 104
}'
POST /api/v1/did/DIDList HTTP/1.1
{
  "domainId": 1,
  "issuerId": 2,
  "userId": 104
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/did/DIDList HTTP/1.1

Query Parameters

ParameterDescription
domainIdThe company or organization using the service.
issuerIdThe issuer DID used to identify the decentralized identity issuer.
userIdThe unique identifier associated with a user.

HTTP Response

[
    {
        "DIDType": "Issuer",
        "domainId": 1,
        "did": "did:brcm:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "issuerName": "Broadcom",
        "credentialIssued": 1,
        "desc": "This a issuer DID",
        "lastYpdatedAt": "02-12-2023 12:12:12"
    }
]

Search DID

The Search DID API is used in decentralized identities to search for and retrieve information about a specific DID on a given network or ledger.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/did/SearchDID' \
--header 'Content-Type: application/json' \
--data '{
  "name":"hema",
  "didType":"ISSUER",
  "pageNumber":1,
  "pageSize":10
}'
POST https://api.did.kloudlearn.com/api/v1/did/SearchDID HTTP/1.1
{
  "name":"hema",
  "didType":"ISSUER",
  "pageNumber":1,
  "pageSize":10
}

Access Token

Authorization Key Required

HTTP Request

POST https://api.did.kloudlearn.com/api/v1/did/SearchDID HTTP/1.1

Query Parameters

ParameterDescription
nameA user-friendly name to search for.
didTypeThe type of DID to search for (e.g. ISSUER, USER).
pageNumberThe page number of results to retrieve.
pageSizeThe number of search results to return per page.

HTTP Response

{
  "count": 1,
  "didList": [
    {
      "didType": "Issuer",
      "domainId": 1,
      "did": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "issuerName": "hema",
      "credentialIssued": 1,
      "desc": "test",
      "lastUpdatedAt": "02-12-2023 12:12:12"
    }
  ]
}

Delete DID

The Delete DID API is used to delete a decentralized identifier (DID) and its associated data from the underlying decentralized ledger.

curl --location --request DELETE 'https://api.did.kloudlearn.com/api/v1/did/deleteDid' \
--header 'Content-Type: application/json' \
--data '{
  "domainId": 1,
  "dids": [
    { "type": "Issuer", "did": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" },
    { "type": "User", "did": "did:brcm:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
  ]
}'
DELETE https://api.did.kloudlearn.com/api/v1/did/deleteDid HTTP/1.1
{
  "domainId": 1,
  "dids": [
    { "type": "Issuer", "did": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
  ]
}

Access Token

Authorization Key Required

HTTP Request

DELETE https://api.did.kloudlearn.com/api/v1/did/deleteDid HTTP/1.1

Query Parameters

ParameterDescription
domainIdThe company or organization the user is part of.
didsArray of DID objects to delete.
typeThe type of DID (Issuer or User).

HTTP Response

{
  "code": 200,
  "message": "2 DIDs deleted successfully",
  "status": "Success"
}

Create Schema

The Create Schema API enables issuers to create verifiable credential schemas that define the structure and rules for different types of credentials.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/schema/createSchema' \
--header 'Content-Type: application/json' \
--data '{
  "author": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "name": "EPM User",
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "EPM User Schema",
    "type": "object",
    "properties": {
      "userId": { "type": "number" },
      "name": { "type": "string" }
    },
    "additionalProperties": false
  },
  "sign": false
}'
POST /api/v1/schema/createSchema HTTP/1.1
{
  "author": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "name": "EPM User",
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "EPM User Schema",
    "type": "object",
    "properties": {
      "userId": { "type": "number" },
      "name": { "type": "string" }
    },
    "additionalProperties": false
  },
  "sign": false
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/schema/createSchema HTTP/1.1

Query Parameters

ParameterDescription
authorThe entity who created the decentralized identity credentials.
nameA user-friendly name for the schema.
schemaThe JSON schema defining the data structure of the credential.
signWhether to sign the schema.

HTTP Response

{
    "id": "d97534d3-260c-4341-b578-e033dcf3bb99",
    "Schema": {
        "type": "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json",
        "version": "1.0",
        "id": "d97534d3-260c-4341-b578-e033dcf3bb99",
        "name": "EPM User",
        "author": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "authored": "2023-02-28T15:34:42Z"
    }
}

Credential Schema List

The Credential Schema List API retrieves a list of available verifiable credential schemas.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/credential' \
--header 'Content-Type: application/json' \
--data '{
   "domainId": 1,
   "issuerDid": "did:brcm:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}'
POST /api/v1/credential/credentialSchemaList HTTP/1.1
{
   "domainId": 1,
   "issuerDid": "did:brcm:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/credential/credentialSchemaList HTTP/1.1

Query Parameters

ParameterDescription
domainIdThe company or organization the user is part of.
issuerDidThe issuer DID used to identify the decentralized identity issuer.

HTTP Response

[
    { "id": 1, "name": "SSH" }
]

Create Verifiable Credential

Verifiable Credentials (VCs) are digital credentials that contain information about a person or entity. This API creates a VC associated with a DID for secure and decentralized verification.

curl --location --request POST 'https://api.authnull.kloudlearn.com/api/v1/issueVerifiableCredential' \
--header 'Content-Type: application/json' \
--data '{
    "domainId": 1,
    "issuerDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "holderDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "schemaId": 1,
    "credentialName": "EPM User",
    "metadata":{
        "epmUsername": "john",
        "epmPassword": "xxx",
        "holderDID": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "holderId": 1
    },
    "expiry": "2024-01-01T00:00:00Z"
}'
POST /api/v1/credential/createCredential HTTP/1.1
{
    "domainId": 1,
    "issuerDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "holderDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "schemaId": 1,
    "credentialName": "EPM User",
    "metadata":{
        "epmUsername": "john",
        "epmPassword": "xxx",
        "holderDID": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "holderId": 1
    },
    "expiry": "2024-01-01T00:00:00Z"
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/credential/createCredential HTTP/1.1

Query Parameters

ParameterDescription
domainIdThe company or organization issuing the VC.
issuerDidThe issuer DID — identifies the decentralized identity issuer.
holderDidThe holder DID — identifies the holder of the credentials.
schemaIdThe schema used to create the verifiable credential.
metadataThe set of properties or claims for the credential.
expiryThe expiration date of the credential.

HTTP Response

{
    "code": 200,
    "message": "Credential Assigned successfully",
    "status": "SUCCESS"
}

Assign Credential to Wallet

The Assign Credential to Wallet API enables users to securely store and manage their verifiable credentials in a decentralized wallet.

curl --location 'https://api.did.kloudlearn.com/api/v1/walletService/assignWalletUser' \
--header 'Content-Type: application/json' \
--data '{
  "walletId":[1,3],
  "userId": [104,105],
  "credentialId": [10]
}'
POST /api/v1/walletService/assignWalletUser HTTP/1.1
{
  "walletId":[1,3],
  "userId": [104,105],
  "credentialId": [10]
}

Access Token

Authorization Key Required

HTTP Request

POST /api/v1/walletService/assignWalletUser HTTP/1.1

Query Parameters

ParameterDescription
walletIdThe unique identifier of the digital wallet.
userIdThe unique identifier associated with a user.
credentialIdThe unique identifier associated with a verifiable credential.

HTTP Response

{
    "code": 200,
    "message": "Successfully Assigned Wallet",
    "status": "Success"
}

Poll Presentation Request

The Poll Presentation Request API enables a user to acknowledge or verify a digital credential issued by another party.

curl --location --request POST 'https://api.did.kloudlearn.com/api/v1/walletService/pollPresentationRequest' \
--header 'Content-Type: application/json' \
--data '{
  "walletId": 1,
  "walletKey": "xxxxxx",
  "holderDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}'
POST api/v1/walletService/pollPresentationRequest HTTP/1.1
{
  "walletId": 1,
  "walletKey": "xxxxx",
  "holderDid": "did:key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Access Token

Authorization Key Required

HTTP Request

POST https://api.authnull.kloudlearn.com/api/v1/walletService/pollPresentationRequest HTTP/1.1

Query Parameters

ParameterDescription
walletIdThe unique identifier of a digital wallet holding the user's decentralized identities.
walletKeyA private key used to sign and authenticate DID transactions.
holderDidThe holder DID — identifies the holder of the credentials.

HTTP Response