.. and press ENTER to ask a question on web5, how to write code and more.

Skip to main content

Resolve a DID

Resolving a DID refers to the process of retrieving the DID document associated with a Decentralized Identifier. The DID Document contains important information such as public keys, authentication methods, service endpoints, and more.

Retrieving the DID Document​

When resolving a DID, make sure you are passing the DID URI to the resolver function.

JavaScript
Kotlin
Swift

Here's an example DID Document:

{
"id": "did:dht:cm1yqfjzfdtauh33nauwf3sqsijqziwrydicr8dbtho3cucb9nno",
"verificationMethod": [
{
"id": "did:dht:cm1yqfjzfdtauh33nauwf3sqsijqziwrydicr8dbtho3cucb9nno#0",
"type": "JsonWebKey2020",
"controller": "did:dht:cm1yqfjzfdtauh33nauwf3sqsijqziwrydicr8dbtho3cucb9nno",
"publicKeyJwk": {
"alg": "EdDSA",
"crv": "Ed25519",
"kty": "OKP",
"ext": "true",
"key_ops": ["verify"],
"x": "YuQHFTco44nzORYnQubOtVLr1oQA6sIcYY8hlk2B-IU",
"kid": "0"
}
}
],
"authentication": ["#0"],
"assertionMethod": ["#0"],
"capabilityInvocation": ["#0"],
"capabilityDelegation": ["#0"]
"service": [
{
"id": "pfi",
"type": "PFI",
"serviceEndpoint": "https://example.com/"
}
]
}

Connect with us on Discord

Submit feedback: Open a GitHub issue

Edit this page: GitHub Repo

Contribute: Contributing Guide