-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.html
745 lines (689 loc) · 24.1 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>did:web Method Specification</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" async
class="remove"></script>
<script class="remove">
var respecConfig = {
"specStatus": "unofficial",
"shortName": "did-method-web",
"subtitle": "did:web Method Specification",
"github": "https://github.com/w3c-ccg/did-method-web/",
"edDraftURI": "https://w3c-ccg.github.io/did-method-web/",
"doJsonLd": true,
"includePermalinks": false,
latestVersion: null,
editors: [{
name: "Michael Prorock",
url: "https://www.linkedin.com/in/mprorock/",
email: "[email protected]",
company: "mesur.io",
companyURL: "https://mesur.io/"
},
{
name: "Oliver Terbu",
email: "[email protected]",
company: "Consensys",
companyURL: "https://consensys.net"
}],
authors: [
{
name: "Christian Gribneau",
email: "[email protected]",
company: "Ology Newswire, Inc.",
companyURL: "https://ology.com"
},
{
name: "Michael Prorock",
email: "[email protected]",
company: "mesur.io",
companyURL: "https://mesur.io/"
},
{
name: "Orie Steele",
url: "https://www.linkedin.com/in/or13b/",
company: "Transmute",
companyURL: "https://www.transmute.industries/",
w3cid: 109171
},
{
name: "Oliver Terbu",
email: "[email protected]",
company: "Consensys",
companyURL: "https://consensys.net"
},
{
name: "Mike Xu",
email: "[email protected]",
company: "Consensys",
companyURL: "https://consensys.net"
},
{
name: "Dmitri Zagidulin",
email: "[email protected]",
company: "Digital Bazaar",
companyURL: "https://digitalbazaar.com/"
}],
localBiblio: {
"DID-PRIMER": {
title: "DID Primer",
href: "https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust-fall2017/blob/master/topics-and-advance-readings/did-primer.md",
authors: [
"Drummond Reed",
"Manu Sporny",
],
publisher: "Rebooting the Web of Trust 2017"
},
"OWASP-TRANSPORT": {
title: "Transport Layer Protection Cheatsheet",
href: "https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet",
}
},
};
</script>
</head>
<body>
<section id="abstract">
<p>
DIDs that target a distributed ledger face significant practical
challenges in bootstrapping enough meaningful trusted data around
identities to incentivize mass adoption.
We propose a new DID method using a web domain's existing reputation.
</p>
</section>
<section id="sotd">
</section>
<section>
<h1>
Introduction
</h1>
<section>
<h2>
Preface
</h2>
<p>
The Web DID 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]]
</p>
</section>
<section id="conformance">
<!-- This section is filled automatically by ReSpec. -->
</section>
<section>
<h2>
Examples
</h2>
<pre class="example"
title="Example did:web DID document using JSON Web Keys">
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/jws-2020/v1"
],
"id": "did:web:example.com",
"verificationMethod": [
{
"id": "did:web:example.com#key-0",
"type": "JsonWebKey2020",
"controller": "did:web:example.com",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "0-e2i2_Ua1S5HbTYnVB0lj2Z2ytXu2-tYmDFf8f5NjU"
}
},
{
"id": "did:web:example.com#key-1",
"type": "JsonWebKey2020",
"controller": "did:web:example.com",
"publicKeyJwk": {
"kty": "OKP",
"crv": "X25519",
"x": "9GXjPGGvmRq9F6Ng5dQQ_s31mfhxrcNZxRGONrmH30k"
}
},
{
"id": "did:web:example.com#key-2",
"type": "JsonWebKey2020",
"controller": "did:web:example.com",
"publicKeyJwk": {
"kty": "EC",
"crv": "P-256",
"x": "38M1FDts7Oea7urmseiugGW7tWc3mLpJh6rKe7xINZ8",
"y": "nDQW6XZ7b_u2Sy9slofYLlG03sOEoug3I0aAPQ0exs4"
}
},
],
"authentication": [
"did:web:example.com#key-0",
"did:web:example.com#key-2"
],
"assertionMethod": [
"did:web:example.com#key-0",
"did:web:example.com#key-2"
],
"keyAgreement": [
"did:web:example.com#key-1",
"did:web:example.com#key-2"
]
}
</pre>
<pre class="example"
title="Example did:web DID document using an ethereum address">
{
"@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/secp256k1recovery-2020/v2"],
"id": "did:web:example.com",
"verificationMethod": [{
"id": "did:web:example.com#address-0",
"type": "EcdsaSecp256k1RecoveryMethod2020",
"controller": "did:web:example.com",
"blockchainAccountId": "eip155:1:0x89a932207c485f85226d86f7cd486a89a24fcc12"
}],
"authentication": [
"did:web:example.com#address-0"
]
}
</pre>
</section>
</section>
<section>
<h1>
Web DID Method Specification
</h1>
<section>
<h2>
Target system
</h2>
<p>
The target system of the Web DID method is the host (or domain if the
host
is not specified) name when the domain specified by the DID is resolved
through the Domain Name System (DNS).
</p>
</section>
<section>
<h2>
Method name
</h2>
<p>
The namestring that shall identify this DID method is: <code>web</code>.
A DID that uses this method MUST begin with the following prefix:
<code>did:web</code>. Per the DID specification, this string MUST be in
lowercase. The remainder of the DID, after the prefix, is specified
below.
</p>
</section>
<section>
<h2>
Method-specific identifier
</h2>
<p>
The method specific identifier is a fully qualified domain name that is
secured by a TLS/SSL certificate with an optional path to the DID
document. The formal rules describing valid domain name syntax are
described in [[RFC1035]], [[RFC1123]], and [[RFC2181]].
</p>
<p>
The method specific identifier MUST match the common name used in the
SSL/TLS certificate, and it MUST NOT include IP addresses. A port MAY be
included and the colon MUST be percent encoded to prevent a conflict
with paths. Directories and subdirectories MAY optionally be included,
delimited by colons rather than slashes.
</p>
<pre class="nohighlight">
web-did = "did:web:" domain-name
web-did = "did:web:" domain-name * (":" path)
</pre>
<pre class="example nohighlight" title="Example Web Method DIDs">
did:web:w3c-ccg.github.io
did:web:w3c-ccg.github.io:user:alice
did:web:example.com%3A3000
</pre>
</section>
<section>
<h2>
Key Material and Document Handling
</h2>
<p>
Due to the way most web servers present content, it is likely that a
particular `did:web` document will be served with a media type of
`application/json`. If a document is retrieved and it is named
`did.json`, a few processing rules should apply:
<ul>
<li>
If an
`@context` is present at the root of the JSON document,
the document should be processed according to the JSON-LD rules.
If this is not possible, or if the document fails processing, the
document should be rejected from consideration as a `did:web` doc.
</li>
<li>
If an
`@context` is present at the root of the JSON document,
and it passes JSON-LD processing, and it contains the context
`https://www.w3.org/ns/did/v1`, it may be further processed
as a
DID document as specified by section
<a href="https://www.w3.org/TR/did-core/#consumption-0">6.3.2</a> of
the
[[did-core]] specification.
</li>
<li>
If no
`@context` is present, it should be processed via normal
JSON rules for DID processing as specified in section
<a href="https://www.w3.org/TR/did-core/#consumption">6.2.2</a> of the
[[did-core]] specification.
</li>
</ul>
</p>
<p>
Whenever a DID URL is present within a `did:web` document, it must
be an absolute URL.
<p class="note">
This includes URLs inside of embedded key material and other metadata, and
prevents
key confusion attacks.
</p>
</p>
</section>
<section>
<h2>
DID method operations
</h2>
<section>
<p>
There is intentionally no HTTP API specified for did:web method
operations leaving programmatic registrations and management to be
defined by each implementation, or based on their own requirements in
their web environment.
</p>
</p>
<h3>
Create (Register)
</h3>
<p>
Creating a DID is done by:
</p>
<ol>
<li>
applying at a domain name registrar for use of a domain name and
</li>
<li>
storing the location of a hosting service, the IP address at a DNS
lookup service
</li>
<li>
creating the DID document JSON-LD file including a suitable keypair,
e.g. using the Koblitz Curve, and storing the <code>did.json</code>
file under the well-known URL to represent the entire domain, or
under the specified path if many DIDs will be resolved in this
domain.
</li>
</ol>
<p>
For example, for the domain name `w3c-ccg.github.io`, the `did.json`
will be available under the following URL:
</p>
<pre class="example nohighlight" title="Creating the DID">
did:web:w3c-ccg.github.io
-> https://w3c-ccg.github.io/.well-known/did.json
</pre>
<p>
If an optional path is specified rather the bare domain, the
<code>did.json</code> will be available under the specified path:
</p>
<pre class="example nohighlight"
title="Creating the DID with optional path">
did:web:w3c-ccg.github.io:user:alice
-> https://w3c-ccg.github.io/user/alice/did.json
</pre>
<p>
If an optional port is specified on the domain, the port colon
splitting the host and the port MUST be percent encoded to prevent
collision with the path.
</p>
<pre class="example nohighlight"
title="Creating the DID with optional path and port">
did:web:example.com%3A3000:user:alice
-> https://example.com:3000/user/alice/did.json
</pre>
</section>
<section>
<h3>
Read (Resolve)
</h3>
<p>
The following steps MUST be executed to resolve the DID document from
a Web DID:
</p>
<ol>
<li>
Replace ":" with "/" in the method specific identifier to obtain the
fully qualified domain name and optional path.
</li>
<li>
If the domain contains a port percent decode the colon.
</li>
<li>
Generate an HTTPS URL to the expected location of the DID document
by prepending <code>https://</code>.
</li>
<li>
If no path has been specified in the URL, append
<code>/.well-known</code>.
</li>
<li>
Append <code>/did.json</code> to complete the URL.
</li>
<li>
Perform an HTTP <code>GET</code> request to the URL using an agent
that can successfully negotiate a secure HTTPS connection, which
enforces the security requirements as described in <a
href="#security-and-privacy-considerations"></a>.
</li>
<li>
Verify that the ID of the resolved DID document matches the Web DID being resolved.
</li>
<li>
When performing the DNS resolution during the HTTP <code>GET</code>
request, the client SHOULD utilize [[RFC8484]] in order to prevent
tracking of the identity being resolved.
</li>
</ol>
</section>
<section>
<h3>
Update
</h3>
<p>
To update the DID document, the <code>did.json</code> has to be
updated. Please note that the DID will remain the same, but the
contents of the DID document could change, e.g., by including a new
verification key or adding service endpoints.
</p>
<p class="note">
Managing updates to the DID Document using a version control system
such as git and continious integration system such as GitHub Actions
can provide support for authentication and audit history.
</p>
<p class="note" title="HTTP API">
There is no HTTP API specified for the update process leaving
programmatic registrations and management to be defined by each
implementation.
</p>
</section>
<section>
<h3>
Deactivate (Revoke)
</h3>
<p>
To delete the DID document, the <code>did.json</code> has to be
removed or has to be no longer publicly available due to any other
means.
</p>
</section>
</section>
<section class="informative">
<h2>
Security and privacy considerations
</h2>
<section>
<h3>
Authentication and Authorization
</h3>
<p>
This DID method does not specify any authentication or authorization
mechanism for writing to, removing or creating the DID Document,
leaving it up to implementations to protect did:web documents as with
any other web resource.
</p>
<p>
It is up to implementer to secure their web environments according to
industry best practices for updating or otherwise managing web content
based on the specific needs of their threat environment.
</p>
</section>
<section>
<h3>
DNS Considerations
</h3>
<h4>
DNS Security Considerations
</h4>
<p>
DNS presents many of the attack vectors that enable active security
and privacy attacks on the did:web 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 <a
href="https://tools.ietf.org/html/rfc8484">DNS over HTTPS</a> 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.
</p>
<p>
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
<a href="https://tools.ietf.org/html/rfc4033">RFC4033</a>,
<a href="https://tools.ietf.org/html/rfc4034">RFC4034</a>, and
<a href="https://tools.ietf.org/html/rfc4035">RFC4035</a>.
</p>
<h4>
DNS Privacy Considerations
</h4>
<p>
Due to the nature of the did:web method relying upon a DNS in order to
resolve the web server, all resolutions of a did:web identifier have
the potential to be tracked by a DNS provider. Additionally, due to
the DID Document being stored on a web server, each time the DID
Document resource is retrieved, the web server has the ability to
track the resolution of the DID Document. 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 <a
href="https://tools.ietf.org/html/draft-pauly-dprive-oblivious-doh-03">
draft-pauly-dprive-oblivious-doh-03</a>
</p>
</section>
<section>
<h3>
DID Document Integrity Verification
</h3>
<p>
Additional mechanisms such as <a
href="https://tools.ietf.org/html/draft-sporny-hashlink">Hashlinks</a>
MAY be utilized to aid in integrity protection and verification of the
DID document.
<br />
Under such a scenario the hash of the DID document could be recorded
to a trusted or distributed store and the retriever of the DID
document would generate a hash of the DID document in their posession
with the hash retrieved to ensure that no tampering with the DID
document had occurred.
</p>
</section>
<section>
<h3>
In-transit Security
</h3>
<p>
Guidance from <a
href="https://csrc.nist.gov/publications/detail/sp/800-52/rev-2/final">
NIST SP 800-52 Rev. 2
</a> or superceding, MUST be followed for delivery of a `did:web`
document.
</p>
<p>
It is additionally recommended to adhere to the latest recommendations
from OWASP's Transport Layer Protection Cheat Sheet [[OWASP-TRANSPORT]]
for hardening TLS configurations.
</p>
<p>
Consult <a href="https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-5/final">
NIST SP 800-57
</a> for guidance on cryptoperiod, which is the time span during which
a specific key is authorized for use or in which the keys for a given
system or application may remain in effect.
</p>
<p>
TLS configuration MUST use at least SHA256, and SHOULD use SHA384,
POLY1305, or stronger, depending on the needs of your
operating environment.
</p>
<p>
Delete action MAY be performed by domain name registrars or DNS lookup
services.
</p>
<p>
As of this writing, TLS 1.2 or higher SHOULD be configured to use
only strong ciphers suites and to use sufficiently large key sizes.
As recommendations may be volatile these days, only the very latest
recommendations should be used. However, as a rule of thumb,
the following set of suites is a reasonable starting point:
</p>
<ul>
<li>
ECDHE with one of the strong curves {X25519, brainpoolP384r1, NIST
P-384, brainpoolP256r1, NIST P-256} shall be used as key exchange.
</li>
<li>
AESGCM or ChaCha20 with 256 bit large keys shall be used for bulk
encryption
</li>
<li>
ECDSA with one of the strong curves {brainpoolP384r1, NIST P-384,
brainpoolP256r1, NIST P-256} or RSA (at least 3072) shall be used.
</li>
<li>
Authenticated Encryption with Associated Data (AEAD) shall be used
as Mac.
</li>
</ul>
<p>
Examples of strong SSL/TLS configurations for now are:
</p>
<ul>
<li>
<code>ECDHE-ECDSA-AES256-GCM-SHA384, TLSv1.2, Kx=ECDH, Au=ECDSA, Enc=AESGCM(256), Mac=AEAD</code>
</li>
<li>
<code>ECDHE-RSA-AES256-GCM-SHA384, TLSv1.2, Kx=ECDH, Au=RSA Enc=AESGCM(256), Mac=AEAD</code>
</li>
<li>
<code>ECDHE-ECDSA-CHACHA20-POLY1305, TLSv1.2, Kx=ECDH, Au=ECDSA, Enc=ChaCha20-Poly1305, Mac=AEAD</code>
</li>
<li>
<code>ECDHE-RSA-CHACHA20-POLY1305, TLSv1.2, Kx=ECDH, Au=RSA, Enc=ChaCha20-Poly1305, Mac=AEAD</code>
</li>
<li>
<code>ECDHE-RSA-AES256-GCM-SHA384, TLSv1.2, Kx=ECDH, Au=RSA, Enc=AESGCM(256), Mac=AEAD</code>
</li>
<li>
<code>ECDHE-ECDSA-AES256-GCM-SHA384, TLSv1.2, Kx=ECDH, Au=ECDSA, Enc=AESGCM(256), Mac=AEAD</code>
</li>
</ul>
</section>
<section>
<h3>
International Domain Names
</h3>
<p>
[[DID-CORE]] identifier syntax does not
allow Unicode in method name nor method specific identifiers.
</p>
<p>
Implementers should be cautious when implementing
support for DID URLs that rely on domain names
or path components that contain Unicode characters.
</p>
<p>
See also:
</p>
<ul>
<li>
<a href="https://unicode.org/reports/tr46/">UTS-46</a>
</li>
<li>
<a href="https://www.rfc-editor.org/rfc/rfc5895">IDNA 2008</a>
</li>
</ul>
</section>
<section>
<h3>
Optional Path Considerations
</h3>
<p>
When optional paths to DID documents are used to resolve documents
rather than bare domains, verification with signed data proves that
the entity in control of the file indicated in the path has the
private keys. It does not prove that the domain operator has the
private keys.
</p>
<p>
This example:
</p>
<pre class="nohighlight">
did:web:example.com:u:bob
</pre>
<p>
resolves to the DID document at:
</p>
<pre class="nohighlight">
https://example.com/u/bob/did.json
</pre>
<p>
In this scenario, it is probable that example.com has given user Bob
control over the DID in question, and proofs of control refer to Bob
rather than all of example.com.
</p>
</section>
<section>
<h3>
Cross-Origin Resource Sharing (CORS) Policy Considerations
</h3>
<p>
To support scenarios where DID resolution is performed by client
applications running in a web browser, the file served for the DID
document should be accessible by any origin. To enable this,
the DID document HTTP response can be set to include the
following header:
</p>
<pre class="nohighlight">
Access-Control-Allow-Origin: *
</pre>
</section>
</section>
</section>
<section class="appendix informative">
<h1>
Reference implementations
</h1>
<p>
The code at <a
href="https://github.com/uport-project/https-did-resolver">uport-project/https-did-resolver</a>
is intended to present a reference implementation of this DID method. Any
other implementations should ensure that they pass the test suite
described in <code>/src/__tests__</code> before claiming compatibility.
</p>
<p>
The code at <a
href="https://github.com/transmute-industries/restricted-resolver">transmute-industries/restricted-resolver</a>
implements this specification.
</p>
<p>
The code at <a
href="https://github.com/reinkrul/java-did-resolvers">reinkrul/java-did-resolvers</a>
implements this specification as a Java library.
</p>
</section>
</body>
</html>