GuidesIdentifiersDIDsSelf-host a did:web

How to self-host a did:web

To make use of your did:web, you must make its DID document publicly available. By default, MATTR will host any created did:web’s documents on your tenant. However, some use cases (for example custom domains) may requite self-hosting.

Perform the following steps to host a DID document on your own domain:

  1. Copy the contents of the initialDidDocument object from the DID document.

    Remember not to copy the entire DID document, only the initialDidDocument object.

  2. Paste the content in a text file and save it as did.json.
  3. Upload the new did.json file to your domain under a /.well-known folder.

    You will need to update this file if you were to change the DID on MATTR VII

Hosting on a specific path

Request

Make a request of the following structure to create a did:web that is hosted on a specific path:

HTTP
POST /v1/dids
JSON
{
    "method": "web",
    "options": {
        "url": "organization.com/my-dids"
    }
}

Response

JSON
{
    "did": "did:web:organization.com:my-dids",
    "registrationStatus": "PROCESSING",
    "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"
                }
            ]
        }
    }
}
  • did : Note the path is appended to the created did:web.