Skip to main content

Resolve a did:web document

Sovrin can resolve hosted did:web by retrieving their hosted DID document.

Request

Make the following request to retrieve a :

GET https://api.sovrin.one/v1/dids/did:web:organization.com

Response

{
"didDocument": {
"@context": [
"https://w3.org/ns/did/v1",
"https://w3id.org/security/suites/x25519-2019/v1",
"https://w3id.org/security/suites/ed25519-2018/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "did:web:organization.com",
"verificationMethod": [
{
"id": "did:web:organization.com#CfZMD88eoh",
"controller": "did:web:organization.com",
"type": "Ed25519VerificationKey2018",
"publicKeyBase58": "CfZMD88eohsizC7XwamxwNVFuQaowN3fpNRW6rBjBEMy"
}
],
"authentication": [
"did:web:organization.com#CfZMD88eoh"
],
"assertionMethod": [
"did:web:organization.com#CfZMD88eoh"
],
"capabilityDelegation": [
"did:web:organization.com#CfZMD88eoh"
],
"capabilityInvocation": [
"did:web:organization.com#CfZMD88eoh"
],
"keyAgreement": [
{
"id": "did:web:organization.com#6FstRAzj71",
"controller": "did:web:organization.com",
"type": "X25519KeyAgreementKey2019",
"publicKeyBase58": "6FstRAzj71Yb2BYGy62uMFA6G4vcAkvRTnqQ7sherD9x"
}
]
},
"registrationStatus": "COMPLETED",
"localMetadata": {
"keys": [
{
"didDocumentKeyId": "did:web:organization.com#CfZMD88eoh",
"kmsKeyId": "CfZMD88eohsizC7XwamxwNVFuQaowN3fpNRW6rBjBEMy"
},
{
"didDocumentKeyId": "did:web:organization.com#9hvq54oWSa",
"kmsKeyId": "6FstRAzj71Yb2BYGy62uMFA6G4vcAkvRTnqQ7sherD9x"
}
],
"registered": 1600731355153,
"initialDidDocument": {
"@context": [
"https://w3.org/ns/did/v1",
"https://w3id.org/security/suites/x25519-2019/v1",
"https://w3id.org/security/suites/ed25519-2018/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "did:web:organization.com",
"verificationMethod": [
{
"id": "did:web:organization.com#CfZMD88eoh",
"controller": "did:web:organization.com",
"type": "Ed25519VerificationKey2018",
"publicKeyBase58": "CfZMD88eohsizC7XwamxwNVFuQaowN3fpNRW6rBjBEMy"
}
],
"authentication": [
"did:web:organization.com#CfZMD88eoh"
],
"assertionMethod": [
"did:web:organization.com#CfZMD88eoh"
],
"capabilityDelegation": [
"did:web:organization.com#CfZMD88eoh"
],
"capabilityInvocation": [
"did:web:organization.com#CfZMD88eoh"
],
"keyAgreement": [
{
"id": "did:web:organization.com#6FstRAzj71",
"controller": "did:web:organization.com",
"type": "X25519KeyAgreementKey2019",
"publicKeyBase58": "6FstRAzj71Yb2BYGy62uMFA6G4vcAkvRTnqQ7sherD9x"
}
]
}
}
}

The tenant can prove ownership of the keys associated with the did:web DID Document through the well-known endpoint https://tenant.vii.sovrin.one/.well-known/did-configuration. The fact that the DID Document is hosted on the domain links it to the DID.

Resolving DID:web from custom domains

If the DID document is hosted on a custom domain like organization.com, the domain should be prefixed with https:// and suffixed with /.well-known/did.json:

https://organization.com/.well-known/did.json