Many early DID methods were based on distributed ledgers or other decentralized infrastructure, and some of those still remain popular. However, the DID community has also seen a lot of innovation and has come up with new types of DID methods. One of them is did:web, which is based on traditional DNS and web server infrastructure. The DID method presented here is did:dns, which follows a similar idea but offers several improvements over did:web.

Introduction

Preface

The did:dns method specification conforms to the requirements specified in the Decentralized Identifiers v1.0 Specification [[DID-CORE]]. For more information about DIDs and DID method specifications, please also see the [[?DID-PRIMER]].

Example

did:dns:danubetech.com
did:dns:support.examplecompany.com
        
            _key1._did.danubetech.com. IN URI 100 10 "did:key:z6MkjvBkt8ETnxXGBFPSGgYKb43q7oNHLX8BiYSPcXVG6gY6"
        
{
  "@context": [
      "https://www.w3.org/ns/did/v1",
      "https://w3id.org/security/suites/ed25519-2018/v1"
  ],
  "id": "did:dns:danubetech.com",
  "verificationMethod": [{
      "id": "did:dns:danubetech.com#key1",
      "type": "Ed25519VerificationKey2018",
      "publicKeyBase58": "6TviHsz2TR2o4kYjb7aUjxVqJE6Rvdsq2XXTnFXFBTki"
  }],
  "authentication": [
     "did:dns:danubetech.com#key1"
  ],
  "assertionMethod": [
     "did:dns:danubetech.com#key1"
  ]
}
        

did:dns Method Specification

Target system

The target system of the did:dns method is the Domain Name System (DNS), or more specifically, the set (or chain) of DNS zone files controlled by the authoritative DNS servers of the domain name that is the method-specific identifier in the DID.

Method name

The method name that shall identify this DID method is: dns. A DID that uses this method MUST begin with the following prefix: did:dns. Per the DID specification, this string MUST be in lowercase.

Method-specific identifier

The method specific identifier is a fully qualified domain name. The formal rules describing valid domain name syntax are described in [[RFC1035]], [[RFC1123]], and [[RFC2181]].

The domain name name may consist of an arbitrary number of subdomains.

dns-did = "did:dns:" domain-name
        

DID method operations

Create

Creating a DID is done by:

  1. Registering a domain name or subdomain via traditional means (e.g. using the services of a domain name registrar, who in turn may use EPP or other protocols).
  2. Configuring the domain name's authoritative DNS zone file to include Resource Records (RRs) following the patterns described in the section.

Resolve

The following steps MUST be executed to resolve a DID to a DID document using the did:dns method.

  1. Create an empty DID document, called the resolved DID document.
  2. Set the value of the id property of the resolved DID document to the DID that is being resolved.
  3. Resolve the domain name in the DID's method-specific identifier to look up Resource Records (RRs) associated with the domain name.

    This step SHOULD use DNSSEC and other security mechanisms. See sections and .

  4. If the domain name does not exist, the DID is considered to not exist either, and a notFound error MUST be returned by the resolution process, as defined in [[DID-CORE]].
  5. Look up RRs matching the following conditions, and follow the corresponding rules to construct the resolved DID document:
    • Verification Methods: For each RR that meets the following conditions:
      1. The value of the TYPE field is URI.
      2. The value of the NAME field matches the following pattern:
                                                _<id>._did.<method-specific-id>.
                                            
      3. The value of the RDATA field is a string that is a did:key DID according to the [[DID-KEY]] specification.
      Perform the following steps:
      1. Resolve the DID in the RDATA field to a DID document, according to the [[DID-KEY]] specification. The result is called the verification method DID document.
      2. Copy the verification method from the verification method DID document to the resolved DID document. This is called the resolved verification method.
      3. Set the value of the id property in the resolved verification method as follows, using the <id> part of the value of the NAME field:
                                                "id": "<method-specific-id>#<id>"
                                            
      4. Construct appropriate verification relationships (authentication, assertionMethod) in the resolved DID document. The value of the verification relationship is a set containing the value of id property of the resolved verification method.

        TODO: Need to decide if/how to explicitly express verification relationships (authentication, assertionMethod, etc.).

    • Services: For each RR that meets the following conditions:
      1. The value of the TYPE field is URI.
      2. The value of the NAME field matches the following pattern:
                                                _<id>._<type>._did.<method-specific-id>.
                                            
      3. The value of the RDATA field is any valid URI, EXCEPT a did:key DID.
      Perform the following steps:
      1. Construct a service property in the resolved DID document. This is called the resolved service.
      2. Set the value of the id property in the resolved service as follows, using the <id> part of the value of the NAME field:
                                                "id": "<method-specific-id>#<id>"
                                            
      3. Set the value of the type property in the resolved service to the <type> part of the value of the NAME field.
      4. Set the value of the serviceEndpoint property in the resolved service to the value of the RDATA field.
    • All other RRs MUST be ignored during the DID document construction step.

Update

To update the DID document, the domain name's authoritative DNS zone file is updated with Resource Records (RRs) that follow the patterns described in the section.

See considerations in .

Deactivate

To deactivate the DID document, the domain is deleted.

See considerations in .

Discuss if there should be a way to explicitly mark a domain name as "deactivated".

Relation to other technologies

Relation to the did:web method

Similar to this specification, [[?DID-WEB]] also defines a new DID method based on domain names. The syntax of the identifiers is equivalent with the exceptions that 1. the method name in this specification is dns instead of web, and 2. the did:web method also allows an optional colon-separated path component as part of its method-specific identifier, which is not supported by this specification. In terms of functionality, the main difference between the two methods is that while the did:web method requires both DNS and web infrastructure for its operation, the did:dns method requires only DNS infrastructure.

Relation to DID-in-DNS

The [[?DID-IN-DNS]] specification also provides a way to connect existing DNS infrastructure with DIDs. It uses similar Resource Records (RRs). It however does not define a new DID method specification; rather, it defines a way of discovering a DID (using any DID method) from a domain name, using the DNS infrastructure and protocol. This is intended for use cases where a domain name is used for bootstrapping initial relationships or interactions, but the domain name is not intended to be used beyond such an initial step.

Relation to Well Known DID Configuration

Similar to [[?DID-IN-DNS]], the [[?WELL-KNOWN-DID]] specification also does not define a new DID method and is rather used for discovery of a DID (using any DID method) via an existing domain name.

As the discovery mechanism, it uses a /.well-known/ path (see [[RFC8615]]) on a web server in addition to DNS.

Relation to DKIM

This specification fulfills a similar purpose as DKIM (see [[RFC6376]]) insofar as it also associates public keys with domain names, using Resource Records (RRs). However, while DKIM is focused on a single use case (e-mail), this specification can be used with any service and protocol that supports DIDs.

DKIM uses TXT RRs, while this DID method specification uses URI RRs.

It would be possible to define a DID method that uses DKIM keys directly in a DID document. However, in this DID method specification, we have chosen to keep DID document keys independent of DKIM keys.

Relation to DNSSEC

Similar to this specification as well as DKIM, DNSSEC (see [[RFC4033]]) also associates public keys with domain names. DNSSEC does this for the purpose of securing the resolution process of domain names themselves. It is highly RECOMMENDED that DNSSEC is used when resolving domain names during the operation.

DNSSEC uses DNSKEY and other RRs (see [[RFC4034]]), while this DID method specification uses URI RRs.

It would be possible to define a DID method that uses DNSSEC keys directly in a DID document. However, in this DID method specification, we have chosen to keep DID document keys independent of DNSSEC keys.

Security considerations

DNS Security Considerations

This section was copied and adapted from the [[?DID-WEB]] specification, since similar considerations apply in both DID methods.

DNS presents many of the attack vectors that enable active security and privacy attacks on the did:dns method, and it's important that implementors address these concerns via proper configuration of DNS. For example, without proper security of the DNS resolution via DNS over HTTPS it's possible for active attackers to intercept the result of the DNS resolution via a Man in the Middle attack which would point at a malicious server with the incorrect DID document.

Additionally, implementors should be aware of issues presented by a Spoofed DNS records where the record returned by a malicious DNS Server is inauthentic and allows the record to be pointed at a malicious server which contains a different DID Document. To prevent this type of issue, usage of DNSSEC which is defined in RFC4033, RFC4034, and RFC4035.

DID Document Integrity Verification

Add discussion of using Hashlinks and the hl DID parameter to aid integrity protection and verification of the DID document.

DID Document Auditing and History

The DID operations defined in this specification do not provide an immutable history of changes that is typical for blockchain/DLT based DID methods, and which can be used for auditing purposes. This can lead to certain attacks where the DID document is manipulated temporarily, or different DID documents are presented to different resolvers, without an easy way to detect this behavior.

Add further discussion and possible mitigations.

DID Document Updates

Updates to a DID document may not be immediately visible to all resolvers, since standard DNS caching mechanisms (e.g. TTL values) apply.

DID Document Deactivation

If a domain name is deleted, similar to when it is updated, the deletion may not be immediately visible, since standard DNS caching mechanisms (e.g. TTL values) apply.

In some cases, if a domain name is deleted, grace periods may apply during which a domain name can be restored.

If a domain is deleted, it may in the future be registered by another entity. This is known as the "identifier recycling problem". It means that it cannot be assumed that a DID is a persistent identifier for the same DID subject.

Authorization of DID Operations

Unlike some other DID methods, this one does not use the DID document for authorization decisions of create/update/deactivate operations on the DID. This depends on authorization mechanisms of the underlying DNS infrastructure. In other words, the authority to update the domain name is linked to the authority to update the DID document.

Decentralization

The DID Working Group has extensively discussed the meaning of "decentralized" identifiers, and various aspects of this terms. In a traditional sense, a domain name may not be considered a decentralized identifier. For further considerations, see [[?DID-RUBRIC]].

Privacy considerations

DNS Privacy Considerations

This section was copied and adapted from the [[?DID-WEB]] specification, since similar considerations apply in both DID methods.

Due to the nature of the did:dns method relying upon a DNS in order to resolve the DID, all resolutions of a did:dns identifier have the potential to be tracked by a DNS provider. To mitigate the issue of the relying party being tracked when resolving the DID document, the relying party should look to either use a trusted Universal Resolver service to gain herd privacy, utilize a VPN service or perform a resolution over the TOR network. Another emerging solution that will be useful to address this is draft-pauly-dprive-oblivious-doh-03

Domain Name String

The domain name string itself often gives a hint about the identity of the registrant. This is in fact usually a desired property of human-readable identifiers such as domain names, especially for organizations.

For individuals however, the use of a domain name as a basis for a DID can negatively impact their privacy, since (unlike other DID methods) it might be possible to learn about the identity of the subject purely from the DID itself, even without DID resolution or other interaction.

Whois Data

The WHOIS protocol (see [[RFC3912]]) typically allows anyone to query DNS registries for human-readable records about registrants of a domain name. This can be mitigated by domain privacy services that hide the registrant's information from the WHOIS records.

Reference implementations

It is expected that the DIF Universal Resolver project will add an implementation (a "driver") that supports the did:dns method. Other implementations are encouraged as well.

Acknowledgements

The author would like to thank Alexander Mayrhofer of nic.at for his leadership in the [[?DID-IN-DNS]] work as well as advice on this specification and other DNS-related topics on multiple occasions.