forked from w3c/did-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
3639 lines (3196 loc) · 129 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>
Decentralized Identifiers (DIDs) v1.0
</title>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'><!--
=== NOTA BENE ===
For the three scripts below, if your spec resides on dev.w3 you can check them
out in the same tree and use relative links so that they'll work offline.
-->
<script class='remove'
src='https://www.w3.org/Tools/respec/respec-w3c-common'>
</script><!--script src='./respec-w3c-common.js' class='remove'></script-->
<script class='remove' src="./common.js">
</script>
<script class="remove" type="text/javascript">
var respecConfig = {
wgPublicList: "public-did-wg",
wgPatentURI: "https://www.w3.org/2004/01/pp-impl/117488/status",
wg: "Decentralized Identifier Working Group",
wgURI: "https://www.w3.org/2019/did-wg/",
// specification status (e.g., WD, LCWD, NOTE, etc.). If in doubt use ED.
specStatus: "WD",
// the specification's short name, as in http://www.w3.org/TR/short-name/
shortName: "did-core",
edDraftURI: "https://w3c.github.io/did-core/",
// subtitle
subtitle: "Core architecture, data model, and representations",
// if you wish the publication date to be other than today, set this
//publishDate: "2019-11-07",
// if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
// and its maturity status
previousPublishDate: "2019-12-09",
previousMaturity: "WD",
pluralize: true,
// extend the bibliography entries
localBiblio: ccg.localBiblio,
github: {
repoURL: "https://github.com/w3c/did-core/",
branch: "master"
},
includePermalinks: false,
// editors, add as many as you like
// only "name" is required
editors: [{
name: "Drummond Reed",
url: "https://www.linkedin.com/in/drummondreed/",
company: "Evernym",
companyURL: "https://www.evernym.com/",
w3cid: 3096
},
{
name: "Manu Sporny",
url: "http://manu.sporny.org/",
company: "Digital Bazaar",
companyURL: "https://digitalbazaar.com/",
w3cid: 41758
},
{
name: "Markus Sabadello",
url: "https://www.linkedin.com/in/markus-sabadello-353a0821",
company: "Danube Tech",
companyURL: "https://danubetech.com/",
w3cid: 46729
}
],
// authors, add as many as you like.
// This is optional, uncomment if you have authors as well as editors.
// only "name" is required. Same format as editors.
authors: [{
name: "Drummond Reed",
url: "https://www.linkedin.com/in/drummondreed/",
company: "Evernym",
companyURL: "https://www.evernym.com/",
w3cid: 3096
},
{
name: "Manu Sporny",
url: "http://manu.sporny.org/",
company: "Digital Bazaar",
companyURL: "https://digitalbazaar.com/",
w3cid: 41758
},
{
name: "Dave Longley",
url: "",
company: "Digital Bazaar",
companyURL: "https://digitalbazaar.com/",
w3cid: 48025
},
{
name: "Christopher Allen",
url: "https://www.linkedin.com/in/christophera",
company: "Blockchain Commons",
companyURL: "https://www.BlockchainCommons.com",
w3cid: 85560
},
{
name: "Ryan Grant",
url: "",
company: "",
companyURL: ""
},
{
name: "Markus Sabadello",
url: "https://www.linkedin.com/in/markus-sabadello-353a0821",
company: "Danube Tech",
companyURL: "https://danubetech.com/",
w3cid: 46729
}
]
};
</script>
<style>
pre .highlight {
font-weight: bold;
color: green;
}
pre .comment {
color: SteelBlue;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
</head>
<body>
<section id='abstract'>
<p class="issue">
This document is undergoing a major structural refactoring and will not be easy
to read. A <a href="https://www.w3.org/TR/2019/WD-did-core-20191209/">previously
published version</a> that has a better topical flow may be a better read for
people new to this work. When this document has been updated to have a
better flow, this comment will be removed.
</p>
<p>
<a>Decentralized identifiers</a> (DIDs) are a new type of identifier to
provide verifiable, decentralized digital identity. These new identifiers are
designed to enable the controller of a <a>DID</a> to prove control over
it and to be implemented independently of any centralized registry, identity
provider, or certificate authority. <a>DIDs</a> are URLs that relate a
<a>DID subject</a> to a <a>DID document</a> allowing trustable interactions with
that subject. <a>DID documents</a> are simple documents describing how to use
that specific <a>DID</a>. Each <a>DID document</a> can express cryptographic
material, verification methods, or <a>service endpoints</a>, which provide a
set of mechanisms enabling a <a>DID controller</a> to prove control of the
<a>DID</a>. <a>Service endpoints</a> enable trusted interactions with the
<a>DID subject</a>.
</p>
<p>
This document specifies a common data model, a URL format, and a set of
operations for <a>DIDs</a>, <a>DID documents</a>, and <a>DID methods</a>.
</p>
</section>
<section id='sotd'>
<p>
This specification is under active development and implementers are advised
against implementing the specification unless they are directly involved
with the W3C DID Working Group. There are use cases [[?DID-USE-CASES]] in active
development that establish requirements for this document.
</p>
<p>
At present, there exist
<a href="https://w3c-ccg.github.io/did-method-registry/#the-registry">40
experimental implementations</a> and a preliminary
<a href="https://github.com/w3c-ccg/did-test-suite/">test suite</a>
that will eventually determine whether or not implementations are conformant.
Readers are advised that Appendix <a href="#current-issues"></a> contains a
list of concerns and proposed changes that will most likely result in
alterations to this specification.
</p>
<p>
Comments regarding this document are welcome. Please file issues
directly on <a href="https://github.com/w3c/did-core/issues/">GitHub</a>,
or send them
to <a href="mailto:[email protected]">[email protected]</a> (
<a href="mailto:[email protected]?subject=subscribe">subscribe</a>,
<a href="https://lists.w3.org/Archives/Public/public-did-wg/">archives</a>).
</p>
<p>
Portions of the work on this specification have been funded by the
United States Department of Homeland Security's Science and Technology
Directorate under contracts HSHQDC-16-R00012-H-SB2016-1-002 and
HSHQDC-17-C-00019. The content of this specification does not
necessarily reflect the position or the policy of the U.S. Government
and no official endorsement should be inferred.
</p>
<p>
Work on this specification has also been supported by the Rebooting the
Web of Trust community facilitated by Christopher Allen, Shannon
Appelcline, Kiara Robles, Brian Weller, Betty Dhamers, Kaliya Young,
Kim Hamilton Duffy, Manu Sporny, Drummond Reed, Joe Andrieu, and
Heather Vescent.
</p>
</section>
<section class="informative">
<h1>
Introduction
</h1>
<p>
Conventional <a href="https://en.wikipedia.org/wiki/Identity_management">identity management</a>
systems are based on centralized authorities such as corporate
<a href="https://en.wikipedia.org/wiki/Directory_service">directory services</a>,
<a href="https://en.wikipedia.org/wiki/Certificate_authority">certificate authorities</a>,
or <a href="https://en.wikipedia.org/wiki/Domain_name_registry">domain name registries</a>.
From the standpoint of cryptographic trust verification, each of these
centralized authorities serves as its own
<a href="https://en.wikipedia.org/wiki/Trust_anchor">root of trust</a>. To make
identity management work across these systems requires implementing
<a href="https://en.wikipedia.org/wiki/Federated_identity">federated identity management</a>.
</p>
<p>
The emergence of <a>distributed ledger technology</a> (DLT) and
<a>blockchain technology</a> provides the opportunity for fully
<a>decentralized identity management</a>. In a decentralized identity system,
entities (that is, discrete identifiable units such as, but not limited to,
people, organizations, and things) are free to use any shared root of trust.
Globally distributed ledgers, decentralized P2P networks, or other systems
with similar capabilities, provide the means for managing a root of
trust without introducing a centralized authority or a single point of
failure. In combination, <a>DLTs</a> and
<a>decentralized identity management</a> systems enable any entity to create and
manage their own identifiers on any number of distributed, independent roots of
trust.
</p>
<p>
Entities are identified by <a>decentralized identifiers</a> (<a>DIDs</a>), and
can authenticate using proofs (for example, digital signatures,
privacy-preserving biometric protocols, and so on). <a>DIDs</a> point to
<a>DID documents</a>. A <a>DID document</a> contains a set of
<a>service endpoints</a> for interacting with the entity that the <a>DID</a>
identifies (that is, the <a>DID subject</a>). Following the guidelines of
<a href="https://en.wikipedia.org/wiki/Privacy_by_design">Privacy by
Design</a>, any entity can have as many <a>DIDs</a> (and corresponding
<a>DID documents</a> and <a>service endpoints</a>) as necessary to respect the
entity’s desired separation of identities, personas, and contexts (in the
everyday sense of these words).
</p>
<p>
<a>DID methods</a> are the mechanism by which a <a>DID</a> and its associated
<a>DID document</a> are created, read, updated, and deactivated on a specific
<a>distributed ledger</a> or network. <a>DID methods</a> are defined using
separate <a>DID method</a> specifications.
</p>
<p>
This design eliminates dependence on centralized registries for
identifiers as well as centralized certificate authorities for key
management, which is the standard in hierarchical
<a href="https://en.wikipedia.org/wiki/Public_key_infrastructure">PKI (public key infrastructure</a>).
In cases where the <a>DID registry</a> is a <a>distributed ledger</a>, each
entity can serve as its own root authority. This architecture is referred to as
<a href="https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust/blob/master/final-documents/dpki.pdf">DPKI (decentralized PKI)</a>.
</p>
<p class="note">
<a>DID methods</a> can also be developed for identifiers registered in federated
or centralized identity management systems. Indeed, all types of identifier
systems can add support for <a>DIDs</a>. This creates an interoperability bridge
between the worlds of centralized, federated, and
<a>decentralized identifiers</a>.
</p>
<p>
The first purpose of this specification is to define the generic
<a>DID scheme</a> and a generic set of operations on <a>DID documents</a> that
can be implemented for any <a>DID registry</a>. The second purpose of this
specification is to define the conformance requirements for a <a>DID method</a>
specification. The <a>DID method</a> specification is a separate document that
defines a specific <a>DID scheme</a> and specific set of <a>DID document</a>
operations for a specific <a>DID registry</a>.
</p>
<p class="note">
Conceptually, the relationship between this specification and a
<a>DID method</a> specification is similar to the relationship between the IETF
generic <a>URI</a> specification ([[RFC3986]]) and a specific <a>URI</a> scheme
([[IANA-URI-SCHEMES]] (such as the http: and https: schemes specified in
[[RFC7230]]). It is also similar to the relationship between the IETF generic
URN specification ([[RFC8141]]) and a specific URN namespace definition, (such
as the <a>UUID</a> URN namespace defined in [[RFC4122]]). The difference is that
a <a>DID method</a> specification, as well as defining a specific
<a>DID scheme</a>, also specifies the methods for resolving and deactivating
<a>DIDs</a> on, and writing <a>DID documents</a> to, the appropriate
<a>DID registry</a>.
</p>
<p>
The hierarchical design of a generic <a>DID</a> specification with specific
<a>DID method</a> specifications introduces some of the same concepts as the
<a>URI</a> specification:
</p>
<ul>
<li>
<a>DIDs</a> from different <a>DID methods</a> might not be interoperable, just
as <a>URIs</a> from different URI schemes might not be interoperable.
</li>
<li>
Entities might need multiple <a>DIDs</a> to support different relationships
because the other party might only support certain <a>DID methods</a>, in the
same way that some browsers might only support certain URI schemes.
</li>
<li>
Entities might need multiple <a>DIDs</a> to support the different cryptographic
schemes of different <a>DID methods</a> because not all parties will support the
same cryptographic schemes, in the same way that not all browsers support the
same URI schemes.
</li>
<li>
Managing multiple <a>DIDs</a>, and tracking which <a>DID</a> belongs to which
relationship, under which cryptographic scheme, introduces similar logistical
challenges as managing multiple web addresses and tracking which address belongs
to which website, or tracking which email address belongs to which relationship.
</li>
</ul>
<p>
For a list of <a>DID methods</a> and their corresponding specifications,
see the DID Method Registry [[DID-METHOD-REGISTRY]].
</p>
<section class="informative">
<h2>
A Simple Example
</h2>
<p>
A <a>DID</a> is a simple text string consisting of three parts, the:
</p>
<ul>
<li>
URL scheme identifier (<code>did</code>)
</li>
<li>
Identifier for the <a>DID method</a>
</li>
<li>
DID method-specific identifier.
</li>
</ul>
<pre class="example nohighlight" title="A simple example of a decentralized identifier (DID)">
did:example:123456789abcdefghi
</pre>
<p>
The example <a>DID</a> above resolves to a <a>DID document</a>. A
<a>DID document</a> contains information associated with the <a>DID</a>, such as
ways to cryptographically authenticate the entity in control of the <a>DID</a>,
as well as services that can be used to interact with the entity.
</p>
<pre class="example nohighlight" title="Minimal self-managed DID document">
{
"@context": "https://www.w3.org/ns/did/v1",
"id": "did:example:123456789abcdefghi",
"authentication": [{
<span class="comment">// used to authenticate as did:...fghi</span>
"id": "did:example:123456789abcdefghi#keys-1",
"type": "RsaVerificationKey2018",
"controller": "did:example:123456789abcdefghi",
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n"
}],
"service": [{
<span class="comment">// used to retrieve Verifiable Credentials associated with the DID</span>
"id":"did:example:123456789abcdefghi#vcs",
"type": "VerifiableCredentialService",
"serviceEndpoint": "https://example.com/vc/"
}]
}
</pre>
</section>
<section class="informative">
<h2>
Design Goals
</h2>
<p>
<a>Decentralized Identifiers</a> are a component of larger systems, such as
the Verifiable Credentials ecosystem [[?VC-DATA-MODEL]], which drove the design
goals for this specification. This section summarizes the primary design goals
for this specification.
</p>
<table class="simple">
<thead>
<tr>
<th>
Goal
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Decentralization
</td>
<td>
Eliminate the requirement for centralized authorities or single point
failure in identifier management, including the registration of globally unique
identifiers, public verification keys, <a>service endpoints</a>, and other
metadata.
</td>
</tr>
<tr>
<td>
Control
</td>
<td>
Give entities, both human and non-human, the power to directly control their
digital identifiers without the need to rely on external authorities.
</td>
</tr>
<tr>
<td>
Privacy
</td>
<td>
Enable entities to control the privacy of their information, including minimal,
selective, and progressive disclosure of attributes or other data.
</td>
</tr>
<tr>
<td>
Security
</td>
<td>
Enable sufficient security for relying parties to depend on <a>DID documents</a>
for their required level of assurance.
</td>
</tr>
<tr>
<td>
Proof-based
</td>
<td>
Enable <a>DID subjects</a> to provide cryptographic proof when interacting with
other entities.
</td>
</tr>
<tr>
<td>
Discoverability
</td>
<td>
Make it possible for entities to discover <a>DIDs</a> for other entities to
learn more about or interact with those entities.
</td>
</tr>
<tr>
<td>
Interoperability
</td>
<td>
Use interoperable standards so <a>DID</a> infrastructure can make use of
existing tools and software libraries designed for interoperability.
</td>
</tr>
<tr>
<td>
Portability
</td>
<td>
Be system and network-independent and enable entities to use their digital
identifiers with any system that supports <a>DIDs</a> and <a>DID methods</a>.
</td>
</tr>
<tr>
<td>
Simplicity
</td>
<td>
Favor a reduced set of simple features to make the technology easier to
understand, implement, and deploy.
</td>
</tr>
<tr>
<td>
Extensibility
</td>
<td>
Where possible, enable extensibility provided it does not greatly hinder
interoperability, portability, or simplicity.
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3>
Interoperability
</h3>
<p>
Interoperability of implementations for <a>DIDs</a> and <a>DID documents</a>
will be tested by evaluating an implementation's ability to create and parse
<a>DIDs</a> and <a>DID documents</a> that conform to the specification.
Interoperability for <a>DID methods</a> will be determined by evaluating each
<a>DID method</a> specification to determine, at a minimum, that the:
</p>
<ul>
<li>
<a>DID method</a> name is unique and not used by an existing, incompatible
<a>DID method</a>.
</li>
<li>
Required operations are supported.
</li>
<li>
Operations requiring descriptions are described.
</li>
<li>
Specification is specific, detailed, and complete enough for independent
implementation.
</li>
<li>
Specification contains sections describing security and privacy considerations.
</li>
</ul>
<p>
Interoperability for producers and consumers of <a>DIDs</a> and
<a>DID documents</a> is provided by ensuring the <a>DIDs</a> and
<a>DID documents</a> conform. Interoperability for <a>DID method</a>
specifications is provided by the details in each <a>DID method</a>
specification. It is understood that, in the same way that a web browser is not
required to implement all known URI schemes, conformant software that works
with <a>DIDs</a> is not required to implement all known <a>DID methods</a>.
However, all implementations of a given <a>DID method</a> must be interoperable
for that method.
</p>
</section>
</section>
<section class="informative">
<h1>
Terminology
</h1>
<div data-include="terms.html" data-oninclude="restrictReferences">
</div>
</section>
<section>
<h1>Overall Architecture</h1>
<section>
<h2>DIDs</h2>
</section>
<section>
<h2>DID Registries</h2>
</section>
<section>
<h2>DID Documents</h2>
<p>
A <a>DID document</a> is the resource that is associated with a
<a>decentralized identifier</a> (DID). <a>DID documents</a> typically express
verification methods (such as public keys) and services that can be used to
interact with a <a>DID controller</a>.
</p>
<p>
A <a>DID document</a> is serialized according to a particular syntax, as
outlined in Section <a href="#core-representations"></a>). The <a>DID</a> itself
is contained in the <code>id</code> property.
</p>
<p>
The properties that can be present in a <a>DID document</a> are outlined in
Section <a href="#did-documents"></a>.
</p>
<p>
The properties present in a <a>DID document</a> can be updated according to
the applicable operations outlined in Section <a href="#methods"></a>.
</p>
</section>
<section>
<h2>DID Resolvers and DID Resolution</h2>
</section>
<section>
<h2>Security and Privacy</h2>
</section>
</section>
<section id="conformance">
<p>
This document contains examples that contain JSON, CBOR, and JSON-LD content.
Some of these examples contain characters that are invalid, such as inline
comments (<code>//</code>) and the use of ellipsis (<code>...</code>) to denote
information that adds little value to the example. Implementers are cautioned to
remove this content if they desire to use the information as valid JSON, CBOR,
or JSON-LD.
</p>
<p>
A <dfn>conforming DID</dfn> is any concrete expression of the rules
specified in Section <a href="#identifier"></a> and MUST comply with relevant
normative statements in that section.
</p>
<p>
A <dfn>conforming DID Document</dfn> is any concrete expression of the data
model described in this specification and MUST comply with the relevant
normative statements in Sections <a href="#data-model"></a> and <a
href="#core-properties"></a>. A serialization format for the conforming document
MUST be deterministic, bi-directional, and lossless as described in Section <a
href="#core-representations"></a>. The <a>conforming DID document</a> MAY be
transmitted or stored in any such serialization format.
</p>
<p>
A <dfn>conforming DID Method</dfn> is any specification that complies with the
relevant normative statements in Section <a href="#methods"></a>.
</p>
<p>
A <dfn>producer</dfn> is any algorithm realized as software and/or
hardware and conforms to this specification if it generates
<a>conforming DID</a>s or <a>conforming DID Document</a>s.
A <a>producer</a> that is conformant with this specification MUST NOT produce
non-conforming <a>DIDs</a> or <a>DID Documents</a>.
</p>
<p>
A <dfn>consumer</dfn> is any algorithm realized as software and/or
hardware and conforms to this specification if it consumes
<a>conforming DID</a>s or <a>conforming DID Document</a>s. A
<a>consumer</a> that is conformant with this specification MUST produce errors
when consuming non-conforming <a>DIDs</a> or <a>DID Documents</a>.
</p>
</section>
<section>
<h2>Identifier</h2>
<p>
The concept of a globally unique <a>decentralized identifier</a> is not new.
<a>Universally Unique Identifiers</a> (UUIDs) were first developed in the 1980s
and later became a standard feature of the Open Software Foundation’s
<a href="https://en.wikipedia.org/wiki/Distributed_Computing_Environment">Distributed Computing Environment</a>.
<a>UUIDs</a> achieve global uniqueness without a centralized registry service by
using an algorithm that generates 128-bit values with sufficient entropy that
the chance of collision are infinitesimally small. <a>UUIDs</a> are formally
specified in [[RFC4122]] as a specific type of Unified Resource Name (URN).
</p>
<p>
A <a>DID</a> is similar to a <a>UUID</a> except that:
</p>
<ul>
<li>
Like a URL, it can be resolved or dereferenced to a standard resource describing
the subject. That is, a <a>DID document</a>. For more information, see Section
<a href="#did-documents"></a>.
</li>
<li>
Unlike most resources returned when dereferencing URLs, a <a>DID document</a>
usually contains cryptographic material enabling authentication of the
<a>DID subject</a>.
</li>
</ul>
<section>
<h2>Generic DID Syntax</h2>
<p>
The generic <a>DID scheme</a> is a URI scheme conformant with [[!RFC3986]]. The
<a>DID scheme</a> specializes only the scheme and authority components of a
<a>DID URL</a>. The <code>path-abempty</code>, <code>query</code>, and
<code>fragment</code> components are identical to the ABNF rules defined in
[[!RFC3986]].
</p>
<p class="note">
The term <a>DID</a> refers only to the <a>URI</a> conforming to the
<code>did</code> rule in the ABNF below. A <a>DID</a> always identifies the
<a>DID subject</a>. The term <a>DID URL</a>, defined by the <code>did-url</code>
rule, refers to a URL that begins with a <a>DID</a> followed by one or more
additional components. A <a>DID URL</a> always identifies the resource to
be located.
</p>
<p>
The following is the ABNF definition using the syntax in [[!RFC5234]], which
defines <code>ALPHA</code> and <code>DIGIT</code>. All other rule names not
defined in this ABNF are defined in [[RFC3986]].
</p>
<pre class="nohighlight">
did = "did:" method-name ":" method-specific-id
method-name = 1*method-char
method-char = %x61-7A / DIGIT
method-specific-id = *idchar *( ":" *idchar )
idchar = ALPHA / DIGIT / "." / "-" / "_"
did-url = did *( ";" param ) path-abempty [ "?" query ]
[ "#" fragment ]
param = param-name [ "=" param-value ]
param-name = 1*param-char
param-value = *param-char
param-char = ALPHA / DIGIT / "." / "-" / "_" / ":" /
pct-encoded
</pre>
<p class="issue" data-number="34">
The grammar currently allows an empty <code>method-specific-id</code>,
e.g., <code>did:example:</code> would be a valid <a>DID</a> that could identify
the <a>DID method</a> itself.
</p>
</section>
<section>
<h2>Method-Specific Syntax</h2>
<p>
A <a>DID method</a> specification MUST further restrict the generic <a>DID</a>
syntax by defining its own <code>method-name</code> and its own
<code>method-specific-id</code> syntax. For more information, see Section
<a href="#methods"></a>.
</p>
</section>
<section>
<h2>Generic DID Parameters</h2>
<p>
The <a>DID URL</a> syntax supports a simple, generalized format for parameters
based on the matrix parameter syntax ([[MATRIX-URIS]]). The ABNF above
specifies the basic syntax (the <code>param-name</code> rule) but does not
specify any concrete parameter names.
</p>
<p>
Some generic DID parameter names (for example, for service selection) are
completely independent of any specific <a>DID method</a> and MUST always
function the same way for all <a>DIDs</a>. Other DID parameter names (for
example, for versioning) MAY be supported by certain <a>DID methods</a>, but
MUST operate uniformly across those <a>DID methods</a> that do support them.
</p>
<p>
Parameter names that are completely method-specific are described in Section
<a href="#method-specific-parameters"></a>.
</p>
<p>
The following table defines a set of generic DID parameter names.
</p>
<table class="simple">
<thead>
<tr>
<th>
Generic DID Parameter Name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>hl</code>
</td>
<td>
A resource hash of the <a>DID document</a> to add integrity protection, as
specified in [[HASHLINK]].
</td>
</tr>
<tr>
<td>
<code>service</code>
</td>
<td>
Identifies a service from the <a>DID document</a> by service ID.
</td>
</tr>
<tr>
<td>
<code>version-id</code>
</td>
<td>
Identifies a specific version of a <a>DID document</a> to be resolved (the
version ID could be sequential, or a <a>UUID</a>, or method-specific). Note that
this parameter might not be supported by all <a>DID methods</a>.
</td>
</tr>
<tr>
<td>
<code>version-time</code>
</td>
<td>
Identifies a certain version timestamp of a <a>DID document</a> to be resolved.
That is, the <a>DID document</a> that was valid for a <a>DID</a> at a certain
time. Note that this parameter might not be supported by all <a>DID methods</a>.
</td>
</tr>
</tbody>
</table>
<p>
The exact processing rules for these parameters are specified in
[[DID-RESOLUTION]].
</p>
<p>
Adding a DID parameter to a DID URL means that the parameter becomes part of
an identifier for a resource (the DID document or other). Alternatively, the
DID resolution and the DID URL dereferencing processes can also be influenced
by passing options to a <a>DID resolver</a> that are not part of the DID URL.
Such options could for example control caching or the desired encoding of a
resolution result. This is comparable to HTTP, where certain parameters could
either be included in an HTTP URL, or alternatively passed as HTTP headers
during the dereferencing process. The important distinction is that DID
parameters that are part of the <a>DID URL</a> should be used to specify
<i>what resource is being identified</i>, whereas <a>DID resolver</a> options
that are not part of the <a>DID URL</a> should be use to control <i>how that
resource is dereferenced</i>.
</p>
<p>
DID parameters MAY be used if there is a clear use case where
the parameter needs to be part of a URI that can be used as a link, or
as a resource in RDF / JSON-LD documents.
</p>
<p>
DID parameters SHOULD NOT be used if there are already other, equivalent
ways of constructing URIs that fulfill the same purpose (for example, using
other syntactical constructs such as URI query strings or URI fragments).
</p>
<p>
DID parameters SHOULD NOT be used if the same functionality can be expressed
by passing options to a <a>DID resolver</a>, and if there is no need to
construct a URI for use as a link, or as a resource in RDF / JSON-LD documents.
</p>
</section>
<section>
<h2>Method-Specific Parameters</h2>
<p>
A <a>DID method</a> specification MAY specify additional method-specific
parameter names. A method-specific parameter name MUST be prefixed by the method
name, as defined by the <code>method-name</code> rule.
</p>
<p>
For example, if the method <code>did:foo:</code> defines the parameter bar, the
parameter name must be <code>foo:bar</code>. An example <a>DID URL</a> using
this method and this method-specific parameter would be as shown below.
</p>
<pre class="example nohighlight">
did:foo:21tDAKCERh95uGgKbJNHYp;foo:bar=high
</pre>
<p class="issue" data-number="35">
Consider using kebab-case style instead of colon separator,
e.g., <code>foo-bar</code> instead of <code>foo:bar</code>.
</p>
<p>
A method-specific parameter name defined by one <a>DID method</a> MAY be used by
other <a>DID methods</a>.
</p>
<pre class="example nohighlight">
did:example:21tDAKCERh95uGgKbJNHYp;foo:bar=low
</pre>
<p>
Method-specific parameter names MAY be combined with generic parameter names in
any order.
</p>
<pre class="example nohighlight">
did:example:21tDAKCERh95uGgKbJNHYp;service=agent;foo:bar=high
</pre>
<p>
Both <a>DID method</a> namespaces and method-specific parameter namespaces MAY
include colons, so they might be partitioned hierarchically, as defined by a
<a>DID method</a> specification. The following example <a>DID URL</a>
illustrates both.
</p>
<pre class="example nohighlight">
did:foo:baz:21tDAKCERh95uGgKbJNHYp;foo:baz:hex=b612
</pre>
<p class="issue" data-number="36">
Review what exactly we want to say about method-specific parameters
defined by one method but used in a <a>DID URL</a> with a different method.
Also discuss hierarchical method namespaces in DID parameter names.
</p>
</section>
<section>
<h2>Path</h2>
<p>
A generic <a>DID path</a> is identical to a URI path and MUST conform to the
<code>path-abempty</code> ABNF rule in [[!RFC3986]]. A <a>DID path</a> SHOULD be
used to address resources available through a <a>service endpoint</a>. For more
information, see Section <a href="#service-endpoints"></a>.
</p>
<p>
A specific <a>DID scheme</a> MAY specify ABNF rules for <a>DID paths</a> that
are more restrictive than the generic rules in this section.
</p>
<pre class="example nohighlight">
did:example:123456/path
</pre>
</section>
<section>
<h2>Query</h2>
<p>
A generic <a>DID query</a> is identical to a URI query and MUST conform to the
<code>query</code> ABNF rule in [[!RFC3986]]. A <a>DID query</a> SHOULD be used
to address resources available through a <a>service endpoint</a>. For more
information, see Section <a href="#service-endpoints"></a>.
</p>
<p>
A specific <a>DID scheme</a> MAY specify ABNF rules for <a>DID queries</a> that
are more restrictive than the generic rules in this section.
</p>
<pre class="example nohighlight">
did:example:123456?query=true
</pre>
</section>
<section>
<h2>Fragment</h2>