Create a Static Key DID

Introduction

DIDs with a method of key are the most basic type of DID, the public key forms the DID and has no further data associated with it.

Constraints

This type of DID will not support key rotation and cannot advertise a service endpoint. This means that there are limitations on using this DID in a long-term setting, if keys need to be rotated for any reason including for internal policies around key rotation, then all Credentials issued using this DID would need to be revoked. Service endpoints are a useful but currently under utilised aspect of DIDs, where a DID document advertises a public endpoint that could be used to send message intended for the owner of the DID. DID key does not support this, so message need to be routed by different means like a static inbox.

Creating the DID

A DID with a DID method of key can be created as follows.

POST https://tenant.platform.mattr.global/v1/dids

Request

The supported key types for the DIDs are ed25519 and bls12381g2. If the keyType is omitted, the default key type that will be used is ed25519.

{
"method": "key"
"options": {
"keyType": "ed25519"
}
}

If the keyType in options is set to bls12381g2 a DID will be created with a BLS key type which supports BBS+ signatures for issuing ZKP-enabled credentials.

{
"method": "key"
"options": {
"keyType": "bls12381g2"
}
}

Response

  • The resulting DID resides in the did attribute.
  • did:key DIDs will always have a registrationStatus of COMPLETED as they are instantly available to be used and resolved

Using a ed25519 key type

{
"did": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"registrationStatus": "COMPLETED",
"localMetadata": {
"keys": [
{
"didDocumentKeyId": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"kmsKeyId": "FiBZLe1WzR9LDJ9jpqYMaEYrUgSuCY8ULDzAHVV2Mzh9"
},
{
"didDocumentKeyId": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6LSgjkRLLbm634tqaMMtrwmk1svFDVEeGX4ke25A8o72ter",
"kmsKeyId": "64aFp2ntzaM9kBybNDRpRRfSQ4x7wfLusfJPfg9aKWt6"
}
],
"registered": 1601004096785,
"initialDidDocument": {
"@context": "https://w3.org/ns/did/v1",
"id": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"publicKey": [
{
"id": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"type": "Ed25519VerificationKey2018",
"controller": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"publicKeyBase58": "FiBZLe1WzR9LDJ9jpqYMaEYrUgSuCY8ULDzAHVV2Mzh9"
}
],
"authentication": [
"did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX"
],
"assertionMethod": [
"did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX"
],
"capabilityDelegation": [
"did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX"
],
"capabilityInvocation": [
"did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX"
],
"keyAgreement": [
{
"id": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX#z6LSgjkRLLbm634tqaMMtrwmk1svFDVEeGX4ke25A8o72ter",
"type": "X25519KeyAgreementKey2019",
"controller": "did:key:z6MkuASbvtFxKxdoKnzSWQWCRL6rJFikcRNq2Eu67mT3HDUX",
"publicKeyBase58": "64aFp2ntzaM9kBybNDRpRRfSQ4x7wfLusfJPfg9aKWt6"
}
]
}
}
}

Using a bls12381g2 key type

  • The public key in the DID Document is larger for BLS key types.
{
"did": "did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v",
"registrationStatus": "COMPLETED",
"localMetadata": {
"keys": [
{
"didDocumentKeyId": "did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v",
"kmsKeyId": "25voPUCTSWXcDLCZNfZeTWuNaDcM3KgQZqwkvuY1s2GNGJ3tJ3UubY8uFR4X8Ykhdb2xTnXkGffugi9rHsM4A3J5FRPCyoAh4ZrdcCWUSEj29pGahY1cUA7uR1ns52JeZBQc"
}
],
"registered": 1600918030673,
"initialDidDocument": {
"@context": "https://w3.org/ns/did/v1",
"id": "did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v",
"publicKey": [
{
"id": "did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v",
"type": "Bls12381G2Key2020",
"controller": "did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v",
"publicKeyBase58": "25voPUCTSWXcDLCZNfZeTWuNaDcM3KgQZqwkvuY1s2GNGJ3tJ3UubY8uFR4X8Ykhdb2xTnXkGffugi9rHsM4A3J5FRPCyoAh4ZrdcCWUSEj29pGahY1cUA7uR1ns52JeZBQc"
}
],
"authentication": [
"did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v"
],
"assertionMethod": [
"did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v"
],
"capabilityDelegation": [
"did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v"
],
"capabilityInvocation": [
"did:key:zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v#zUC7KmMGXt7fs9URk9EDqWLfpCjVTtfFMexViLLkPPUfm9j4heqvk9JkLarva3sP54FGjFNLpwc63ZTef2aR2cPssFbyDj75kopYqWL16j7JigA2BAvJcwnaKvKPUybxbroRg1v"
]
}
}
}