Hypersign.Id
Hypersign.idEntity StudioIdentity Wallet
  • 💬Welcome!
  • Hypersign KYC
    • Introduction
    • Integrations
      • KYC Service
      • Widget Configuration
      • Environments
        • Development
        • Production
      • Webhook
    • KYC Widget
      • Integrations
        • Backend Integration
          • Generate AccessTokens
          • Generate KYC Session Id
        • Frontend Integration
      • Data Capture
        • Data Vault Setup
        • Capture Facial Recognition
        • Capture ID Document
        • Capture zk-proof and KYC token
        • Capture User Consent
      • User Data
        • idToken
    • Hypersign ID Wallet
    • On-Chain KYC
      • Contracts Deployment
      • Use Cases
      • Supported Blockchains
      • KYC Token Metadata
    • Dashboard
      • User Sessions
      • User Session Details
      • Usage
      • Credit
    • Concepts
      • Facial Recognition
      • ID Verification (via OCR)
      • Reusable KYC
      • Encrypted Data Vault (EDV)
      • Facial Authentication
      • Issuer Marketplace
      • Security
      • Privacy
      • Credentials Types
        • Personhood Credential
        • Passport / Govt. ID Credential
      • zk Proof Types
        • Proof Of Personhood (PoP)
        • Proof Of KYC (PoK)
        • Proof Of Age (PoA)
      • Uniqueness Check
      • Credential Revocability
      • Machine Readable Zone (MRZ)
      • Liveliness Check
      • Zero Knowledge Proof (zkp)
        • Introduction
        • zk-SNARK
        • Circuits
        • SSI and ZKP
    • Tutorials
      • How to Integrate KYC in minutes?
      • How to add your team member?
  • Hypersign SSI
    • Introduction
    • Setup SSI Service
      • Create Your First DID
      • Credits
    • 🔗API Reference
      • Service Authentication API
      • DID
      • Schema
      • Verifiable Credential
      • Verifiable Presentation
        • Presentation Template
        • Presentation
    • 🎰API Playground
    • 🏑SSI Playground
  • Hypersign Developer Dashboard
    • Service
      • Managing API keys
      • Network Fee
    • Members & Roles
      • Members
        • Assign Role To Member
      • Invitations
        • Member Access Admin's Dashboard
      • Roles & Permissions
        • Permissions List
    • Security
      • Login
      • Multi factor Authentication (MFA)
  • Hypersign Identity Network
    • Introduction
    • Validators & Delegators
      • Installation of Node
      • Running a Testnet Validator Node
    • Governance
      • Proposals
        • Blockchain Node Upgrade
        • Community Pool Spend Proposal
        • Blockchain Parameter Change Proposal
        • Text Proposal
      • Delegation
    • Faucet (testnet)
    • Developers
      • HID-Node Codebase
      • ⚙️Setup Local hid-network Tutorial
        • Running one-node local hid network
        • Create and fund new account
        • Transfer funds
        • Connect Keplr to local hid network
      • Hypersign SSI Toolkit
        • Hypersign DID SDK
        • Hypersign Schema SDK
        • Hypersign Verifiable Credential SDK
        • Hypersign Verifiable Presentation SDK
        • OfflineSigner
    • Blockchain & ID Explorer
  • Core Concepts
    • Introduction
    • Decentralized Identifier (DID)
      • DID Registry
      • Private and Public DID
      • DID Authentication
      • DID Communication (DIDComm)
      • Adding multiple controller to DID
      • Adding multiple verification methods
      • Verification Method vs Recovery Signature
      • Blockchain Account Id
      • DID Threshold
      • Verifiable Condition
      • Verification Relationships
        • Authorization Capabilities (zCap)
    • Schema
      • Schema Registry
      • Schema.org
    • Verifiable Credential (VC)
      • Credential Revocation Registry
      • Issuing a Credential to Multiple Subjects
      • Bearer Credential
      • Single-Use Credential
    • Verifiable Presentation (VP)
    • Specifications
      • Supported Signature Algorithms
      • Client Specification
        • EVM based chains
        • Cosmos based chains
  • Ecosystem
    • Forum
    • Github
    • HID Explorer
    • Eiko
    • MetaAuth
  • Privacy Policy
Powered by GitBook
On this page
Edit on GitHub
  1. Hypersign SSI
  2. API Reference

DID

Manage DID operation using DID APIs

PreviousService Authentication APINextSchema

Last updated 8 months ago

Please 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 section for more details.

Entity Studio SSI API base URL:

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 in this section.

Create a DID

Generates the a new DID and DID Document.

Request Body Parameters

  • Namespace: DID name space. Possible value is testnet

Optional Parameters

  • 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

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

Register a DID

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

  • 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

Fetch all DIDs for your apps

Update a DID

Update a DIDDocument

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

  • signature: If didDocument is signed using client wallets (Metamask or Keply) then pass the signature hex string.

MethodSpecificId: Custom Id string which you want to attach with the DID. Please read 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 .

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

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 .

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

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 .

🔗
did:hid method spec
specification here
DID registry
network fee
here
DID registry
here
generate access token
network fee
https://api.entity.hypersign.id
private and public DID
get
Authorizations
Path parameters
didstringRequired
Header parameters
AuthorizationstringOptional

Bearer <access_token>

OriginstringOptional

Origin as you set in application cors

Responses
200
DID Resolved
application/json
get
GET /api/v1/did/resolve/{did} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

DID Resolved

{
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "id": "did:hid:method:......",
    "controller": [
      "did:hid:method:......"
    ],
    "alsoKnownAs": [
      "did:hid:method:......"
    ],
    "verificationMethod": [
      {
        "id": "did:hid:testnet:z28ScfSszr2zi2Bd7qmNE4mfHX5j8nCwx4DBF6nAUHu4p#key-1",
        "type": "EcdsaSecp256k1RecoveryMethod2020",
        "controller": "did:hid:method:..............",
        "blockchainAccountId": "eip155:1:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F"
      }
    ],
    "authentication": [
      "did:hid:method:......"
    ],
    "assertionMethod": [
      "did:hid:method:......"
    ],
    "keyAgreement": [
      "did:hid:method:......"
    ],
    "capabilityInvocation": [
      "did:hid:method:......"
    ],
    "capabilityDelegation": [
      "did:hid:method:......"
    ],
    "service": [
      {
        "id": "did:hid:testnet:z23dCariJNNpMNca86EtVZVvrLpn61isd86fWVyWa8Jkm#linked-domain",
        "type": "LinkedDomains",
        "serviceEndpoint": "https://stage.hypermine.in/studioserver/api/v1/org/did:hid:testnet:......................"
      }
    ]
  },
  "didDocumentMetadata": {
    "created": "2023-01-23T13:45:17Z",
    "updated": "2023-01-23T13:45:17Z",
    "deactivated": "false",
    "versionId": "095A65E4D2F9CA2AACE0D17A28883A0E5DDC1BBE1C9BF9D............."
  }
}
get
Authorizations
Query parameters
pagenumberOptional

Page value

Default: 1
limitnumberOptional

Fetch limited list of data

Default: 10
Header parameters
AuthorizationstringOptional

Bearer <access_token>

OriginstringOptional

Origin as you set in application cors

Responses
200
DID List
application/json
404
Error in finding resource
application/json
get
GET /api/v1/did HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
[
  {
    "totalCount": 12,
    "data": [
      "did:hid:testnet:............"
    ]
  }
]
  • Create a DID
  • POST/api/v1/did/create
  • Request Body Parameters
  • Register a DID
  • POST/api/v1/did/register
  • Resolve a DID
  • GET/api/v1/did/resolve/{did}
  • Fetch all DIDs for your apps
  • GET/api/v1/did
  • Update a DID
  • PATCH/api/v1/did
post
Authorizations
Header parameters
AuthorizationstringOptional

Bearer <access_token>

OriginstringOptional

Origin as you set in application cors

Body
namespacestringRequired

Namespace to be added in did.

Example: testnet
methodSpecificIdstringOptional

MethodSpecificId to be added in did

Example: 0x19d73aeeBcc6FEf2d0342375090401301Fe9663F
optionsall ofOptional

keyType used for verification

Example: {"keyType":"Ed25519VerificationKey2020","chainId":"0x1","publicKey":"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW","walletAddress":"0x01978e553Df0C54A63e2E063DFFe71c688d91C76","verificationRelationships":["assertionMethod","authentication"]}
Responses
201
DID Created
application/json
400
Error occured at the time of creating did
application/json
409
Duplicate key error
application/json
post
POST /api/v1/did/create HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 340

{
  "namespace": "testnet",
  "methodSpecificId": "0x19d73aeeBcc6FEf2d0342375090401301Fe9663F",
  "options": {
    "keyType": "Ed25519VerificationKey2020",
    "chainId": "0x1",
    "publicKey": "z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW",
    "walletAddress": "0x01978e553Df0C54A63e2E063DFFe71c688d91C76",
    "verificationRelationships": [
      "assertionMethod",
      "authentication"
    ]
  }
}
{
  "did": "did:hid:namespace:.......................",
  "registrationStatus": "COMPLETED/PROCESSING",
  "metaData": {
    "didDocument": {
      "@context": [
        "https://www.w3.org/ns/did/v1"
      ],
      "id": "did:hid:method:......",
      "controller": [
        "did:hid:method:......"
      ],
      "alsoKnownAs": [
        "did:hid:method:......"
      ],
      "verificationMethod": [
        {
          "id": "did:hid:testnet:z28ScfSszr2zi2Bd7qmNE4mfHX5j8nCwx4DBF6nAUHu4p#key-1",
          "type": "EcdsaSecp256k1RecoveryMethod2020",
          "controller": "did:hid:method:..............",
          "blockchainAccountId": "eip155:1:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F"
        }
      ],
      "authentication": [
        "did:hid:method:......"
      ],
      "assertionMethod": [
        "did:hid:method:......"
      ],
      "keyAgreement": [
        "did:hid:method:......"
      ],
      "capabilityInvocation": [
        "did:hid:method:......"
      ],
      "capabilityDelegation": [
        "did:hid:method:......"
      ],
      "service": [
        {
          "id": "did:hid:testnet:z23dCariJNNpMNca86EtVZVvrLpn61isd86fWVyWa8Jkm#linked-domain",
          "type": "LinkedDomains",
          "serviceEndpoint": "https://stage.hypermine.in/studioserver/api/v1/org/did:hid:testnet:......................"
        }
      ]
    }
  }
}
post
Authorizations
Header parameters
AuthorizationstringOptional

Bearer <access_token>

OriginstringOptional

Origin as you set in application cors

Body
didDocumentall ofRequired

Did doc to be registered

verificationMethodIdstringRequired

Verification Method id for did registration

Example: did:hid:testnet:........#key-${idx}
clientSpecstringOptional

IClientSpec 'eth-personalSign' or 'cosmos-ADR036'

Example: eth-personalSign
signaturestringOptional

Signature for clientSpec

Example: afafljagahgp9agjagknaglkj/kagka=
Responses
201
DID Registred
application/json
400
Error occured at the time of creating did
application/json
post
POST /api/v1/did/register HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 1028

{
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "id": "did:hid:method:......",
    "controller": [
      "did:hid:method:......"
    ],
    "alsoKnownAs": [
      "did:hid:method:......"
    ],
    "verificationMethod": [
      {
        "id": "did:hid:testnet:z28ScfSszr2zi2Bd7qmNE4mfHX5j8nCwx4DBF6nAUHu4p#key-1",
        "type": "EcdsaSecp256k1RecoveryMethod2020",
        "controller": "did:hid:method:..............",
        "blockchainAccountId": "eip155:1:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F"
      }
    ],
    "authentication": [
      "did:hid:method:......"
    ],
    "assertionMethod": [
      "did:hid:method:......"
    ],
    "keyAgreement": [
      "did:hid:method:......"
    ],
    "capabilityInvocation": [
      "did:hid:method:......"
    ],
    "capabilityDelegation": [
      "did:hid:method:......"
    ],
    "service": [
      {
        "id": "did:hid:testnet:z23dCariJNNpMNca86EtVZVvrLpn61isd86fWVyWa8Jkm#linked-domain",
        "type": "LinkedDomains",
        "serviceEndpoint": "https://stage.hypermine.in/studioserver/api/v1/org/did:hid:testnet:......................"
      }
    ]
  },
  "verificationMethodId": "did:hid:testnet:........#key-${idx}",
  "clientSpec": "eth-personalSign",
  "signature": "afafljagahgp9agjagknaglkj/kagka="
}
{
  "did": "did:hid:namespace:.......................",
  "registrationStatus": "COMPLETED/PROCESSING",
  "metaData": {
    "didDocument": {
      "@context": [
        "https://www.w3.org/ns/did/v1"
      ],
      "id": "did:hid:method:......",
      "controller": [
        "did:hid:method:......"
      ],
      "alsoKnownAs": [
        "did:hid:method:......"
      ],
      "verificationMethod": [
        {
          "id": "did:hid:testnet:z28ScfSszr2zi2Bd7qmNE4mfHX5j8nCwx4DBF6nAUHu4p#key-1",
          "type": "EcdsaSecp256k1RecoveryMethod2020",
          "controller": "did:hid:method:..............",
          "blockchainAccountId": "eip155:1:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F"
        }
      ],
      "authentication": [
        "did:hid:method:......"
      ],
      "assertionMethod": [
        "did:hid:method:......"
      ],
      "keyAgreement": [
        "did:hid:method:......"
      ],
      "capabilityInvocation": [
        "did:hid:method:......"
      ],
      "capabilityDelegation": [
        "did:hid:method:......"
      ],
      "service": [
        {
          "id": "did:hid:testnet:z23dCariJNNpMNca86EtVZVvrLpn61isd86fWVyWa8Jkm#linked-domain",
          "type": "LinkedDomains",
          "serviceEndpoint": "https://stage.hypermine.in/studioserver/api/v1/org/did:hid:testnet:......................"
        }
      ]
    }
  },
  "transactionHash": "XYAIFLKFLKHSLFHKLAOHFOAIHG.........."
}
patch
Authorizations
Header parameters
AuthorizationstringOptional

Bearer <access_token>

OriginstringOptional

Origin as you set in application cors

Body
didDocumentall ofRequired

Did doc to be updated

deactivatebooleanRequired

Field to check if to deactivate did or to update it

Example: false
verificationMethodIdstringRequired

Verification Method id for did updation

Example: did:hid:testnet:........#key-${idx}
clientSpecstringOptional

IClientSpec 'eth-personalSign' or 'cosmos-ADR036'

Example: eth-personalSign
signaturestringOptional

Signature for clientSpec

Example: afafljagahgp9agjagknaglkj/kagka=
Responses
200
DID Updated
application/json
400
Invalid didDoc
application/json
404
Resource not found
application/json
patch
PATCH /api/v1/did HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 1047

{
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1"
    ],
    "id": "did:hid:method:......",
    "controller": [
      "did:hid:method:......"
    ],
    "alsoKnownAs": [
      "did:hid:method:......"
    ],
    "verificationMethod": [
      {
        "id": "did:hid:testnet:z28ScfSszr2zi2Bd7qmNE4mfHX5j8nCwx4DBF6nAUHu4p#key-1",
        "type": "EcdsaSecp256k1RecoveryMethod2020",
        "controller": "did:hid:method:..............",
        "blockchainAccountId": "eip155:1:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F"
      }
    ],
    "authentication": [
      "did:hid:method:......"
    ],
    "assertionMethod": [
      "did:hid:method:......"
    ],
    "keyAgreement": [
      "did:hid:method:......"
    ],
    "capabilityInvocation": [
      "did:hid:method:......"
    ],
    "capabilityDelegation": [
      "did:hid:method:......"
    ],
    "service": [
      {
        "id": "did:hid:testnet:z23dCariJNNpMNca86EtVZVvrLpn61isd86fWVyWa8Jkm#linked-domain",
        "type": "LinkedDomains",
        "serviceEndpoint": "https://stage.hypermine.in/studioserver/api/v1/org/did:hid:testnet:......................"
      }
    ]
  },
  "deactivate": false,
  "verificationMethodId": "did:hid:testnet:........#key-${idx}",
  "clientSpec": "eth-personalSign",
  "signature": "afafljagahgp9agjagknaglkj/kagka="
}
{
  "transactionHash": "XYAIFLKFLKHSLFHKLAOHFOAIHG.........."
}