Skip to content
DID resolver for HTTPS domains
Branch: develop
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src use DIDDocument type from did-resolver Jan 4, 2019
.prettierrc initial implementation Sep 20, 2018
package-lock.json update package lock for latest did resolver Jan 14, 2019
tsconfig.json Removed babel and restructure lib for typescript only Oct 10, 2018

title index category type source
HTTPS DID Resolver

HTTPS DID Resolver

This library is intended to use domains accessed through https as Decentralized Identifiers and retrieve an associated DID Document

It supports the proposed Decentralized Identifiers spec from the W3C Credentials Community Group.

It requires the did-resolver library, which is the primary interface for resolving DIDs.

DID method

To encode a DID for an HTTPS domain, simply prepend did:https: to domain name.

eg: ->

DID Document

The DID resolver takes the domain and forms a well-known URI to access the DID Document.

For a did, the resolver will attempt to access the document at

A minimal DID Document might contain the following information:

  '@context': '',
  id: '',
  publicKey: [{
       id: '',
       type: 'Secp256k1VerificationKey2018',
       owner: '',
       ethereumAddress: '0xb9c5714089478a327f09197987f16f9e5d936e8a'}],
  authentication: [{
       type: 'Secp256k1SignatureAuthentication2018',
       publicKey: ''}]

Note this uses the Secp256k1VerificationKey2018 type and an ethereumAddress instead of a publicKeyHex, meaning that this DID is owned by an entity that controls the private key associated with that address.

Resolving a DID document

The resolver presents a simple resolver() function that returns a ES6 Promise returning the DID document.

import resolve from 'did-resolver'
import registerResolver from 'https-did-resolver'


resolve('').then(doc => console.log)

// You can also use ES7 async/await syntax
const doc = await resolve('')
You can’t perform that action at this time.