-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcorda_did_method.html
1248 lines (1132 loc) · 74.2 KB
/
corda_did_method.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 lang="en-GB-oxendict" class=" kvfzrrzhh idc0_321"><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="generator" content="ReSpec 25.16.3">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
dfn{cursor:pointer}
.dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font:small Helvetica Neue,sans-serif,Droid Sans Fallback;background:#fff;color:#000;box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);border-radius:2px}
.dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
.dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;top:0}
.dfn-panel:not(.docked)>.caret::before{border-bottom:9px solid #a2a9b1}
.dfn-panel *{margin:0}
.dfn-panel b{display:block;color:#000;margin-top:.25em}
.dfn-panel ul a[href]{color:#333}
.dfn-panel a.self-link{font-weight:700}
.dfn-panel .dfn-exported{float:right;padding:.1em;border-radius:.2em;text-align:center;white-space:nowrap;font-size:90%;background:#d1edfd;color:#040b1c;box-shadow:0 0 0 .125em #1ca5f940}
.dfn-panel a:not(:hover){text-decoration:none!important;border-bottom:none!important}
.dfn-panel a[href]:hover{border-bottom-width:1px}
.dfn-panel ul{padding:0}
.dfn-panel li{margin-left:1em}
.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}
</style>
<title>Corda DID Method</title>
<style id="respec-mainstyle">
@keyframes pop{
0%{transform:scale(1,1)}
25%{transform:scale(1.25,1.25);opacity:.75}
100%{transform:scale(1,1)}
}
.hljs{background:0 0!important}
a abbr,h1 abbr,h2 abbr,h3 abbr,h4 abbr,h5 abbr,h6 abbr{border:none}
dfn{font-weight:700}
a.internalDFN{color:inherit;border-bottom:1px solid #99c;text-decoration:none}
a.externalDFN{color:inherit;border-bottom:1px dotted #ccc;text-decoration:none}
a.bibref{text-decoration:none}
.respec-offending-element:target{animation:pop .25s ease-in-out 0s 1}
.respec-offending-element,a[href].respec-offending-element{text-decoration:red wavy underline}
@supports not (text-decoration:red wavy underline){
.respec-offending-element:not(pre){display:inline-block}
.respec-offending-element{background:url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x}
}
#references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
cite .bibref{font-style:normal}
code{color:#c63501}
th code{color:inherit}
a[href].orcid{padding-left:4px;padding-right:4px}
a[href].orcid>svg{margin-bottom:-2px}
.toc a,.tof a{text-decoration:none}
a .figno,a .secno{color:#000}
ol.tof,ul.tof{list-style:none outside none}
.caption{margin-top:.5em;font-style:italic}
table.simple{border-spacing:0;border-collapse:collapse;border-bottom:3px solid #005a9c}
.simple th{background:#005a9c;color:#fff;padding:3px 5px;text-align:left}
.simple th a{color:#fff;padding:3px 5px;text-align:left}
.simple th[scope=row]{background:inherit;color:inherit;border-top:1px solid #ddd}
.simple td{padding:3px 10px;border-top:1px solid #ddd}
.simple tr:nth-child(even){background:#f0f6ff}
.section dd>p:first-child{margin-top:0}
.section dd>p:last-child{margin-bottom:0}
.section dd{margin-bottom:1em}
.section dl.attrs dd,.section dl.eldef dd{margin-bottom:0}
#issue-summary>ul,.respec-dfn-list{column-count:2}
#issue-summary li,.respec-dfn-list li{list-style:none}
details.respec-tests-details{margin-left:1em;display:inline-block;vertical-align:top}
details.respec-tests-details>*{padding-right:2em}
details.respec-tests-details[open]{z-index:999999;position:absolute;border:thin solid #cad3e2;border-radius:.3em;background-color:#fff;padding-bottom:.5em}
details.respec-tests-details[open]>summary{border-bottom:thin solid #cad3e2;padding-left:1em;margin-bottom:1em;line-height:2em}
details.respec-tests-details>ul{width:100%;margin-top:-.3em}
details.respec-tests-details>li{padding-left:1em}
a[href].self-link:hover{opacity:1;text-decoration:none;background-color:transparent}
h2,h3,h4,h5,h6{position:relative}
aside.example .marker>a.self-link{color:inherit}
h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{border:none;color:inherit;font-size:83%;height:2em;left:-1.6em;opacity:.5;position:absolute;text-align:center;text-decoration:none;top:0;transition:opacity .2s;width:2em}
h2>a.self-link::before,h3>a.self-link::before,h4>a.self-link::before,h5>a.self-link::before,h6>a.self-link::before{content:"§";display:block}
@media (max-width:767px){
dd{margin-left:0}
h2>a.self-link,h3>a.self-link,h4>a.self-link,h5>a.self-link,h6>a.self-link{left:auto;top:auto}
}
@media print{
.removeOnSave{display:none}
}
</style>
<style>
.hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;background:#fafafa}
.hljs-comment,.hljs-quote{color:#717277;font-style:italic}
.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}
.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#ca4706;font-weight:700}
.hljs-literal{color:#0b76c5}
.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{color:#42803c}
.hljs-built_in,.hljs-class .hljs-title{color:#9a6a01}
.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}
.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:700}
.hljs-link{text-decoration:underline}
</style>
<style>
var{position:relative;cursor:pointer}
var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#000}
var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#000;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}
var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}
</style>
<script id="initialUserConfig" type="application/json">{
"xref": true,
"specStatus": "unofficial",
"shortName": "did-core",
"copyrightStart": "2019",
"extraCSS": [
"http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"
],
"editors": [
{
"name": "Abbas Ali",
"mailto": "[email protected]",
"company": "R3",
"companyURL": "https://www.r3.com/"
},
{
"name": "Arati Baliga",
"company": "Persistent Systems",
"companyURL": "https://www.persistent.com/"
},
{
"name": "Pandurang Kamat",
"company": "Persistent Systems",
"companyURL": "https://www.persistent.com/"
},
{
"name": "Moritz Platt",
"mailto": "[email protected]",
"company": "R3",
"companyURL": "https://www.r3.com/"
}
],
"authors": [
{
"name": "Pranav Kirtani",
"company": "Persistent Systems",
"companyURL": "https://www.persistent.com/"
},
{
"name": "Moritz Platt",
"mailto": "[email protected]",
"company": "R3",
"companyURL": "https://www.r3.com/"
},
{
"name": "Nitesh Solanki",
"company": "Persistent Systems",
"companyURL": "https://www.persistent.com/"
}
],
"wg": "DID Working Group",
"wgURI": "https://www.w3.org/2019/did-wg/",
"wgPublicList": "[email protected]",
"localBiblio": {
"corda-whitepaper": {
"title": "Corda Technical White Paper",
"href": "https://www.r3.com/reports/corda-technical-whitepaper/",
"authors": [
"Mike Hearn",
"Richard Gendal Brown"
],
"id": "corda-whitepaper"
},
"corda-messaging": {
"title": "Corda Networking and Messaging",
"href": "https://docs.corda.net/messaging.html",
"id": "corda-messaging"
},
"corda-network": {
"title": "Corda Network Foundation",
"href": "https://corda.network/",
"id": "corda-network"
},
"corda-testnet": {
"title": "Corda Testnet",
"href": "https://docs.corda.net/head/corda-testnet-intro.html",
"id": "corda-testnet"
},
"multibase": {
"title": "The Multibase Data Format",
"href": "https://tools.ietf.org/id/draft-multiformats-multibase-00.html",
"authors": [
"J. Benet",
"M. Sporny"
],
"id": "multibase"
},
"ddos-mitigation": {
"title": "Distributed denial of service (DDoS) resilience in cloud: Review and conceptual cloud DDoS mitigation framework",
"href": "https://doi.org/10.1016/j.jnca.2016.01.001",
"authors": [
"Opeyemi Osanaiye",
"Kim-Kwang Raymond Choo",
"Mqhele Dlodloa"
],
"id": "ddos-mitigation"
}
},
"_ijt": "8csjqmb82ebgfb5noopsu8kubr",
"publishISODate": "2020-09-21T00:00:00.000Z",
"generatedSubtitle": "Unofficial Draft 21 September 2020"
}</script>
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-UD"></head>
<body class="h-entry informative"><div class="head">
<h1 id="title" class="title">Corda DID Method</h1>
<h2>
Unofficial Draft
<time class="dt-published" datetime="2020-09-21">21 September 2020</time>
</h2>
<dl>
<dt>Editors:</dt>
<dd class="p-author h-card vcard"><a class="ed_mailto u-email email p-name" href="mailto:[email protected]">Abbas Ali</a>
(<a class="p-org org h-org h-card" href="https://www.r3.com/">R3</a>)
</dd><dd class="p-author h-card vcard"><span class="p-name fn">Arati Baliga</span>
(<a class="p-org org h-org h-card" href="https://www.persistent.com/">Persistent Systems</a>)
</dd><dd class="p-author h-card vcard"><span class="p-name fn">Pandurang Kamat</span>
(<a class="p-org org h-org h-card" href="https://www.persistent.com/">Persistent Systems</a>)
</dd><dd class="p-author h-card vcard"><a class="ed_mailto u-email email p-name" href="mailto:[email protected]">Moritz Platt</a>
(<a class="p-org org h-org h-card" href="https://www.r3.com/">R3</a>)
</dd>
<dt>Authors:</dt><dd class="p-author h-card vcard"><span class="p-name fn">Pranav Kirtani</span>
(<a class="p-org org h-org h-card" href="https://www.persistent.com/">Persistent Systems</a>)
</dd><dd class="p-author h-card vcard"><a class="ed_mailto u-email email p-name" href="mailto:[email protected]">Moritz Platt</a>
(<a class="p-org org h-org h-card" href="https://www.r3.com/">R3</a>)
</dd><dd class="p-author h-card vcard"><span class="p-name fn">Nitesh Solanki</span>
(<a class="p-org org h-org h-card" href="https://www.persistent.com/">Persistent Systems</a>)
</dd>
</dl>
<p class="copyright">
This document is licensed under a
<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" class="subfoot">Creative Commons Attribution 4.0 License</a>.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="introductory"><h2>Abstract</h2>
The Corda DID method aims to implement Decentralized Identifier [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>] architecture in Corda networks.<br>
The Corda DID method is a hybrid method, exposing a widely recognized protocol for end users (JSON over HTTPS),
while utilizing a Corda-specific means of communication (Corda’s peer-to-peer messaging protocol
[<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-messaging" title="Corda Networking and Messaging">corda-messaging</a></cite>]) for data replication.
</section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a class="tocxref" href="#introduction"><bdi class="secno">1. </bdi>Introduction</a></li><li class="tocline"><a class="tocxref" href="#overall-architecture"><bdi class="secno">2. </bdi>Overall Architecture</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#networks"><bdi class="secno">2.1 </bdi>Networks</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#member-node-endpoints"><bdi class="secno">2.1.1 </bdi>Member Node Endpoints</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#testnet"><bdi class="secno">2.1.1.1 </bdi>Testnet</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#http-endpoints"><bdi class="secno">2.1.1.1.1 </bdi>HTTP Endpoints</a></li><li class="tocline"><a class="tocxref" href="#corda-peer-to-peer-endpoints"><bdi class="secno">2.1.1.1.2 </bdi>Corda Peer-to-Peer Endpoints</a></li></ol></li><li class="tocline"><a class="tocxref" href="#corda-network"><bdi class="secno">2.1.1.2 </bdi>Corda Network</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#http-endpoints-0"><bdi class="secno">2.1.1.2.1 </bdi>HTTP Endpoints</a></li><li class="tocline"><a class="tocxref" href="#corda-peer-to-peer-endpoints-0"><bdi class="secno">2.1.1.2.2 </bdi>Corda Peer-to-Peer Endpoints</a></li></ol></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#security-considerations"><bdi class="secno">2.2 </bdi>Security Considerations</a></li><li class="tocline"><a class="tocxref" href="#privacy-considerations"><bdi class="secno">2.3 </bdi>Privacy Considerations</a></li></ol></li><li class="tocline"><a class="tocxref" href="#methods"><bdi class="secno">3. </bdi>Methods</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#corda-did-format"><bdi class="secno">3.1 </bdi>Corda DID Format</a></li><li class="tocline"><a class="tocxref" href="#json-over-https-api"><bdi class="secno">3.2 </bdi>JSON-over-HTTPS API</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#message-format"><bdi class="secno">3.2.1 </bdi>Message Format</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#instruction"><bdi class="secno">3.2.1.1 </bdi>Instruction data</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#supported-encodings"><bdi class="secno">3.2.1.1.1 </bdi>Supported Encodings</a></li></ol></li><li class="tocline"><a class="tocxref" href="#examples"><bdi class="secno">3.2.1.2 </bdi>Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#base58"><bdi class="secno">3.2.1.2.1 </bdi>Base58</a></li><li class="tocline"><a class="tocxref" href="#multibase"><bdi class="secno">3.2.1.2.2 </bdi>Multibase</a></li><li class="tocline"><a class="tocxref" href="#hex"><bdi class="secno">3.2.1.2.3 </bdi>Hex</a></li><li class="tocline"><a class="tocxref" href="#base64"><bdi class="secno">3.2.1.2.4 </bdi>Base64</a></li></ol></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#http-communication"><bdi class="secno">3.3 </bdi>HTTP Communication</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#create-did"><bdi class="secno">3.3.1 </bdi>Create DID</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#request"><bdi class="secno">3.3.1.1 </bdi>Request</a></li><li class="tocline"><a class="tocxref" href="#response"><bdi class="secno">3.3.1.2 </bdi>Response</a></li></ol></li><li class="tocline"><a class="tocxref" href="#read-did"><bdi class="secno">3.3.2 </bdi>Read DID</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#request-0"><bdi class="secno">3.3.2.1 </bdi>Request</a></li><li class="tocline"><a class="tocxref" href="#response-0"><bdi class="secno">3.3.2.2 </bdi>Response</a></li></ol></li><li class="tocline"><a class="tocxref" href="#update-did"><bdi class="secno">3.3.3 </bdi>Update DID</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#request-1"><bdi class="secno">3.3.3.1 </bdi>Request</a></li><li class="tocline"><a class="tocxref" href="#response-1"><bdi class="secno">3.3.3.2 </bdi>Response</a></li></ol></li><li class="tocline"><a class="tocxref" href="#delete-did"><bdi class="secno">3.3.4 </bdi>Delete DID</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#request-2"><bdi class="secno">3.3.4.1 </bdi>Request</a></li></ol></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#implementation-considerations"><bdi class="secno">4. </bdi>Implementation Considerations</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#create-did-0"><bdi class="secno">4.1 </bdi>Create DID</a></li><li class="tocline"><a class="tocxref" href="#read-did-0"><bdi class="secno">4.2 </bdi>Read DID</a></li><li class="tocline"><a class="tocxref" href="#update-did-0"><bdi class="secno">4.3 </bdi>Update DID</a></li><li class="tocline"><a class="tocxref" href="#delete-did-0"><bdi class="secno">4.4 </bdi>Delete DID</a></li></ol></li><li class="tocline"><a class="tocxref" href="#tof"><bdi class="secno">A. </bdi>List of Figures</a></li><li class="tocline"><a class="tocxref" href="#references"><bdi class="secno">B. </bdi>References</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#informative-references"><bdi class="secno">B.1 </bdi>Informative references</a></li></ol></li></ol></nav>
<section id="introduction">
<h2 id="x1-introduction"><bdi class="secno">1. </bdi>Introduction<a class="self-link" aria-label="§" href="#introduction"></a></h2>
<p>
To understand the environment in which the Corda DID method operates, the permissioned nature of a Corda network
and the point-to-point approach to data replication must be taken into account.
While parties in permissionless blockchains remain anonymous and can join and leave at will, any Corda network
utilizes a standard PKIX infrastructure for linking public keys to identities [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-whitepaper" title="Corda Technical White Paper">corda-whitepaper</a></cite>].
As such, individually deployed entities in the network – nodes – have a strong notion of identity.
This concept is instrumental in network communication. Similarly, the data-replication model implemented in
Corda is different to that of a conventional public blockchain, which makes all in-ledger data visible to all
network participants. In Corda, data are distributed to a configurable subset of network members only.
</p>
</section>
<section id="overall-architecture">
<h2 id="x2-overall-architecture"><bdi class="secno">2. </bdi>Overall Architecture<a class="self-link" aria-label="§" href="#overall-architecture"></a></h2>
<p>
The Corda DID method operates in an environment where multiple nodes form a consortium in order to replicate
decentralized identity data (cf. <a href="#high-level-architecture">figure 1</a>).
These consortium nodes replicate decentralized identifier documents to form a network-wide and, ultimately,
consistent view of the unity of decentralized identifiers, using the Corda DID method.
</p>
<figure id="high-level-architecture">
<img src="high_level_architecture.svg" height="339" width="1050">
<figcaption>Figure <bdi class="figno">1</bdi> <span class="fig-title">The high-level network architecture of a Corda network with three consortium nodes.</span></figcaption>
</figure>
<p>
Replication is implemented via the Corda peer-to-peer protocol and invoked via the Corda Flow Framework. Since
replication between consortium members is not a public aspect of the DID method, it will not be discussed in
detail in this specification. It is, however, briefly outlined in the <a href="#implementation-considerations">information
section</a>.
</p>
<p>
External parties, i.e., those not part of the consortium, can utilize the Corda DID method to create, read,
update and delete DID documents via two APIs:
</p>
<ol>
<li>The JSON-over-HTTPS protocol</li>
<li>The Corda peer-to-peer protocol</li>
</ol>
<p id="expert-users">
At the time of writing, only the first of these (JSON over HTTPS) is a documented aspect of the DID method. The
second protocol is intended for expert users who wish to make use of DID within the context of the Corda Flow
Framework. A formal specification for this API will be the subject of future work.
</p>
<section id="networks">
<h3 id="x2-1-networks"><bdi class="secno">2.1 </bdi>Networks<a class="self-link" aria-label="§" href="#networks"></a></h3>
<p>
DID documents are to be replicated between nodes in the same Corda network. Ultimately, the target network
for the method is the Corda Network [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-network" title="Corda Network Foundation">corda-network</a></cite>]. While the method specification is evolving, an
ephemeral environment for experimentation with the concept will be provided.
</p>
<table>
<tbody><tr>
<th>Network</th>
<th>Stage</th>
<th>Purpose</th>
<th>Consortium Members</th>
</tr>
<tr>
<td>Testnet [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-testnet" title="Corda Testnet">corda-testnet</a></cite>]</td>
<td>Test</td>
<td>To enable experimentation with the method in an ephemeral environment. DIDs are not expected to be
continued permanently.
</td>
<td>To be defined</td>
</tr>
<tr>
<td>Corda Network [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-network" title="Corda Network Foundation">corda-network</a></cite>]</td>
<td>Live</td>
<td>A production-ready environment replicating DID on a permanent basis.</td>
<td>To be defined</td>
</tr>
</tbody></table>
<section id="member-node-endpoints">
<h4 id="x2-1-1-member-node-endpoints"><bdi class="secno">2.1.1 </bdi>Member Node Endpoints<a class="self-link" aria-label="§" href="#member-node-endpoints"></a></h4>
<p>
Consortium-member nodes have to maintain a permanent hostname or IP address for Corda peer-to-peer
communication and to expose the HTTP server that operates the API. These hostnames/IP addresses can be
different.
</p>
<section id="testnet">
<h5 id="x2-1-1-1-testnet"><bdi class="secno">2.1.1.1 </bdi>Testnet<a class="self-link" aria-label="§" href="#testnet"></a></h5>
<section id="http-endpoints">
<h6 id="x2-1-1-1-1-http-endpoints"><bdi class="secno">2.1.1.1.1 </bdi>HTTP Endpoints<a class="self-link" aria-label="§" href="#http-endpoints"></a></h6>
<table>
<tbody><tr>
<th>Consortium-Member</th>
<th>Host Name</th>
<th>Port</th>
</tr>
<tr>
<td colspan="3" style="text-align: center">To be defined</td>
</tr>
</tbody></table>
</section>
<section id="corda-peer-to-peer-endpoints">
<h6 id="x2-1-1-1-2-corda-peer-to-peer-endpoints"><bdi class="secno">2.1.1.1.2 </bdi>Corda Peer-to-Peer Endpoints<a class="self-link" aria-label="§" href="#corda-peer-to-peer-endpoints"></a></h6>
<table>
<tbody><tr>
<th>Consortium-Member</th>
<th>Host Name</th>
<th>Port</th>
</tr>
<tr>
<td colspan="3" style="text-align: center">To be defined</td>
</tr>
</tbody></table>
</section>
</section>
<section id="corda-network">
<h5 id="x2-1-1-2-corda-network"><bdi class="secno">2.1.1.2 </bdi>Corda Network<a class="self-link" aria-label="§" href="#corda-network"></a></h5>
<section id="http-endpoints-0">
<h6 id="x2-1-1-2-1-http-endpoints"><bdi class="secno">2.1.1.2.1 </bdi>HTTP Endpoints<a class="self-link" aria-label="§" href="#http-endpoints-0"></a></h6>
<table>
<tbody><tr>
<th>Consortium-Member</th>
<th>Host Name</th>
<th>Port</th>
</tr>
<tr>
<td colspan="3" style="text-align: center">To be defined</td>
</tr>
</tbody></table>
</section>
<section id="corda-peer-to-peer-endpoints-0">
<h6 id="x2-1-1-2-2-corda-peer-to-peer-endpoints"><bdi class="secno">2.1.1.2.2 </bdi>Corda Peer-to-Peer Endpoints<a class="self-link" aria-label="§" href="#corda-peer-to-peer-endpoints-0"></a></h6>
<table>
<tbody><tr>
<th>Consortium-Member</th>
<th>Host Name</th>
<th>Port</th>
</tr>
<tr>
<td colspan="3" style="text-align: center">To be defined</td>
</tr>
</tbody></table>
</section>
</section>
</section>
</section>
<section id="security-considerations">
<h3 id="x2-2-security-considerations"><bdi class="secno">2.2 </bdi>Security Considerations<a class="self-link" aria-label="§" href="#security-considerations"></a></h3>
<h3 id="attacks-in-scope">Attacks In Scope<a class="self-link" aria-label="§" href="#security-considerations"></a></h3>
<h4 id="denial-of-service-dos-attack">Denial-of-Service (DoS) Attack<a class="self-link" aria-label="§" href="#security-considerations"></a></h4>
<p>
As replicating nodes are required to distribute data to others, they are susceptible to DoS attacks. An
attacker who chooses to conduct a DoS attack can relatively easily flood the network with DID creation
requests. If unmitigated, this attack can have high impact as the messages necessary to instruct the
creation of a DID are trivial to create in bulk. Due to the need for broadcasting, replicating these
messages leads to significant computational expense.<br>
This attack can be mitigated by employing conventional mitigation techniques [<cite><a class="bibref" data-link-type="biblio" href="#bib-ddos-mitigation" title="Distributed denial of service (DDoS) resilience in cloud: Review and conceptual cloud DDoS mitigation framework">ddos-mitigation</a></cite>].
</p>
<h3 id="attacks-out-of-scope">Attacks Out of Scope<a class="self-link" aria-label="§" href="#security-considerations"></a></h3>
<h4 id="withholding-replication-attack">Withholding Replication Attack<a class="self-link" aria-label="§" href="#security-considerations"></a></h4>
<p>
It is the responsibility of consortium members to propagate any instructions to create, update or delete DID
to
other members. Failure to do so will allow them to effectively censor the DID network. This attack is out of
scope for the following reasons:
</p>
<ol>
<li>Consortium members are trusted entities that are unlikely to have an incentive to negatively impact the
system's trustworthiness by censoring it.
</li>
<li>
DID holders are free to select any of the consortium members for any DID interaction and can therefore
pick a different member should they suspect an attack.
</li>
</ol>
<h4 id="cessation-of-service">Cessation of Service<a class="self-link" aria-label="§" href="#security-considerations"></a></h4>
<p>
As DID documents are not stored on a public ledger, should all consortium members cease operation at the
same time, DID data will not be recoverable from the system.<br>
This attack is out of scope as DID holders will be able to re-establish data based on their personal copies.
</p>
</section>
<section id="privacy-considerations">
<h3 id="x2-3-privacy-considerations"><bdi class="secno">2.3 </bdi>Privacy Considerations<a class="self-link" aria-label="§" href="#privacy-considerations"></a></h3>
<p>
The Corda DID Method adheres to the <em>Privacy Considerations</em> section of the Decentralized Identifiers
Core architecture [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>].
</p>
</section>
</section>
<section id="methods">
<h2 id="x3-methods"><bdi class="secno">3. </bdi>Methods<a class="self-link" aria-label="§" href="#methods"></a></h2>
<p>
End users who aim to <em>create</em>, <em>read</em>, <em>update</em> or <em>delete</em> DID documents can do so
by interacting with a trusted node of their choosing. The API provided for interaction exposes REST endpoints
over HTTP using a JSON-based envelope format closely aligned with the JSON-LD examples found in the DID draft
community report [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>].
</p>
<p>
When users interact with consortium-member nodes, their requests will be handled by a <em>web server</em> that
transforms the requests into a <a href="https://docs.corda.net/clientrpc.html">format suitable for Corda</a>.
The web-server component runs in a process independent of Corda. User calls ‘proxied’ in this way will invoke a
<a href="https://docs.corda.net/key-concepts-flows.html">Flow</a> on one of the consortium nodes. As part of
this flow, consortium nodes will check that the ID provided by the user is valid and that the message has
cryptographic integrity (i.e., that the DID document is signed properly). Once this validation has been
successfully completed, DID documents will be replicated from the <em>trusted node</em> (i.e., the node the user
has chosen to interact with via REST) to all <em>witness nodes</em> (i.e., all other nodes in the consortium).
Witness nodes will perform a cryptographic integrity check as part of the <a href="https://docs.corda.net/key-concepts-contracts.html">contract</a> underpinning this transaction.
</p>
<section id="corda-did-format">
<h3 id="x3-1-corda-did-format"><bdi class="secno">3.1 </bdi>Corda DID Format<a class="self-link" aria-label="§" href="#corda-did-format"></a></h3>
<p>
A Corda DID specifies the <code>corda</code> method, a target network (e.g. <code>testnet</code> or <code>tcn</code>)
and a UUID formatted in the canonical string representation [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">rfc4122</a></cite>]:
</p>
<code>
did:corda:(testnet|tcn|private-[a-z]+):([0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12})
</code>
<p>
</p><table>
<tbody><tr>
<th>Target Network</th>
<th>Network Tag</th>
<th>Purpose</th>
</tr>
<tr>
<td>Testnet [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-testnet" title="Corda Testnet">corda-testnet</a></cite>]</td>
<td><code>testnet</code></td>
<td>Signifies that the document can be resolved via Testnet.</td>
</tr>
<tr>
<td>Corda Network [<cite><a class="bibref" data-link-type="biblio" href="#bib-corda-network" title="Corda Network Foundation">corda-network</a></cite>]</td>
<td><code>tcn</code></td>
<td>Signifies that the document can be resolved via the Corda Network.</td>
</tr>
<tr>
<td>Private</td>
<td><code>private-*</code></td>
<td>Signifies that the document cannot be resolved via a standard mechanism. This tag is intended for
use in private networks and in testing.
</td>
</tr>
</tbody></table>
I.e.,
<ul>
<li><code>did:corda:testnet:559d1c8f-75dd-477f-b28a-ef9d96c4e802</code></li>
<li><code>did:corda:tcn:ffe0f4ff-8740-470d-bb4c-0b642f58e0f5</code></li>
<li><code>did:corda:private-persistent:d3b91530-67f5-48b8-bf1c-e883b1fea766</code></li>
</ul>
</section>
<section id="json-over-https-api">
<h3 id="x3-2-json-over-https-api"><bdi class="secno">3.2 </bdi>JSON-over-HTTPS API<a class="self-link" aria-label="§" href="#json-over-https-api"></a></h3>
<p>
The DID API is the server component to be deployed by consortium-member nodes in conjunction with the
CorDapp. It provides method-specific APIs to <em>create</em>, <em>read</em>, <em>update</em> or
<em>delete</em> DID documents. The Corda DID method achieves proof of ownership of a <em>document</em> by
requiring proof of ownership of the <em>keys</em> contained in the document. To implement this, any DID
document must be wrapped in an envelope. This envelope must contain signatures for all private keys
associated with public keys contained in the documents (cf. <a href="#did-envelope">figure 2</a>).
</p>
<figure id="did-envelope">
<img src="did_envelope.svg" height="352" width="518">
<figcaption>Figure <bdi class="figno">2</bdi> <span class="fig-title">A DID envelope holds the document payload and signatures over the payload by relevant keys.
</span></figcaption>
</figure>
<p>
Envelopes that do not contain signatures for all public keys will be rejected. Envelopes using unsupported
cryptographic suites or unsupported serialization mechanisms will be rejected. There are <a href="#supported-encodings">restrictions</a> on which suites and serialization mechanisms can be used.
</p>
<section id="message-format">
<h4 id="x3-2-1-message-format"><bdi class="secno">3.2.1 </bdi>Message Format<a class="self-link" aria-label="§" href="#message-format"></a></h4>
<section id="instruction">
<h5 id="x3-2-1-1-instruction-data"><bdi class="secno">3.2.1.1 </bdi>Instruction data<a class="self-link" aria-label="§" href="#instruction"></a></h5>
<p>
Instruction data tell the API what to do with the document received. They also contain proof of
ownership of keys. Instruction data are formatted according to the following schema:
</p>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"definitions"</span>: {},
<span class="hljs-attr">"$schema"</span>: <span class="hljs-string">"http://json-schema.org/draft-07/schema#"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"object"</span>,
<span class="hljs-attr">"required"</span>: [
<span class="hljs-string">"action"</span>,
<span class="hljs-string">"signatures"</span>
],
<span class="hljs-attr">"properties"</span>: {
<span class="hljs-attr">"action"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/action"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"string"</span>,
<span class="hljs-attr">"enum"</span>: [
<span class="hljs-string">"create"</span>,
<span class="hljs-string">"read"</span>,
<span class="hljs-string">"update"</span>,
<span class="hljs-string">"delete"</span>
]
},
<span class="hljs-attr">"signatures"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/signatures"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"array"</span>,
<span class="hljs-attr">"items"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/signatures/items"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"object"</span>,
<span class="hljs-attr">"required"</span>: [
<span class="hljs-string">"id"</span>,
<span class="hljs-string">"type"</span>,
<span class="hljs-string">"signatureBase58"</span>
],
<span class="hljs-attr">"properties"</span>: {
<span class="hljs-attr">"id"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/signatures/items/properties/id"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"string"</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"The ID of the public key that is part of the key pair signing the document."</span>,
<span class="hljs-attr">"examples"</span>: [
<span class="hljs-string">"did:corda:testnet:3df6b0a1-6b02-4053-8900-8c36b6d35fa1#keys-1"</span>,
<span class="hljs-string">"did:corda:tcn:3df6b0a1-6b02-4053-8900-8c36b6d35fa1#keys-2"</span>
],
<span class="hljs-attr">"pattern"</span>: <span class="hljs-string">"^did:corda:(testnet|tcn|private-[a-z]+):([0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12})$"</span>
},
<span class="hljs-attr">"type"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/signatures/items/properties/type"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"string"</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"The cryptographic suite this key has been generated with. More formats (RsaSignature2018, EdDsaSASignatureSecp256k1) to follow."</span>,
<span class="hljs-attr">"enum"</span>: [
<span class="hljs-string">"Ed25519Signature2018"</span>
]
},
<span class="hljs-attr">"signatureBase58"</span>: {
<span class="hljs-attr">"$id"</span>: <span class="hljs-string">"#/properties/signatures/items/properties/signatureBase58"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"string"</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"The binary signature in Base58 representation. More formats to follow."</span>,
<span class="hljs-attr">"examples"</span>: [
<span class="hljs-string">"54CnhKVqE63rMAeM1b8CyQjL4c8teS1DoyTfZnKXRvEEGWK81YA6BAgQHRah4z1VV4aJpd2iRHCrPoNTxGXBBoFw"</span>
]
}
}
}
}
}
}</code></pre>
<section id="supported-encodings">
<h6 id="x3-2-1-1-1-supported-encodings"><bdi class="secno">3.2.1.1.1 </bdi>Supported Encodings<a class="self-link" aria-label="§" href="#supported-encodings"></a></h6>
<p>
</p><table>
<thead>
<tr>
<th>Encoding</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>signatureHex</code></td>
<td>Hex-encoded signature</td>
</tr>
<tr>
<td><code>signatureBase64</code></td>
<td>Base64-encoded signature as per [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4648" title="The Base16, Base32, and Base64 Data Encodings">rfc4648</a></cite>]</td>
</tr>
<tr>
<td><code>signatureBase58</code></td>
<td>Base58-encoded signature</td>
</tr>
<tr>
<td><code>signatureMultibase</code></td>
<td>Multibase-encoded signature [<cite><a class="bibref" data-link-type="biblio" href="#bib-multibase" title="The Multibase Data Format">multibase</a></cite>]
</td>
</tr>
</tbody>
</table>
<p></p>
</section>
</section>
<section id="examples">
<h5 id="x3-2-1-2-examples"><bdi class="secno">3.2.1.2 </bdi>Examples<a class="self-link" aria-label="§" href="#examples"></a></h5>
<section id="base58">
<h6 id="x3-2-1-2-1-base58"><bdi class="secno">3.2.1.2.1 </bdi>Base58<a class="self-link" aria-label="§" href="#base58"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"action"</span>: <span class="hljs-string">"create"</span>,
<span class="hljs-attr">"signatures"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:d51924e1-66bb-4971-ab62-ec4910a1fb98#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519Signature2018"</span>,
<span class="hljs-attr">"signatureBase58"</span>: <span class="hljs-string">"54CnhKVqE63rMAeM1b8CyQjL4c8teS1DoyTfZnKXRvEEGWK81YA6BAgQHRah4z1VV4aJpd2iRHCrPoNTxGXBBoFw"</span>
}
]
}</code></pre>
</section>
<section id="multibase">
<h6 id="x3-2-1-2-2-multibase"><bdi class="secno">3.2.1.2.2 </bdi>Multibase<a class="self-link" aria-label="§" href="#multibase"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"action"</span>: <span class="hljs-string">"create"</span>,
<span class="hljs-attr">"signatures"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:84602311-bd95-4006-968c-01a69d035d64#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519Signature2018"</span>,
<span class="hljs-attr">"signatureMultibase"</span>: <span class="hljs-string">"bb3i4jlob2pomlx5yjv5adir7r26tkor6iqroosojkqi4wq2kcjtiju3moxsrkwmobhtlega27uzuxtncks6yib6otqybfykjyzieqe"</span>
}
]
}</code></pre>
</section>
<section id="hex">
<h6 id="x3-2-1-2-3-hex"><bdi class="secno">3.2.1.2.3 </bdi>Hex<a class="self-link" aria-label="§" href="#hex"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"action"</span>: <span class="hljs-string">"create"</span>,
<span class="hljs-attr">"signatures"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:03d7411f-ae67-4c89-94b8-de802f017745#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519Signature2018"</span>,
<span class="hljs-attr">"signatureHex"</span>: <span class="hljs-string">"04242D453FA6191B67308B9454E08EC2D59524063F53F85D11E43151283DF672959B9F546CD437FACA914DD15D41F7F6B5FF0AA00ABF5EE91826C70EA83F0E03"</span>
}
]
}</code></pre>
</section>
<section id="base64">
<h6 id="x3-2-1-2-4-base64"><bdi class="secno">3.2.1.2.4 </bdi>Base64<a class="self-link" aria-label="§" href="#base64"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"action"</span>: <span class="hljs-string">"create"</span>,
<span class="hljs-attr">"signatures"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:4b78d87e-1dee-403d-89d6-d2e12926d309#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519Signature2018"</span>,
<span class="hljs-attr">"signatureBase64"</span>: <span class="hljs-string">"Kh39kEoMvzfolBimiT/6wGeTys5Leuk/M0im9CligIpRXsJnIx4STphsofZBnbX198H7AfuVp8IJYyzMwKtaAg=="</span>
}
]
}</code></pre>
</section>
</section>
</section>
</section>
<section id="http-communication">
<h3 id="x3-3-http-communication"><bdi class="secno">3.3 </bdi>HTTP Communication<a class="self-link" aria-label="§" href="#http-communication"></a></h3>
<p>Envelopes are implemented as <code>multipart/form-data</code> [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc7578" title="Returning Values from Forms: multipart/form-data">rfc7578</a></cite>] HTTP requests with two parts:</p>
<p>
</p><table>
<thead>
<tr>
<th>Part</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>instruction</code></td>
<td>JSON representation of the <a href="#instruction">instruction</a></td>
</tr>
<tr>
<td><code>document</code></td>
<td>JSON representation of the DID document [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>]</td>
</tr>
</tbody>
</table>
<p></p>
<p>This format is chosen to circumvent issues with canonical document representation for hashing.</p>
<section id="create-did">
<h4 id="x3-3-1-create-did"><bdi class="secno">3.3.1 </bdi>Create DID<a class="self-link" aria-label="§" href="#create-did"></a></h4>
<section id="request">
<h5 id="x3-3-1-1-request"><bdi class="secno">3.3.1.1 </bdi>Request<a class="self-link" aria-label="§" href="#request"></a></h5>
<p>The instruction to create a new DID is issued via a <code>PUT</code> HTTP request [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">rfc4122</a></cite>].
Proof of ownership of the document has to be presented in the envelope.</p>
<p>The payload includes:</p>
<ul>
<li>The document, consisting of the encoded public key, the type of public key and the controller of
the public key;
</li>
<li>The instruction, consisting of action to be taken (create), the encoded signature(s) in the
document and the type of signature.
</li>
</ul>
<h6 id="instruction-0">Instruction<a class="self-link" aria-label="§" href="#request"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"action"</span>: <span class="hljs-string">"create"</span>,
<span class="hljs-attr">"signatures"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519Signature2018"</span>,
<span class="hljs-attr">"signatureBase58"</span>: <span class="hljs-string">"2M12aBn5ijmmUyHtTf56NTJsUEUbpbqbAgpsvxsfMa2KrL5MR5rGb4dP37QoyRWp94kqreDMV9P4K3QHfE67ypTD"</span>
}
]
}</code></pre>
<h6 id="document">Document<a class="self-link" aria-label="§" href="#request"></a></h6>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"@context"</span>: <span class="hljs-string">"https://w3id.org/did/v1"</span>,
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5"</span>,
<span class="hljs-attr">"publicKey"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519VerificationKey2018"</span>,
<span class="hljs-attr">"controller"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5"</span>,
<span class="hljs-attr">"publicKeyBase58"</span>: <span class="hljs-string">"GfHq2tTVk9z4eXgyNRg7ikjUaaP1fuE4Ted3d6eBaYSTxq9iokAwcd16hu8v"</span>
}
]
}</code></pre>
<h6 id="request-example-curl">Request Example (cURL)<a class="self-link" aria-label="§" href="#request"></a></h6>
<pre aria-busy="false"><code class="hljs">curl -X PUT \
http://example.org/did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5 \
-H 'content-type: multipart/form-data' \
-F instruction='{
"action": "create",
"signatures": [
{
"id": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1",
"type": "Ed25519Signature2018",
"signatureBase58": "2M12aBn5ijmmUyHtTf56NTJsUEUbpbqbAgpsvxsfMa2KrL5MR5rGb4dP37QoyRWp94kqreDMV9P4K3QHfE67ypTD"
}
]
}' \
-F document'={
"@context": "https://w3id.org/did/v1",
"id": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5",
"created":"2019-07-11T10:27:27.326Z",
"publicKey": [
{
"id": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1",
"type": "Ed25519VerificationKey2018",
"controller": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5",
"publicKeyBase58": "GfHq2tTVk9z4eXgyNRg7ikjUaaP1fuE4Ted3d6eBaYSTxq9iokAwcd16hu8v"
}
]
}'</code></pre>
</section>
<section id="response">
<h5 id="x3-3-1-2-response"><bdi class="secno">3.3.1.2 </bdi>Response<a class="self-link" aria-label="§" href="#response"></a></h5>
<ul>
<li>The API will respond with status <code>204</code> for a request with a well-formed instruction
<em>and</em> a well-formed document <em>and</em> valid signature(s) <em>and</em> an unused ID.
</li>
<li>The API will respond with status <code>400</code> for a request with a deformed instruction
<em>or</em>
a deformed document <em>or</em> at least one invalid signature.
</li>
<li>The API will respond with status <code>409</code> for a request with an ID that has already been
taken.
</li>
</ul>
</section>
</section>
<section id="read-did">
<h4 id="x3-3-2-read-did"><bdi class="secno">3.3.2 </bdi>Read DID<a class="self-link" aria-label="§" href="#read-did"></a></h4>
<section id="request-0">
<h5 id="x3-3-2-1-request"><bdi class="secno">3.3.2.1 </bdi>Request<a class="self-link" aria-label="§" href="#request-0"></a></h5>
<p>A simple <code>GET</code> request [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">rfc4122</a></cite>] (specifying the ID as a fragment) is used to retrieve a
DID document. The DID document contains a list of public keys, the type of public key, information
about encodings used in these public keys and the controller of each public key.</p>
<h6 id="request-example-curl-0">Request Example (cURL)<a class="self-link" aria-label="§" href="#request-0"></a></h6>
<pre aria-busy="false"><code class="hljs javascript">curl -X GET http:<span class="hljs-comment">//example.org/did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5</span></code></pre>
</section>
<section id="response-0">
<h5 id="x3-3-2-2-response"><bdi class="secno">3.3.2.2 </bdi>Response<a class="self-link" aria-label="§" href="#response-0"></a></h5>
<pre aria-busy="false"><code class="hljs json">{
<span class="hljs-attr">"@context"</span>: <span class="hljs-string">"https://w3id.org/did/v1"</span>,
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5"</span>,
<span class="hljs-attr">"created"</span>: <span class="hljs-string">"2019-07-11T10:27:27.326Z"</span>,
<span class="hljs-attr">"publicKey"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"Ed25519VerificationKey2018"</span>,
<span class="hljs-attr">"controller"</span>: <span class="hljs-string">"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5"</span>,
<span class="hljs-attr">"publicKeyBase58"</span>: <span class="hljs-string">"GfHq2tTVk9z4eXgyNRg7ikjUaaP1fuE4Ted3d6eBaYSTxq9iokAwcd16hu8v"</span>
}
]
}</code></pre>
<ul>
<li>The API will respond with status <code>200</code> for a request with a known ID.</li>
<li>The API will respond with status <code>404</code> for a request with an unknown ID.</li>
<li>The API will respond with status <code>400</code> for a request with an ID in the incorrect
format.
</li>
</ul>
</section>
</section>
<section id="update-did">
<h4 id="x3-3-3-update-did"><bdi class="secno">3.3.3 </bdi>Update DID<a class="self-link" aria-label="§" href="#update-did"></a></h4>
<section id="request-1">
<h5 id="x3-3-3-1-request"><bdi class="secno">3.3.3.1 </bdi>Request<a class="self-link" aria-label="§" href="#request-1"></a></h5>
<p>The instruction to create a new DID is issued via a <code>POST</code> HTTP request [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">rfc4122</a></cite>].</p>
<p>
Updates use the optional created [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>] and updated [<cite><a class="bibref" data-link-type="biblio" href="#bib-did-core" title="Decentralized Identifiers (DIDs) v1.0">did-core</a></cite>] concepts to mitigate replay
attacks. This means an update will only be successful if the <code>updated</code> field <em>in the
DID document</em> is set to an instant that is later than the instant previously saved in that
field. Should no previous update be recorded, the update will only be successful if the <code>created</code>
field <em>in the document</em> is set to an instant that is later than the instant provided with the
update.
</p>
<p>
The current time is calculated by the DID owner, without verification of its accuracy by the
consortium. This is appropriate, however, since this field is only used to determine a before/after
relationship. Consumers of the DID document need to take into account that this value is potentially
inaccurate.
</p>
<p>The payload includes:</p>
<ul>
<li>
The document, consisting of the new encoded public key, the type of public key and controller of
the public key;
</li>
<li>
The instruction, consisting of action to be taken (update), encoded signature(s) in the document
using all private keys (including the one being added) associated with public keys in the
document and the type of signature.
</li>
</ul>
<h6 id="request-example-curl-1">Request Example (cURL)<a class="self-link" aria-label="§" href="#request-1"></a></h6>
<pre aria-busy="false"><code class="hljs">curl -X POST \
http://example.org/did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5 \
-H 'content-type: multipart/form-data' \
-F instruction='{
"action": "update",
"signatures": [
{
"id":"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-1",
"type":"Ed25519Signature2018",
"signatureBase58":"57HQXkem7pXpfHnP3DPTyLqSQB9NuZNj7V4hS61kbkQA28hCuYtSmFQCABj8HBX2AmDss13iDkNY2H3zqRZsYnD4"
},
{
"id":"did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-2",
"type":"Ed25519Signature2018",
"signatureBase58":"26kkhZbQLSNvEKbPvx18GRfSoVMu2bDXutvnWcQQyrGxqz5VKijkFV2GohbkbafPa2WqVad7wnyLwx1zxjvVfvSa"
}
]
}' \
-F document'={
"@context": "https://w3id.org/did/v1",
"id": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5",
"created":"2019-07-11T10:27:27.326Z",
"updated":"2019-07-11T10:29:15.116Z",
"publicKey": [
{
"id": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5#keys-2",
"type": "Ed25519VerificationKey2018",
"controller": "did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5",
"publicKeyBase58": "GfHq2tTVk9z4eXgyHhSTmTRf4NFuTv7afqFroA8QQFXKm9fJcBtMRctowK33"
}
]
}'</code></pre>
</section>
<section id="response-1">
<h5 id="x3-3-3-2-response"><bdi class="secno">3.3.3.2 </bdi>Response<a class="self-link" aria-label="§" href="#response-1"></a></h5>
<ul>
<li>The API will respond with status <code>204</code> if the update is successful.</li>
<li>The API will respond with status <code>404</code> for a request with an unknown ID.</li>
<li>The API will respond with status <code>400</code> for other cases of incorrect payload
(mismatched signatures, a malformed document, malformed instructions, etc.).
</li>
</ul>
</section>
</section>
<section id="delete-did">
<h4 id="x3-3-4-delete-did"><bdi class="secno">3.3.4 </bdi>Delete DID<a class="self-link" aria-label="§" href="#delete-did"></a></h4>
<section id="request-2">
<h5 id="x3-3-4-1-request"><bdi class="secno">3.3.4.1 </bdi>Request<a class="self-link" aria-label="§" href="#request-2"></a></h5>
<p>The instruction to create a new DID is issued via a <code>DELETE</code> HTTP request [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">rfc4122</a></cite>].</p>
<p>
This method is used to disable the identity in the ledger. Once deleted, the identity cannot be used
again. The delete function only accepts an instruction as a payload. The instruction contains
signature(s) for public key(s) for the latest DID document in the ledger.
</p>
<p>The payload includes:</p>
<ul>
<li>The instruction, consisting of action to be taken (delete), encoded signature(s) in the latest
DID document in the ledger using all private keys associated with public keys present in the
document and the type of signature.
</li>
</ul>
<p>
To validate a delete request, the user must provide signature(s) in the instruction. The
signature(s) must be over the latest DID document present in the ledger, signed with corresponding
private keys for all public keys present in the document.</p>
<h6 id="request-example-curl-2">Request Example (cURL)<a class="self-link" aria-label="§" href="#request-2"></a></h6>
<pre aria-busy="false"><code class="hljs">curl -X DELETE \
http://example.org/did:corda:tcn:a609bcc0-a3a8-11e9-b949-fb002eb572a5 \
-H 'content-type: multipart/form-data' \
-F instruction='{
"action": "delete",