DID Web Registry
The wallet-api has a build-in DID Web Registry to make did:web's created via API publicly resolvable without the need to host any external services.
Create a did:web
CURL
curl -X 'POST' \
'https://wallet.walt.id/wallet-api/wallet/{wallet}/dids/create/web?domain={domain}&path={path}' \
-H 'accept: */*' \
-d ''
Path Params
wallet
: string - The ID of the wallet to add the DID to. You can find a list of all wallets associated with an account using the following endpoint/wallet-api/wallet/accounts/wallets
.
Query Params
domain
: string - The domain that will host the DID. When you want to use the in-build did:web registry, set this to the domain where the wallet API is hosted.path
: string - The path at which the DID document should be hosted. If you are using the in-build did:web registry it must look like/wallet-api/registry/$uniqueIdentifier
where theuniqueIdentifier
can be any type of number or UUID.keyId
: string - Associate did:web with a key in the wallet or create a new key if none is provided.alias
: string - Alias for DID, shown on overview page and when selecting a DID for issuing a credential.
Example Response
did:web:wallet.walt.id:wallet-api:registry:1
Viewing the DID Document
According to the official specification, if the required domain and path
parameters are used for the in-build registry, the created DID will have its DID Document available under:
wallet-api-host-domain/wallet/registry/{uniqueIdentifier}/did.json
Resolving the DID
You can also use the Universal Resolver to resolve the DID and view the DID document.