Skip to content

Latest commit

 

History

History
108 lines (71 loc) · 5.87 KB

did.md

File metadata and controls

108 lines (71 loc) · 5.87 KB
description
Manage DID operation using DID APIs

DID

Please generate access token before proceeding. Once you generated the access_token, you can pass this token as bearer authorization token in the header for all APIs.

{% hint style="info" %} Note: Some of these APIs are on-chain APIs which means they need network fee to successfully execute, so make sure that your application wallet address has $hid tokens. Read network fee section for more details. {% endhint %}

{% hint style="info" %} Entity Studio SSI API base URL: https://api.entity.hypersign.id {% endhint %}

There are 3 steps involved in DID creation:

  • Generate a DID Document: Generate the data structure of the DID document.
  • Sign a DID Document (optional): Sign the DID Document using verification method.
  • Register a DID Document (optional) : Registers the signed DID Document on the blockchain network.

{% hint style="info" %} Note: You can choose not to register a DID on blockchain, in that case, the DID is concidered as private DID. We support Ed25519VerificationKey2020 for private DIDs. Kindly read difference between private and public DID in this section. {% endhint %}

Create a DID

Generates the a new DID and DID Document.

{% swagger src="../../.gitbook/assets/api-json.json" path="/api/v1/did/create" method="post" %} api-json.json {% endswagger %}

Request Body Parameters

  • Namespace: DID name space. Possible value is testnet

Optional Parameters

  • MethodSpecificId: Custom Id string which you want to attach with the DID. Please read did:hid method spec for details about possible format.
  • Options.keyTypes: We support Ed25519VerificationKey2020, EcdsaSecp256k1RecoveryMethod2020 verification method key types. So only these two are possible values. Read the full specification here.
  • Options.publicKey: Please pass the options.publickey property only for Ed25519VerificationKey2020 verification method key type. For EcdsaSecp256k1RecoveryMethod2020 , this property can be kept blank. Its value would be publickey (in multi base format)
  • Options.walletAddress: Please pass options.walletAddress for keyType EcdsaSecp256k1RecoveryMethod2020
  • Options.chainId: ChainId in HEX format. For example for Etheruem main net, the chain id would be 0x1. This property is only required for keytype EcdsaSecp256k1RecoveryMethod2020

{% hint style="info" %} Note: If no optional parameters are provided then, did will be created of verification key method type Ed25519VerificationKey2020 {% endhint %}

{% hint style="info" %} Note: If you want to create DID for blockchain wallet addresses like EVM wallets, Cosmos wallets, you should use keyType as . Read EcdsaSecp256k1RecoveryMethod2020 {% endhint %}

Register a DID

Registers a Signed DID Document in DID registry. The Gas fee (network fee) for this DID registration will be done by applications' walletAddress.

{% swagger src="../../.gitbook/assets/api-json.json" path="/api/v1/did/register" method="post" %} api-json.json {% endswagger %}

Request Parameters

  • didDocument : DID documented generated using /api1/v1/did/create API
  • verificationMethodId : Verification Method id of referred verification method in the didDocument

Optional Parameters

  • clientSpec : Wallet specifications which are used to sign the didDocument string. Use eth-personalSign for Metamask and cosmos-ADR036 for Keplr wallet. Learn more about client specifications here.
  • signature: If didDocument is signed using client wallets (Metamask or Keply) then pass the signature hex string.

Note: Read how to use Metamask to create Hypersign DID.

Resolve a DID

Given a DID Id (example: did:hid:testnet:0x123123123123), this API will resolve the corresponding DID Document from the DID registry (or Hypersign Blockchain).

{% swagger src="../../.gitbook/assets/api-json.json" path="/api/v1/did/resolve/{did}" method="get" %} api-json.json {% endswagger %}

Fetch all DIDs for your apps

{% swagger src="../../.gitbook/assets/api-json.json" path="/api/v1/did" method="get" %} api-json.json {% endswagger %}

Update a DID

Update a DIDDocument

{% swagger src="../../.gitbook/assets/api-json.json" path="/api/v1/did" method="patch" %} api-json.json {% endswagger %}

Request Parameters

  • didDocument : DID documented to be updated
  • verificationMethodId : Verification Method id of referred verification method in the didDocument
  • deactivate : true is you want to deactivate this DID, false otherwise.

Optional Parameters

  • clientSpec : Wallet specifications which are used to sign the didDocument string. Use eth-personalSign for Metamask and cosmos-ADR036 for Keplr wallet. Learn more about client specifications here.
  • signature: If didDocument is signed using client wallets (Metamask or Keply) then pass the signature hex string.