<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
 <!ENTITY rfc2119 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
 <!ENTITY rfc7553 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7553.xml">
 <!ENTITY rfc8174 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
 <!ENTITY rfc6117 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6117.xml">
 <!ENTITY rfc6116 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6116.xml">
 <!ENTITY rfc6335 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6335.xml">
 <!ENTITY rfc7929 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7929.xml">
 <!ENTITY rfc3986 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
<!ENTITY rfc8552 PUBLIC ""
          "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8552.xml">

]>

<rfc
  category="std" 
  docName="draft-mayrhofer-did-dns-05"
  ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
  <?rfc toc="yes" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc iprnotified="no" ?>
  <?rfc strict="yes" ?>
  <front>
    <title abbrev="draft-mayrhofer-did-dns">The Decentralized Identifier (DID) in the DNS</title>

    <author initials="A.M." surname="Mayrhofer"
      fullname="Alexander Mayrhofer">
      <organization>nic.at GmbH</organization>
      <address>
    <postal>
     <street>Karlsplatz 1/2/9</street>
     <city>Vienna</city>
     <code>1010</code>
     <country>Austria</country>
    </postal>
    <email>alex.mayrhofer.ietf@gmail.com</email>
   </address>
   </author>
    <author initials="D.K." surname="Klesev"
      fullname="Dimitrij Klesev">
  <!--    <organization>nic.at GmbH</organization> -->
      <address>
  <!--  <postal>
     <street>Karlsplatz 1/2/9</street>
     <city>Vienna</city>
     <code>1010</code>
     <country>Austria</country>
    </postal> -->
    <email>dimitrij.klesev@gmail.com</email>
   </address>
   </author>
    <author initials="M.S." surname="Sabadello"
      fullname="Markus Sabadello">
      <organization>Danube Tech GmbH</organization>
      <address>
    <postal>
     <street>Annagasse 8/1/8</street>
     <city>Vienna</city>
     <code>1010</code>
     <country>Austria</country>
    </postal>
    <email>markus@danubetech.com</email>
   </address>
   </author>

   <date year="2021"/>
   <area>Operations and Management Area</area>
    <!-- <workgroup></workgroup> -->
    <abstract>
      <t>
      This document specifies the use of the URI Resource Record Type 
	  to publish Decentralized Identifiers (DIDs) in the DNS. 	  
      </t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction" anchor='intro'>
	  <t><xref target='W3C-DID'>Decentralized Identifiers (DIDs)</xref> use a <xref target='RFC3986'>Uniform Resource Identifier (URI) scheme</xref>
	  to identify persons, organizations, or things in decentralized infrastructure, such as 
	  blockchains and distributed ledgers.</t>
	  <t>DIDs are structured around "methods", each method defining the syntax of the 
      "method specific identifier" and the operations on the respective DIDs (See Section 3.2 of <xref target='W3C-DID'/> and <xref target='DID-METHODS'/>). For many methods, 
	  the method specific identifier is not human-friendly (such as hash values, referring
	  to transactions on a blockchain). Most DIDs are therefore inherently hard to memorize for 
	  humans.
	  </t>
	  <t>
	  By referring to DIDs from the Domain Name System (DNS), those hard to memorize identifiers can be discovered via well known, 
	  human friendly and widely established names. This document specifies how 
	  DIDs can be published in the DNS for discovery on the base of host names and email addresses.
	  </t>
      <t>Since DIDs use a URI scheme ('did'), this specification leverages the existing 
	  <xref target='RFC7553'>URI DNS Resource Record Type (RRType)</xref>. Records are scoped using 
	  the '_did' global underscore node name, as described in
	  <xref target='underscorename'/>.</t>
	  <!-- However, the original specification of the URI RRType limits the possible 
	  values for the service parameters of the Owner name, effectively 
	  disallowing the DID use case described above. 
	  </t>
	  <t>In order to allow inclusion of DIDs in the DNS, this document 
	  
	  updates RFC7553 to allow the string '_did'
	  as a service parameter in the Owner name of the URI RRType. For a detailed discussion, see
	  <xref target='serviceparam'/>. -->
	</section>
    <section anchor="terminology" title="Terminology">
	  <t>"Owner name", "Priority", "Weight" and "Target" refer to the respective fields 
	  of the URI RRType, as specified in Section 4 of RFC 7553.
	  </t>
	  <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
      NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
      "MAY", and "OPTIONAL" in this document are to be interpreted as
      described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/>
	  when, and only when, they
      appear in all capitals, as shown here.
	  </t>
	</section>
	<section title="Use of the 'URI' RRType">
	  <t>
	  DIDs use an URI scheme ('did:'), so the most suitable option to publish DIDs in the DNS is the use of the 'URI' RRType. During the development of this document, 
	  various alternatives were considered, see <xref target='alternatives'/> for a list. 
	  <list style='symbols'>
	     <t>When Decentralized Identifiers (DIDs) are published in the DNS, the 'URI' RRType MUST be used.</t>
	  </list>
	  </t>
	  <!-- 
	  As described in <xref target='intro'/>, RFC 7553 limits the set of
	  strings allowed as service parameters in the Owner name of the URI RRType. Valid strings 
	  have to be registered in either the <xref target='RFC6335'>"Service Name and Transport 
	  Protocol Port Number Registry"</xref> or the <xref target='RFC6117'>"Enumservice Registrations" 
	  registry</xref>. However, both registries are unsuitable for DIDs because:
	  
	  <list style='symbols'>
	    <t>DIDs are not tied to a specific transport protocol, hence a registration in the Service Name registry is not possible (See Section 8.1.1. of RFC6335).</t>
		<t>Enumservice registrations apply to <xref target='RFC6116'>E.164 Number Mapping (ENUM)</xref> only, while the use case for 
		DIDs in the DNS extends beyond that limited scope.
	     </t>
	  </list>
	  </t>
	  -->
	  <section title="Owner Name Scoping, Target" anchor='underscorename'>
	  	  <t>
	  <xref target='RFC8552'/> describes the advantages of scoping an existing RRType over the definition
	  (and complex deployment) of a new RRType. The "URI" RRType is specifically mentioned as one example where scoping 
	  is particularly useful (and part of the design).  
	  </t>
	  <t>
	  When DIDs are published in the DNS
	    <list style='symbols'>
		  <t>the records MUST be scoped by setting the global (highest-level) underscore name of the URI RRset to '_did' (0x5F 0x64 0x69 0x64),</t>
		  <t>and the Target field of all records in the RRset MUST contain a URI of the 'did:' URI scheme.</t>
	    </list>
	  </t>
	  <!-- <t>
	  Given the considerations above, it is believed that the most effective way to allow for DIDs in the URI RRType is extending the set of allowed service parameters used in the Owner name as follows:
	  <list style='symbols'>
	    <t>
		In addition to the choices listed in Section 4.1 of RFC7553, the service parameter of the Owner name in the URI RRType MAY be set to '_did' (without quotes). 
		</t>
		<t>
		When '_did' is used as service parameter in a URI DNS record, the Target field MUST contain a URI of the 'did:' URI scheme.
		</t>
		
      </list>
	  </t> 
	  WEITER!!
	  -->
	  </section>
	  <section title='Weight, Priority' anchor='weight'>
	  <t>
	  The semantics of the Weight and Priority fields remain. When a client encounters a DID method it does not support, it SHOULD 
	  consider the respective URI "unreachable" for the purpose of record selection, and proceed to the record with the next-lowest-numbered Priority, in accordance with Section 4.2 of RFC 7553.
	  </t>
	  </section>
	  </section>
	  <section title='Location of the Records' anchor='location'>
	  	<section title='Host Names'>
	  <t>In order to discover the set of DIDs associated with a Host Name, a client prepends the given Host Name with the '_did' global underscore name
	  to create the Owner name, and then queries the resulting Query Name for the URI RRType set.</t>
	</section>
	<section title='Email Addresses (Experimental)'>
	  <t>To discover DIDs associated with email addresses, the (experimental) model from <xref target='RFC7929'>DNS-Based Authentication of Named Entities (DANE) Bindings for OpenPGP</xref> is used. A client prepares the email address following the 
	  procedure outlined in Section 5 in RFC7929 the form the Query Name, but in step 5 MUST use the string  '_mailto._did' instead of '_openpgpkey' as the second left-most label. Subsequently, 
	  the client performs a DNS query, but MUST use the URI RRType as Query Type (rather than the OPENPGPKEY RRType described in said section).
	  </t>
	</section>
	</section>
	  <section title='Example' anchor='example'>
	  <t>
	  The following example is a URI Resource Record which refers from the host name "example.net" to a Decentralized Identifier using the 'sov' method:
	  <list>
	    <t>
	     _did.example.net. 	IN URI 100 10 "did:sov:1234abcd"
		</t>
      </list>
	  </t>
	</section>
	<section title='Considered Alternatives' anchor='alternatives'>
	  <t>During the development of this document, the following alternatives were considered: A dedicated RRType, TXT records, an Enumservice, Well-Known URIs, direct registration in the Service Name Registry. Using the URI RRType
	   was found to be the option with the least impact on existing specifications and highest interoperability potential. Support for URI RRTypes is widespread in DNS software, which means that implementation and deployment of the proposed protocol should be possible without any changes to underlying infrastructure.
	  </t>
	  <t>Furthermore, the Identifiers and Discovery Working Group of the Decentralized Identity Foundation (DIF) is considering a .well-known URL based approach to discovering DIDs from web sites.</t>
  </section>
  <section title='Implementations' anchor='implementations'>
      <t>DNS-DID is considered for implementation in the following frameworks / applications:
          <list style='bullets'>
              <t>The "Registration" function of the "Fission" framework (https://whitepaper.fission.codes/accounts/verifiable-claims)</t>
          </list>
       </t>
    </section>
	<section title='Acknowledgements'>
	  <t>Acknowledgements will be added here.</t>
	</section>
	<section title='IANA Considerations'>
	   <t>
		<list>
			<t>
		Per <xref target='RFC8552'/> IANA is requested to add the following entry to the DNS Underscore Global Scoped Entry Registry:
			</t>
		</list>
		</t>
		<texttable align="center" anchor="srventry" title="Underscore Global Registry Entry Registration for '_did'">
			<ttcol>RR Type</ttcol>
			<ttcol>_NODE NAME </ttcol>
			<ttcol>REFERENCE</ttcol>
			<!--  -->
			<c>URI</c>
			<c>_did</c>
			<c>{THISRFC}</c>
			<!--  -->
		</texttable>
		<t>
	<list style="hanging">
	<t hangText="Note to RFC Editor: ">
		Please replace the above "{THISRFC}" text with a reference to this document's RFC number.
	</t>
	</list>
	</t>
	   <!--
	   <t>In order to prevent unintended name space collisions, IANA is requested to reserve the string 'did' (0x64 0x69 0x64) in the Service Name and Transport Protocol Port Number Registry. The reason that 
	   a reservation (rather than an assignment) is requested is because according to Section 8.1.1. of RFC6335, a transport protocol is REQUIRED with such a registration. 
	   However, DIDs are not related to a specific transport protocol, and so a reservation (if possible) seems to be the only way.</t>
	   -->
	   <t>Note that IANA has already created a provisional URI scheme registration for the 'did:' scheme itself.</t>
	   
	</section>
	<section title="Security Considerations">
	   <t>Most of the considerations outlined in the base specification of the URI RRType (RFC7553) also apply to the DID use case - particularly the 
	   concerns around downgrade attacks when the record is not signed with the help of DNSSEC. Note that the DID resolving process itself (out of scope 
	   of this document) can provide additional security information.  The "Linked Domain Service Endpoint" of a DID document can be used to back-reference to the Domain which was originally used to discover that DID. Such a "closed loop" (similar to verifying DNS reverse lookups against their corresponding forward lookups) would increase the confidence in non-DNSSEC scenarios.</t>
	   <t>Including a DID in the DNS allows for correlation of that DID with DNS information (and potentially registration information of that DNS name). Therefore DIDs which are supposed to be private SHOULD NOT be added to the DNS.</t>
	</section>
	<section title="Changes">
        <t>[Note to RFC Editors: This whole section is to be removed before publication]</t>
        <section title="draft-mayrhofer-did-dns-05">
        <t>
            <list style='symbols'>
                <t>Adding "implementation" section</t>
            </list>
        </t>
        </section>
		<section title="draft-mayrhofer-did-dns-04">
		<t>
	    <list style='symbols'>
	    <t>Reworded "Alternatives"</t>
		<t>Added text about backreference using DID's Linked Domain Service Endpoint.</t>
		</list>
	  </t>
	  </section>

		<section title="draft-mayrhofer-did-dns-03">
		<t>
	    <list style='symbols'>
	    <t>Updated DID spec to v1.0 document</t>
		<t>Minor editorial changes to make text more clear.</t>
		</list>
	  </t>
	  </section>
	  <section title="draft-mayrhofer-did-dns-02">
	  <t>
	    <list style='symbols'>
	    <t>Updated attrleaf reference to RFC8552</t>
		<t>Changed author information for D. Klesev</t>
		<t>Added sentence on .well-known discovery scheme</t>
		</list>
	  </t>
	  </section>
	  <section title="draft-mayrhofer-did-dns-01">
	  <t>
	    <list style='symbols'>
	    <t>email addresses further scoped with '_mailto._did'</t>
		<t>Changed protocol registration to attrleaf drafts</t>
		<t>Made clear requirements regarding use of the URI scheme</t>
		<t>Added privacy aspect to security considerations</t>
		</list>
	  </t>
	  </section>
	  <section title="draft-mayrhofer-did-dns-00">
	  <t>
	    <list style='symbols'>
	    <t>Initial version</t>
		</list>
	  </t>
	  </section>
	</section>
  </middle>
  <back>
    <references title="Normative References">
	   		<reference anchor='W3C-DID' target='https://www.w3.org/TR/did-core/'>
				<front>
			<title>Decentralized Identifiers (DIDs) v1.0</title>
			<author initials="W3C" surname="W3C" fullname="W3C Working Group">
				<organization/>
			</author>
			<date year="2020" month="February"/>
			<abstract>
				<t>
				Decentralized identifiers (DIDs) are a new type of identifier to provide verifiable, decentralized digital identity. These new identifiers are designed to enable the controller of a DID to prove control over it and to be implemented independently of any centralized registry, identity provider, or certificate authority. DIDs are URLs that relate a DID subject to a DID document allowing trustable interactions with that subject. DID documents are simple documents describing how to use that specific DID. Each DID document can express cryptographic material, verification methods, or service endpoints, which provide a set of mechanisms enabling a DID controller to prove control of the DID. Service endpoints enable trusted interactions with the DID subject.
				This document specifies a common data model, a URL format, and a set of operations for DIDs, DID documents, and DID methods.
				</t>
			</abstract>
		</front>
	  </reference>
                &rfc7553;
				&rfc2119;
				&rfc8174;
				&rfc8552;
	</references>
    <references title="Informative References">
				&rfc6335;
				&rfc3986;
				&rfc6117;
				&rfc6116;
				&rfc7929;
	   		<reference anchor='DID-METHODS' target='https://w3c-ccg.github.io/did-method-registry/'>
				<front>
			<title>DID Method Registry</title>
			<author initials="W3C" surname="W3C" fullname="W3C Community Group">
				<organization/>
			</author>
			<date year="2018" month="June"/>
			<abstract>
				<t>
				A registry for Decentralized Identifier Methods
				</t>
			</abstract>
		</front>
	  </reference>
	</references>
  </back>
</rfc>
