How to create a did:web
DIDs using the web
method host the DID document on a publicly accessible domain in order to make
the document and contents available.
Request
Make a request of the following structure to
create a did:web
:
POST /v1/dids
{
"method": "web",
"options": {
"url": "https://organization.com"
}
}
method
: Set toweb
.url
: The URL that will host the DID document. When using MATTR VII, this would likely be your tenant’s URL.Hosting: When you create a
did:web
with your tenant’s URL as the definedurl
in the request, MATTR VII automatically hosts the DID document and makes it available in the following path:https://{your_tenant_url}/.well-known/did.json
. This is one of the assets you have to create redirects to when you configure a custom domain.Key types: Unlike the request to create a did:key, this request doesn’t include a
keyType
attribute. MATTR VII creates alldid:web
with multiple key types by default. This enables issuers to issue different types of credentials from a single DID, making use of the different key types features.Custom domains: If you have a custom domain configured, use its URL (rather than your tenant’s URL) when creating a
did:web
.
Response
{
"did": "did:web:organization.com",
"registrationStatus": "PROCESSING",
"localMetadata": {
"keys": [
{
"didDocumentKeyId": "did:web:organization.com#z12KpjmH",
"kmsKeyId": "aa87d1be-d4f9-4ff0-87b8-8af7b45871c8"
},
{
"didDocumentKeyId": "did:web:organization.com#7qLxNRsFS9",
"kmsKeyId": "5f2bf621-8b96-47d8-893b-db48b8bc2947"
},
{
"didDocumentKeyId": "did:web:organization.com#22NxLGzcwD",
"kmsKeyId": "70f5cba8-ec85-4770-a40d-27012e4f652f"
},
{
"didDocumentKeyId": "did:web:organization.com#2TurnSmooY",
"kmsKeyId": "68787eec-7bde-4cda-9dc1-b73007c3d48d"
}
],
"registered": 1684275207499,
"initialDidDocument": {
"@context": [
"https://w3.org/ns/did/v1",
"https://w3id.org/security/suites/x25519-2019/v1",
"https://w3id.org/security/suites/jws-2020/v1",
"https://w3id.org/security/suites/ed25519-2018/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "did:web:organization.com",
"authentication": ["did:web:organization.com#7qLxNRsFS9"],
"assertionMethod": [
"did:web:organization.com#z12KpjmH",
"did:web:organization.com#7qLxNRsFS9",
"did:web:organization.com#22NxLGzcwD"
],
"capabilityDelegation": [
"did:web:organization.com#z12KpjmH",
"did:web:organization.com#7qLxNRsFS9",
"did:web:organization.com#22NxLGzcwD"
],
"capabilityInvocation": [
"did:web:organization.com#z12KpjmH",
"did:web:organization.com#7qLxNRsFS9",
"did:web:organization.com#22NxLGzcwD"
],
"verificationMethod": [
{
"id": "did:web:organization.com#z12KpjmH",
"controller": "did:web:organization.com",
"type": "JsonWebKey2020",
"publicKeyJwk": {
"kty": "EC",
"crv": "P-256",
"x": "nAW2_ezqvNlSDYUyrpN3pAlRnWVH5D6-6G4iZS0ZoxI",
"y": "bSeCEF-erfdu7ZuTv6u6Ps_YJCCvvJ_nkaaFNynn1dQ"
}
},
{
"id": "did:web:organization.com#7qLxNRsFS9",
"controller": "did:web:organization.com",
"type": "Ed25519VerificationKey2018",
"publicKeyBase58": "7qLxNRsFS9T9bfa29a8YDrhsabKQsA5nmbT8RkbcdMm4"
},
{
"id": "did:web:organization.com#22NxLGzcwD",
"controller": "did:web:organization.com",
"type": "Bls12381G2Key2020",
"publicKeyBase58": "22NxLGzcwDb9oEtXCjT4gYEjemNX4vTL779hFHUSKEgMGNCLzbtdek4UN9jXbfHsgQ4TDS7FVnNFYTzzMaoSPhXGVDUTb6wiUx6ny9qwa6Rye398tEMLgg3Ki5CPX65MBnGP"
}
],
"keyAgreement": [
{
"id": "did:web:organization.com#2TurnSmooY",
"controller": "did:web:organization.com",
"type": "X25519KeyAgreementKey2019",
"publicKeyBase58": "2TurnSmooYqT18Y5fi8Gh8HFNsAiSpTdoMNgSE6gvwUg"
}
]
}
}
}
did
: This is the resultingdid:web
.registrationStatus
: Will only change toCOMPLETED
once the DID document is hosted and available.