forked from w3c/vc-data-integrity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1829 lines (1646 loc) · 73.7 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>Data Integrity 1.0</title>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<!--
=== 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 src='//www.w3.org/Tools/respec/respec-w3c' class='remove'></script>
<script class='remove' src="./common.js"></script>
<script type="text/javascript" class="remove">
var respecConfig = {
// specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
specStatus: "ED",
// the specification's short name, as in http://www.w3.org/TR/short-name/
shortName: "data-integrity",
// if you wish the publication date to be other than today, set this
// publishDate: "2009-08-06",
// if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
// and its maturity status
// previousPublishDate: "1977-03-15",
// previousMaturity: "WD",
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/data-integrity/",
// if this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2009-08-05",
// if you want to have extra CSS, append them to this list
// it is recommended that the respec.css stylesheet be kept
//extraCSS: ["spec.css", "prettify.css"],
// editors, add as many as you like
// only "name" is required
editors: [
{ name: "Manu Sporny", url: "https://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" },
{ name: "Mike Prorock", url: "https://www.linkedin.com/in/mprorock",
company: "Mesur.io", companyURL: "https://mesur.io/" },
{ name: "Dave Longley", url: "https://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/",
note: "2014-2022"
}
],
// 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: "Dave Longley", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" },
{ name: "Manu Sporny", url: "http://digitalbazaar.com/",
company: "Digital Bazaar", companyURL: "http://digitalbazaar.com/" }
],
// extend the bibliography entries
//localBiblio: webpayments.localBiblio,
// name of the WG
group: "vc",
// name (with the @w3c.org) of the public mailing to which comments are due
wgPublicList: "public-credentials",
github: "w3c/data-integrity",
// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI from a random
// document unless you know what you're doing. If in doubt ask your friendly neighbourhood
// Team Contact.
wgPatentURI: "",
maxTocLevel: 4,
/*preProcess: [ webpayments.preProcess ],
alternateFormats: [ {uri: "diff-20111214.html", label: "diff to previous version"} ],
*/
localBiblio: {
"RDF-DATASET-C14N": {
title: "RDF Dataset Normalization",
href: "https://json-ld.github.io/normalization/spec/",
authors: ["David Longley", "Manu Sporny"],
status: "CGDRAFT",
publisher: "JSON-LD Community Group"
},
"SECURITY-VOCABULARY": {
title: "The Security Vocabulary",
href: "https://w3c-ccg.github.io/security-vocab/",
authors: ["Manu Sporny","David Longley"],
status: "CGDRAFT",
publisher: "Credentials Community Group"
},
"ZCAP": {
title: "Authorization Capabilities for Linked Data",
href: "https://w3c-ccg.github.io/zcap-ld/",
status: "CGDRAFT",
publisher: "Credentials Community Group"
},
"MULTIBASE": {
title: "The Multibase Encoding Scheme",
date: "February 2021",
href: "https://datatracker.ietf.org/doc/html/draft-multiformats-multibase-03",
authors: [
"Juan Benet",
"Manu Sporny"
],
status: "Internet-Draft",
publisher: "IETF"
},
"MULTICODEC": {
title: "The Multi Codec Encoding Scheme",
date: "February 2022",
href: "https://github.com/multiformats/multicodec/blob/master/table.csv",
authors: [
"The Multiformats Community"
],
status: "Internet-Draft",
publisher: "IETF"
}
},
postProcess: [restrictRefs]
};
</script>
<style>
ol.algorithm { counter-reset:numsection; list-style-type: none; }
ol.algorithm li { margin: 0.5em 0; }
ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
</style>
</head>
<body>
<section id='abstract'>
<p>
This specification describes mechanisms for ensuring the authenticity and
integrity of structured digital documents using cryptography, such as digital
signatures and other digital mathematical proofs.
</p>
</section>
<section id='sotd'>
<p>
This is an experimental specification and is undergoing regular revisions. It
is not fit for production deployment.
</p>
</section>
<section>
<h2>Introduction</h2>
<p>
Cryptographic proofs enable functionality that is useful to implementors of
distributed systems. For example, proofs can be used to:
</p>
<ul>
<li>
Make statements that can be shared without loss of trust, because their
authorship can be verified by a third party, for example as part of Verifiable
Credentials [[VC-DATA-MODEL]] or social media posts.
</li>
<li>
Authenticate as an entity identified by a particular identifier, for example, as
the subject identified by a Decentralized Identifier (DID) [[DID-CORE]].
</li>
<li>
Delegate authorization for actions in a remote execution environment, via
mechanisms such as Authorization Capabilities [[ZCAP]].
</li>
<li>
Agree to contracts where the agreement can be verified by another party.
</li>
<li>
Additionally, many proofs that are based on cryptographic digital signatures
provide the benefit of integrity protection, making documents and data
tamper-evident.
</li>
</ul>
<p>
The term Linked Data is used to describe a recommended best practice for
exposing, sharing, and connecting information on the Web using standards,
such as URLs, to identify things and their properties. When information
is presented as Linked Data, other related information can be easily discovered
and new information can be easily linked to it. Linked Data is extensible in a
decentralized way, greatly reducing barriers to large scale integration.
</p>
<p>
With the increase in usage of Linked Data for a variety of applications, there
is a need to be able to verify the authenticity and integrity of Linked Data
documents. This specification adds authentication and integrity protection to
data documents through the use of mathematical proofs without sacrificing
Linked Data features such as extensibility and
composability.
</p>
<p class="note" title="Use of Linked Data is an optional feature">
While this specification provides mechanisms to digitally sign Linked Data, the
use of Linked Data is not necessary to gain some of the advantages provided by
this specification.
</p>
<section>
<h3>Design Goals and Rationale</h3>
<p>
The Data Integrity specification achieves the following design goals:
</p>
<dl>
<dt>Simple for Developers</dt>
<dd>
The proof format is designed to be easy to use for developers that don't
have significant cryptography training. For example, <a>cryptographic suite</a>
identifiers are used instead of specific cryptographic parameters to ensure
that it is difficult to accidentally produce a weak digital proof.
</dd>
<dt>Layered Architecture</dt>
<dd>
A number of historical digital signature mechanisms have had monolithic
designs which limited use cases by combining data normalization, syntax,
digital signature, and serialization into a single specification. This
specification layers each component such that a broader range of use cases,
such as generalized selective disclosure and serialization-agnostic signatures,
are enabled.
</dd>
<dt>Cryptographic Agility</dt>
<dd>
Since digital proof mechanisms might be compromised without warning due to
technological advancements, it is important that <a>proof type</a>s can be
easily and quickly replaced. This specification provides algorithm agility
while still keeping the digital proof format easy for developers to understand.
</dd>
<dt>Extensibility</dt>
<dd>
Creating and deploying new proof types is a fairly trivial undertaking
to ensure that the proof format increases the rate of innovation in the
digital proof space.
</dd>
<dt>Syntax Agnostic Proofs</dt>
<dd>
Cryptographic proofs can be serialized in many different but equivalent ways and
have often been tightly bound to the original document syntax. This
specification enables one to create cryptographic proofs that are not
bound to the original document syntax, which enable more advanced use cases
such as being able to use a single digital signature across a variety of
RDF-based graph serialization syntaxes such as JSON-LD, N-Quads, and TURTLE,
without the need to regenerate the proof.
</dd>
</dl>
</section>
<section id="conformance">
</section>
<section>
<h3>Terminology</h3>
<div data-include="./terms.html"></div>
</section>
</section>
<section>
<h2>Data Model</h2>
<p>
This section specifies the data model that is used for expressing
<a>data integrity proofs</a> and <a>verification methods</a>.
</p>
<section>
<h3>Proofs</h3>
<p>
A <a>data integrity proof</a> is comprised of information about the proof,
parameters required to verify it, and the proof value itself. All of this
information is provided using Linked Data vocabularies such as
[[SECURITY-VOCABULARY]].
</p>
<p>
A <a>data integrity proof</a> typically includes at least the following
attributes:
</p>
<dl style="margin-left: 1em;">
<dt><dfn>type</dfn><dt>
<dd>
<em>Required</em>. The specific <a>proof type</a> used. For example, an
<code>Ed25519Signature2020</code> type indicates that the proof includes a
digital signature produced by an <code>ed25519</code> cryptographic key.
</dd>
<dt><dfn class="lint-ignore">proofPurpose</dfn><dt>
<dd>
<em>Required</em>. The specific intent for the proof, the reason why an entity
created it. Acts as a safeguard to prevent the proof from being misused for a
purpose other than the one it was intended for. For example, a proof can be used
for purposes of <code>authentication</code>, for asserting control of a
Verifiable Credential (<code>assertionMethod</code>), and several others.
</dd>
<dt><dfn>verificationMethod</dfn><dt>
<dd>
<em>Required</em>. A set of parameters required to independently verify the
proof, such as an identifier for a public/private key pair that would be used in
the proof.
</dd>
<dt><dfn>created</dfn><dt>
<dd>
<em>Required</em>. The string value of an [[ISO8601]] combined date and time
string generated by the <a href="#proof-algorithm">Proof Algorithm</a>.
</dd>
<dt>domain<dt>
<dd>
Optional. A string value specifying the restricted <a>domain</a> of the proof.
</dd>
<dt><dfn>proofValue</dfn><dt>
<dd>
<em>Required</em>. One of any number of valid representations of <em>proof
value</em> generated by the <a href="#proof-algorithm">Proof Algorithm</a>.
</dd>
</dl>
<p class="note">
The terms <a>type</a>, <a>created</a>, and <a>domain</a> above map to URLs.
The vocabulary where these terms are defined is the [[SECURITY-VOCABULARY]].
</p>
<p>
A proof can be added to a JSON document like the following:
</p>
<pre class="example highlight" title="A simple JSON data document">
{
"title": "Hello world!"
};
</pre>
<p>
by adding the parameters outlined in this section:
</p>
<pre class="example highlight"
style="overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"
title="A simple signed JSON data document">
{
"title": "Hello world!",
"proof": {
"type": "JcsSignature2020",
"created": "2020-11-05T19:23:24Z",
"verificationMethod": "https://di.example/issuer#z6MkjLrk3gKS2nnkeWcmcxi
ZPGskmesDpuwRBorgHxUXfxnG",
"proofPurpose": "assertionMethod",
"proofValue": "zQeVbY4oey5q2M3XKaxup3tmzN4DRFTLVqpLMweBrSxMY2xHX5XTYV8nQA
pmEcqaqA3Q1gVHMrXFkXJeV6doDwLWx"
}
}
</pre>
<p>
The proof example above uses the <code>JcsSignature2020</code>
<a>proof type</a> to produce a verifiable digital proof by canonicalizing the
input data using the JSON Canonicalization Scheme [[RFC8785]] and then
digitally signing it using an Ed25519 elliptic curve signature.
</p>
<p>
Similarly, a proof can be added to a JSON-LD data document like the following:
</p>
<pre class="example highlight" title="A simple JSON-LD data document">
{
"@context": {"title": "https://schema.org#title"},
"title": "Hello world!"
};
</pre>
<p>
by adding the parameters outlined in this section:
</p>
<pre class="example highlight"
style="overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"
title="A simple signed JSON-LD data document">
{
"@context": [
{"title": "https://schema.org#title"},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"title": "Hello world!",
"proof": {
"type": "Ed25519Signature2020",
"created": "2020-11-05T19:23:24Z",
"verificationMethod": "https://ldi.example/issuer#z6MkjLrk3gKS2nnkeWcmcxi
ZPGskmesDpuwRBorgHxUXfxnG",
"proofPurpose": "assertionMethod",
"proofValue": "z4oey5q2M3XKaxup3tmzN4DRFTLVqpLMweBrSxMY2xHX5XTYVQeVbY8nQA
VHMrXFkXJpmEcqdoDwLWxaqA3Q1geV6"
}
}
</pre>
<p>
The proof example above uses the <code>Ed25519Signature2020</code> <a>proof
type</a> to produce a verifiable digital proof by canonicalizing the input data
using the RDF Dataset Canonicalization algorithm [[RDF-DATASET-C14N]] and then
digitally signing it using an Ed25519 elliptic curve signature.
</p>
<div class="issue">Create a separate section detailing an optional mechanism
for authenticating public key control via bi-directional links. How
to establish trust in controllers is out of scope but examples can
be given.</div>
<div class="issue">Specify algorithm agility mechanisms (additional attributes
from the security vocab can be used to indicate other signing and hash
algorithms). Rewrite algorithms to be parameterized on this basis and
move `Ed25519Signature2020` definition to a single supported
mechanism; specify its identifier as a URL. In order to make it easy to
specify a variety of combinations of algorithms, introduce a core
type `DataIntegrityProof` that allows for easy filtering/discover of
proof nodes, but that type on its own doesn't specify any default
proof or hash algorithms, those need to be given via other properties in the
nodes.</div>
<p class="issue"
title="Avoid signature format proliferation by using text-based suite value">
The pattern that Data Integrity Signatures use presently leads to a
proliferation in signature types and JSON-LD Contexts. This proliferation can be
avoided without any loss of the security characteristics of tightly binding a
cryptography suite version to one or more acceptable public keys. The
following signature suites are currently being contemplated: eddsa-2022,
nist-ecdsa-2022, koblitz-ecdsa-2022, rsa-2022, pgp-2022, bbs-2022, eascdsa-2022,
ibsa-2022, and jws-2022.
</p>
<pre class="example" title="A DataIntegritySignature example using a NIST ECDSA 2022 Cryptosuite">
{
"@context": ["https://w3id.org/security/data-integrity/v1"],
"type": "DataIntegritySignature",
"cryptosuite": "ecdsa-2022",
"created": "2022-11-29T20:35:38Z",
"verificationMethod": "did:example:123456789abcdefghi#keys-1",
"proofPurpose": "assertionMethod",
"proofValue": "z2rb7doJxczUFBTdV5F5pehtbUXPDUgKVugZZ99jniVXCUpojJ9PqLYV
evMeB1gCyJ4HqpnTyQwaoRPWaD3afEZboXCBTdV5F5pehtbUXPDUgKVugUpoj"
}
</pre>
<div class="issue">Add an explicit check on key type to prevent an
attacker from selecting an algorithm that could abuse how the key is
used/interpreted.</div>
<div class="issue">Add a note indicating that selective disclosure proof
mechanisms can be compatible with Data Integrity; for example,
an algorithm could produce a merkle tree from a canonicalized set of
N-Quads and then sign the root hash. Disclosure would involve including
the merkle paths for each N-Quad that is to be revealed. This mechanism
would merely consume the normalized output differently (this, and the
proof mechanism would be modifications to this core spec). It might also
be necessary to generate proof parameters such as a private key/seed
that can be used along with an algorithm to deterministically generate
nonces that are concatenated with each N-Quad to prevent rainbow
table or similar attacks.</div>
</section>
<section>
<h3>Proof Purposes</h3>
<p>
A proof that describes its purpose helps prevent it from being misused for some
other purpose.
</p>
<div class="issue">Add a mention of JWK's <code>key_ops</code>
parameter and WebCrypto's <code>KeyUsage</code> restrictions; explain that
Proof Purpose serves a similar goal but allows for finer-grained restrictions.
</div>
<p>
The following is a list of commonly used <a>proof purpose</a> values.
</p>
<dl>
<dt>authentication</dt>
<dd>
Indicates that a given proof is only to be used for the purposes of an
authentication protocol.
</dd>
<dt>assertionMethod</dt>
<dd>
Indicates that a proof can only be used for making assertions, for example
signing a Verifiable Credential.
</dd>
<dt>keyAgreement</dt>
<dd>
Indicates that a proof is used for for key agreement protocols, such as
Elliptic Curve Diffie Hellman key agreement used by popular encryption
libraries.
</dd>
<dt>capabilityDelegation</dt>
<dd>
Indicates that the proof can only be used for delegating capabilities. See the
Authorization Capabilities [[ZCAP]] specification for more detail.
</dd>
<dt>capabilityInvocation</dt>
<dd>
Indicates that the proof can only be used for invoking capabilities. See the
Authorization Capabilities [[ZCAP]] specification for more detail.
</dd>
</dl>
<p>
Note: The Authorization Capabilities [[ZCAP]] specification defines additional
proof purposes for that use case, such as <code>capabilityInvocation</code> and
<code>capabilityDelegation</code>.
</p>
</section>
<section>
<h3>Controller Documents</h3>
<p>
A <a>controller document</a> is a set of data that specifies one or more
relationships between a <a>controller</a> and a set of data, such as a set of
public cryptographic keys. The <a>controller document</a> SHOULD
contain <a>verification relationships</a> that explicitly permit the use of
certain <a>verification methods</a> for specific purposes.
</p>
<div class="issue">Add examples of common Controller documents, such as
controller documents published on a ledger-based registry, or on a mutable medium in
combination with an integrity protection mechanism such as Hashlinks.
</div>
<section>
<h2>Verification Methods</h2>
<p>
A <a>controller document</a> can express <a>verification methods</a>, such as
cryptographic public keys, which can be used to <a>authenticate</a> or authorize
interactions with the <a>controller</a> or associated parties. For example, a
cryptographic public key can be used as a <a>verification method</a> with
respect to a digital signature; in such usage, it verifies that the signer
could use the associated cryptographic private key. <a>Verification methods</a>
might take many parameters. An example of this is a set of five cryptographic
keys from which any three are required to contribute to a cryptographic
threshold signature.
</p>
<dl>
<dt><a>verificationMethod</a></dt>
<dd>
<p>
The <code>verificationMethod</code> property is OPTIONAL. If present, the value
MUST be a <a data-cite="INFRA#ordered-set">set</a> of <a>verification
methods</a>, where each <a>verification method</a> is expressed using a <a
data-cite="INFRA#ordered-map">map</a>. The <a>verification method</a> <a
data-cite="INFRA#ordered-map">map</a> MUST include the <code>id</code>,
<code>type</code>, <code>controller</code>, and specific verification material
properties that are determined by the value of <code>type</code> and are defined
in <a href="#verification-material"></a>. A <a>verification method</a> MAY
include additional properties. <a>Verification methods</a> SHOULD be registered
in the Data Integrity Specification Registries [TBD - DIS-REGISTRIES].
</p>
<dl>
<dt>id</dt>
<dd>
<p>
The value of the <code>id</code> property for a <a>verification
method</a> MUST be a <a data-cite="INFRA#string">string</a> that conforms to the
[[URL]] syntax.
</p>
</dd>
<dt>type</dt>
<dd>
The value of the <code>type</code> property MUST be a <a
data-cite="INFRA#string">string</a> that references exactly one <a>verification
method</a> type. In order to maximize global interoperability, the
<a>verification method</a> type SHOULD be registered in the Data Integrity Specification
Registries [TBD -- DIS-REGISTRIES].
</dd>
<dt>controller</dt>
<dd>
The value of the <code>controller</code> property MUST be a <a
data-cite="INFRA#string">string</a> that conforms to the [[URL]] syntax.
</dd>
</dl>
</dd>
</dl>
<pre class="example" title="Example verification method structure">
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/ed25519-2020/v1"
]
"id": "did:example:123456789abcdefghi",
<span class="comment">...</span>
"verificationMethod": [{
"id": <span class="comment">...</span>,
"type": <span class="comment">...</span>,
"controller": <span class="comment">...</span>,
"publicKeyJwk": <span class="comment">...</span>
}, {
"id": <span class="comment">...</span>,
"type": <span class="comment">...</span>,
"controller": <span class="comment">...</span>,
"publicKeyMultibase": <span class="comment">...</span>
}]
}
</pre>
<p class="note"
title="Verification method controller(s) and controller(s)">
The semantics of the <code>controller</code> property are the same when the
subject of the relationship is the <a>controller document</a> as when the subject of
the relationship is a <a>verification method</a>, such as a cryptographic public
key. Since a key can't control itself, and the key controller cannot be inferred
from the <a>controller document</a>, it is necessary to explicitly express the identity
of the controller of the key. The difference is that the value of
<code>controller</code> for a <a>verification method</a> is <em>not</em>
necessarily a <a>controller</a>. <a>controllers</a> are expressed
using the <code><a>controller</a></code> property at the highest level of the
<a>controller document</a>.
</p>
<section>
<h3>Verification Material</h3>
<p>
Verification material is any information that is used by a process that applies
a <a>verification method</a>. The <code>type</code> of a <a>verification
method</a> is expected to be used to determine its compatibility with such
processes. Examples of verification material properties are
<code><a>publicKeyJwk</a></code> or <code><a>publicKeyMultibase</a></code>. A
<a>cryptographic suite</a> specification is responsible for specifying the
<a>verification method</a> <code>type</code> and its associated verification
material. For example, see <a href="https://w3c-ccg.github.io/lds-jws2020/">JSON
Web Signature 2020</a> and <a
href="https://w3c-ccg.github.io/lds-ed25519-2020/">Ed25519 Signature 2020</a>.
For all registered <a>verification method</a> types and associated verification
material available for <a>controllers</a>, please see the Data Integrity
Specification Registries [TBD - DIS-REGISTRIES].
</p>
<p class=issue>
Ensuring that cryptographic suites are versioned and tightly scoped to a very
small set of possible key types and signature schemes (ideally one key type and
size and one signature output type) is a design goal for most Data Integrity
cryptographic suites. Historically, this has been done by defining both the
key type and the cryptographic suite that uses the key type in the same
specification. The downside of doing so, however, is that there might be a
proliferation of different key types in multikey that result in different
cryptosuites defining the same key material differently. For example, one
cryptosuite might use compressed Curve P-256 keys while another uses
uncompressed values. If that occurs, it will harm interoperability. It will be
important in the coming months to years to ensure that this does not happen
by fully defining the multikey format in a separate specification so
cryptosuite specifications, such as this one, can refer to the multikey
specification, thus reducing the chances of multikey type proliferation and
improving the chances of maximum interoperability for the multikey format.
</p>
<p>
To increase the likelihood of interoperable implementations, this specification
limits the number of formats for expressing verification material in a <a>controller
document</a>. The fewer formats that implementers have to
implement, the more likely it will be that they will support all of them. This
approach attempts to strike a delicate balance between ease of implementation
and supporting formats that have historically had broad deployment.
Two supported verification material properties are listed below:
</p>
<dl>
<dt><dfn>publicKeyJwk</dfn></dt>
<dd>
<p>
The <code>publicKeyJwk</code> property is OPTIONAL. If present, the value MUST
be a <a data-cite="INFRA#ordered-map">map</a> representing a JSON Web Key that
conforms to [[RFC7517]]. The <a data-cite="INFRA#ordered-map">map</a> MUST NOT
contain "d", or any other members of the private information class as described
in <a href="https://tools.ietf.org/html/rfc7517#section-8.1.1">Registration
Template</a>. It is RECOMMENDED that verification methods that use JWKs
[[RFC7517]] to represent their public keys use the value of <code>kid</code> as
their fragment identifier. It is RECOMMENDED that JWK
<code>kid</code> values are set to the public key fingerprint [[RFC7638]]. See
the first key in <a href="#example-various-verification-method-types"></a> for
an example of a public key with a compound key identifier.
</p>
</dd>
<dt><dfn>publicKeyMultibase</dfn></dt>
<dd>
<p>
The <code>publicKeyMultibase</code> property is OPTIONAL. This feature is
non-normative. If present, the value MUST be a <a
data-cite="INFRA#string">string</a> representation of a [[?MULTIBASE]] encoded
public key.
</p>
<p class="advisement">
Note that the [[?MULTIBASE]] specification is not yet a standard and is
subject to change. There might be some use cases for this data format
where <code><b>public</b>KeyMultibase</code> is defined, to allow for
expression of public keys, but <code><b>private</b>KeyMultibase</code>
is not defined, to protect against accidental leakage of secret keys.
</p>
</dd>
</dl>
<p>
A <a>verification method</a> MUST NOT contain multiple verification material
properties for the same material. For example, expressing key material in a
<a>verification method</a> using both <code>publicKeyJwk</code> and
<code>publicKeyMultibase</code> at the same time is prohibited.
</p>
<p>
An example of a <a>controller document</a> containing <a>verification methods</a> using
both properties above is shown below.
</p>
<pre id="example-various-verification-method-types"
class="example nohighlight"
title="Verification methods using publicKeyJwk and publicKeyMultibase">
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/jws-2020/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"
]
"id": "did:example:123456789abcdefghi",
<span class="comment">...</span>
"verificationMethod": [{
"id": "did:example:123#_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A",
"type": "JsonWebKey2020", <span class="comment">// external (property value)</span>
"controller": "did:example:123",
"publicKeyJwk": {
"crv": "Ed25519", <span class="comment">// external (property name)</span>
"x": "VCpo2LMLhn6iWku8MKvSLg2ZAoC-nlOyPVQaO3FxVeQ", <span class="comment">// external (property name)</span>
"kty": "OKP", <span class="comment">// external (property name)</span>
"kid": "_Qq0UL2Fq651Q0Fjd6TvnYE-faHiOpRlPVQcY_-tA4A" <span class="comment">// external (property name)</span>
}
}, {
"id": "did:example:123456789abcdefghi#keys-1",
"type": "Ed25519VerificationKey2020", <span class="comment">// external (property value)</span>
"controller": "did:example:pqrstuvwxyz0987654321",
"publicKeyMultibase": "z6MkmM42vxfqZQsv4ehtTjFFxQ4sQKS2w6WR7emozFAn5cxu"
}],
<span class="comment">...</span>
}
</pre>
</section>
<section>
<h3>Multikey</h3>
<p>
The Multikey data model is a specific type of <a>verification method</a> that
utilizes the [[MULTICODEC]] specification to encode key types into a single
binary stream that is then encoded using the [[MULTIBASE]] specification.
To encode a Multikey, the <a>verification method</a> `type` MUST be set to
`Multikey` and the `publicKeyMultibase` value MUST be a [[MULTIBASE]] encoded
[[MULTICODEC]] value. An example of a Multikey is provided below:
</p>
<pre class="example nohighlight"
title="Multikey encoding of a Ed25519 public key">
{
"@context": ["https://w3id.org/security/suites/multikey/v1"],
"id": "did:example:123456789abcdefghi#keys-1",
"type": "Multikey",
"controller": "did:example:123456789abcdefghi",
"publicKeyMultibase": "z6MkmM42vxfqZQsv4ehtTjFFxQ4sQKS2w6WR7emozFAn5cxu"
}
</pre>
<p>
In the example above, the `publicKeyMultibase` value starts with the letter `z`,
which is the [[MULTIBASE]] header that conveys that the binary data is
base58-encoded using the Bitcoin base-encoding alphabet. The decoded binary data
[[MULTICODEC]] header is `0xed`, which specifies that the remaining data
is a 32-byte raw Ed25519 public key.
</p>
<p>
The Multikey data model is also capable of encoding secret keys, sometimes
referred to as <em>private keys</em>.
</p>
<pre class="example nohighlight"
title="Multikey encoding of a Ed25519 secret key">
{
"@context": ["https://w3id.org/security/suites/secrets/v1"],
"id": "did:example:123456789abcdefghi#keys-1",
"type": "Multikey",
"controller": "did:example:123456789abcdefghi",
"secretKeyMultibase": "z3u2fprgdREFtGakrHr6zLyTeTEZtivDnYCPZmcSt16EYCER"
}
</pre>
<p>
In the example above, the `secretKeyMultibase` value starts with the letter `z`,
which is the [[MULTIBASE]] header that conveys that the binary data is
base58-encoded using the Bitcoin base-encoding alphabet. The decoded binary data
[[MULTICODEC]] header is `0x1300`, which specifies that the remaining data
is a 32-byte raw Ed25519 private key.
</p>
</section>
<section>
<h3>Referring to Verification Methods</h3>
<p>
<a>Verification methods</a> can be embedded in or referenced from properties
associated with various <a>verification relationships</a> as described in <a
href="#verification-relationships"></a>. Referencing <a>verification methods</a>
allows them to be used by more than one <a>verification relationship</a>.
</p>
<p>
If the value of a <a>verification method</a> property is a <a
data-cite="INFRA#ordered-map">map</a>, the <a>verification method</a> has been
embedded and its properties can be accessed directly. However, if the value is a
URL <a data-cite="INFRA#string">string</a>, the <a>verification method</a> has
been included by reference and its properties will need to be retrieved from
elsewhere in the <a>controller document</a> or from another <a>controller document</a>. This
is done by dereferencing the URL and searching the resulting <a>resource</a> for a
<a>verification method</a> <a data-cite="INFRA#ordered-map">map</a> with an
<code>id</code> property whose value matches the URL.
</p>
<pre class="example nohighlight"
title="Embedding and referencing verification methods">
{
<span class="comment">...</span>
"authentication": [
<span class="comment">// this key is referenced and might be used by</span>
<span class="comment">// more than one verification relationship</span>
"did:example:123456789abcdefghi#keys-1",
<span class="comment">// this key is embedded and may *only* be used for authentication</span>
{
"id": "did:example:123456789abcdefghi#keys-2",
"type": "Ed25519VerificationKey2020", <span class="comment">// external (property value)</span>
"controller": "did:example:123456789abcdefghi",
"publicKeyMultibase": "z6MkmM42vxfqZQsv4ehtTjFFxQ4sQKS2w6WR7emozFAn5cxu"
}
],
<span class="comment">...</span>
}
</pre>
</section>
</section>
<section>
<h2>Verification Relationships</h2>
<p>
A <a>verification relationship</a> expresses the relationship between the
<a>controller</a> and a <a>verification method</a>.
</p>
<p>
Different <a>verification relationships</a> enable the associated
<a>verification methods</a> to be used for different purposes. It is up to a
<em>verifier</em> to ascertain the validity of a verification attempt by
checking that the <a>verification method</a> used is contained in the
appropriate <a>verification relationship</a> property of the
<a>controller document</a>.
</p>
<p>
The <a>verification relationship</a> between the <a>controller</a> and the
<a>verification method</a> is explicit in the <a>controller document</a>.
<a>Verification methods</a> that are not associated with a particular
<a>verification relationship</a> cannot be used for that <a>verification
relationship</a>. For example, a <a>verification method</a> in the value of
the <code><a>authentication</a></code> property cannot be used to engage in
key agreement protocols with the <a>controller</a>—the value of the
<code><a>keyAgreement</a></code> property needs to be used for that.
</p>
<p>
The <a>controller document</a> does not express revoked keys using a <a>verification
relationship</a>. If a referenced verification method is not in the latest
<a>controller document</a> used to dereference it, then that verification method is
considered invalid or revoked.
</p>
<p>
The following sections define several useful <a>verification relationships</a>.
A <a>controller document</a> MAY include any of these, or other properties, to
express a specific <a>verification relationship</a>. In order to maximize global
interoperability, any such properties used SHOULD be registered in the
Data Integrity Specification Registries [TBD: DIS-REGISTRIES].
</p>
<section>
<h2>Authentication</h2>
<p>
The <code>authentication</code> <a>verification relationship</a> is used to
specify how the <a>controller</a> is expected to be <a>authenticated</a>, for
purposes such as logging into a website or engaging in any sort of
challenge-response protocol.
</p>
<dl>
<dt><dfn>authentication</dfn></dt>
<dd>
The <code>authentication</code> property is OPTIONAL. If present, the associated
value MUST be a <a data-cite="INFRA#ordered-set">set</a> of one or more
<a>verification methods</a>. Each <a>verification method</a> MAY be embedded or
referenced.
</dd>
</dl>
<pre class="example nohighlight" title="Authentication property
containing three verification methods">
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "did:example:123456789abcdefghi",
<span class="comment">...</span>
"authentication": [
<span class="comment">// this method can be used to authenticate as did:...fghi</span>
"did:example:123456789abcdefghi#keys-1",
<span class="comment">// this method is *only* approved for authentication, it may not</span>
<span class="comment">// be used for any other proof purpose, so its full description is</span>
<span class="comment">// embedded here rather than using only a reference</span>
{
"id": "did:example:123456789abcdefghi#keys-2",
"type": "Ed25519VerificationKey2020",
"controller": "did:example:123456789abcdefghi",
"publicKeyMultibase": "z6MkmM42vxfqZQsv4ehtTjFFxQ4sQKS2w6WR7emozFAn5cxu"
}
],
<span class="comment">...</span>
}
</pre>
<p>
If authentication is established, it is up to the application to decide what to
do with that information.
</p>
<p>
This is useful to any <em>authentication verifier</em> that needs to check to
see if an entity that is attempting to <a>authenticate</a> is, in fact,
presenting a valid proof of authentication. When a <em>verifier</em> receives
some data (in some protocol-specific format) that contains a proof that was made
for the purpose of "authentication", and that says that an entity is identified
by the `id`, then that <em>verifier</em> checks to ensure that the proof can be
verified using a <a>verification method</a> (e.g., public key) listed under
<code><a>authentication</a></code> in the <a>controller document</a>.
</p>
<p>
Note that the <a>verification method</a> indicated by the
<code><a>authentication</a></code> property of a <a>controller document</a> can
only be used to <a>authenticate</a> the <a>controller</a>. To
<a>authenticate</a> a different <a>controller</a>, the entity associated with
the value of <code>controller</code> needs to <a>authenticate</a> with its
<em>own</em> <a>controller document</a> and associated
<code><a>authentication</a></code> <a>verification relationship</a>.
</p>
</section>
<section>
<h2>Assertion</h2>
<p>
The <code>assertionMethod</code> <a>verification relationship</a> is used to
specify how the <a>controller</a> is expected to express claims, such as for
the purposes of issuing a Verifiable Credential [[?VC-DATA-MODEL]].
</p>
<dl>
<dt><dfn>assertionMethod</dfn></dt>
<dd>
The <code>assertionMethod</code> property is OPTIONAL. If present, the
associated value MUST be a <a data-cite="INFRA#ordered-set">set</a> of
one or more <a>verification methods</a>. Each <a>verification method</a> MAY be
embedded or referenced.
</dd>
</dl>
<p>
This property is useful, for example, during the processing of a <a>verifiable
credential</a> by a verifier. During verification, a verifier checks to see if a
<a>verifiable credential</a> contains a proof created by the <a>controller</a>
by checking that the <a>verification method</a> used to assert the proof is