DID
Manage DID operation using DID APIs
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. 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.
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.
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. Generates the a new DID and DID Document.
post
/api/v1/did/create
- Namespace: DID name space. Possible value is
testnet
- 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 forEd25519VerificationKey2020
verification method key type. ForEcdsaSecp256k1RecoveryMethod2020
, this property can be kept blank. Its value would be publickey (in multi base format) - Options.walletAddress: Please pass
options.walletAddress
for keyTypeEcdsaSecp256k1RecoveryMethod2020
- Options.chainId: ChainId in HEX format. For example for Etheruem main net, the chain id would be
0x1
. This property is only required for keytypeEcdsaSecp256k1RecoveryMethod2020
Note: If no optional parameters are provided then, did will be created of verification key method type
Ed25519VerificationKey2020
Note: If you want to create DID for blockchain wallet addresses like EVM wallets, Cosmos wallets, you should use keyType as . Read
EcdsaSecp256k1RecoveryMethod2020
Registers a Signed DID Document in DID registry. The Gas fee (network fee) for this DID registration will be done by applications' walletAddress.
post
/api/v1/did/register
- 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 andcosmos-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.
Given a DID Id (example:
did:hid:testnet:0x123123123123
), this API will resolve the corresponding DID Document from the DID registry (or Hypersign Blockchain). get
/api/v1/did/resolve/{did}
get
/api/v1/did
Update a DIDDocument
patch
/api/v1/did
- 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 andcosmos-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.
Last modified 2mo ago