Setup

Before registering and resolving Decentralized Identifiers (DIDs), it's crucial to initialize the required registrars and resolvers provided by the DID library (walt.id's DID Lib).

Local Resolver & Registrar Setup

The DID Lib simplifies this process by providing a straightforward function for the setup: minimalInit() This function initializes the DidService instance with the local DID registrars and resolvers. In addition to the local registrar and resolver, the DID lib can also use an instance of the universal registrar and resolver, which can be initialized with the standard setup. We highly recommend utilizing local resolvers when feasible due to their independence from external dependencies.

import id.walt.did.dids.DidService

suspend fun main() {
    DidService.minimalInit()
}

DID Method Support With Local Registrar & Resolver:

  • did:key
  • did:jwk
  • did:web
  • did:cheqd (testnet)

Standard Setup

If the DID method you need is not supported by our local registrar & resolver. You can leverage the universal registrar and resolver by suing the init() method for setup. This initializes all available registrars and resolvers. It includes the local resolvers and registrars as well as those from the universal registrar.

This setup is more comprehensive, but also introduces external dependencies, being susceptible to the availability of the universal resolver service.

import id.walt.did.dids.DidService

suspend fun main() {
    DidService.init()
}