forked from w3c-ccg/vc-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vc-http-api.yml
617 lines (616 loc) · 22.3 KB
/
vc-http-api.yml
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
openapi: 3.0.0
info:
version: "0.0.2-unstable"
title: VC HTTP API
description: This is an Experimental Open API Specification for the [VC Data Model](https://www.w3.org/TR/vc-data-model/).
license:
name: W3C Software and Document License
url: http://www.w3.org/Consortium/Legal/copyright-software.
contact:
name: GitHub Source Code
url: https://github.com/w3c-ccg/vc-http-api
tags:
- name: Issuer
description: APIs for Issuers.
- name: Verifier
description: APIs for Verifiers.
- name: Holder
description: Optional APIs for Holders.
paths:
/credentials/issue:
post:
tags:
- Issuer
summary: Issues a credential and returns it in the response body.
operationId: issueCredential
description: Issues a credential and returns it in the response body.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/IssueCredentialRequest"
description: Parameters for issuing the credential.
responses:
"201":
description: Credential successfully issued!
content:
application/json:
schema:
$ref: "#/components/schemas/IssueCredentialResponse"
"400":
description: invalid input!
"500":
description: error!
/credentials/derive:
post:
tags:
- Holder
summary: Derives a credential and returns it in the response body.
operationId: deriveCredential
description: Derives a credential and returns it in the response body.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DeriveCredentialRequest"
description: Parameters for deriving the credential.
responses:
"201":
description: Credential derived successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/DeriveCredentialResponse"
"400":
description: Invalid Request
"500":
description: Internal Error
"501":
description: Not Implemented
/credentials/status:
post:
tags:
- Issuer
summary: Updates the status of an issued credential
operationId: updateCredentialStatus
description: Updates the status of an issued credential.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateCredentialStatus"
description: Parameters for updating the status of the issued credential.
responses:
"200":
description: Credential status successfully updated
"400":
description: Bad Request
"404":
description: Credential not found
"500":
description: Internal Server Error
/presentations/prove:
post:
tags:
- Holder
summary: Proves a presentation and returns it in the response body.
operationId: provePresentation
description: Proves a presentation and returns it in the response body.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ProvePresentationRequest"
description: Parameters for proving the presentation.
responses:
"201":
description: Presentation successfully proved!
content:
application/json:
schema:
$ref: "#/components/schemas/ProvePresentationResponse"
"400":
description: invalid input!
"500":
description: error!
/credentials/verify:
post:
tags:
- Verifier
summary: Verifies a verifiableCredential and returns a verificationResult in the response body.
operationId: verifyCredential
description: Verifies a verifiableCredential and returns a verificationResult in the response body.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyCredentialRequest"
description: Parameters for verifying a verifiableCredential.
responses:
"200":
description: Verifiable Credential successfully verified!
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyCredentialResponse"
"400":
description: invalid input!
"500":
description: error!
/presentations/verify:
post:
tags:
- Verifier
summary: Verifies a Presentation with or without proofs attached and returns a verificationResult in the response body.
operationId: verifyPresentation
description: Verifies a verifiablePresentation and returns a verificationResult in the response body. Given the possibility of denial of service, buffer overflow, or other style attacks, an implementation is permitted to rate limit or restrict requests against this API endpoint to those requests that contain only a single credential with a 413 or 429 error code as appropriate.
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/VerifyPresentationRequest"
- $ref: "#/components/schemas/ProoflessVerifyPresentationRequest"
description: Parameters for verifying a verifiablePresentation.
responses:
"200":
description: Verifiable Presentation successfully verified!
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyPresentationResponse"
"400":
description: Invalid or malformed input
"413":
description: Payload too large
"429":
description: Request rate limit exceeded.
"500":
description: Internal Server Error
components:
schemas:
UpdateCredentialStatus:
type: object
description: Request for updating the status of an issued credential.
properties:
credentialId:
type: string
credentialStatus:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
example:
{
"credentialId": "urn:uuid:45a44711-e457-4fa8-9b89-69fe0287c86a",
"credentialStatus":
[{ "type": "RevocationList2020Status", "status": "0" }],
}
LinkedDataProof:
type: object
description: A JSON-LD Linked Data proof.
properties:
type:
type: string
description: Linked Data Signature Suite used to produce proof.
created:
type: string
description: Date the proof was created.
verificationMethod:
type: string
description: Verification Method used to verify proof.
proofPurpose:
type: string
description: The purpose of the proof to be used with verificationMethod.
jws:
type: string
description: Detached JSON Web Signature
example:
{
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
}
IssueCredentialOptions:
type: object
additionalProperties: false
description: Options for specifying how the LinkedDataProof is created.
properties:
verificationMethod:
type: string
description: The URI of the verificationMethod used for the proof. Default assertionMethod URI.
proofPurpose:
type: string
description: The purpose of the proof. Default 'assertionMethod'.
created:
type: string
description: The date and time of the proof (with a maximum accuracy in seconds). Default current system time.
challenge:
type: string
description: A challenge provided by the requesting party of the proof. For example 6e62f66e-67de-11eb-b490-ef3eeefa55f2
domain:
type: string
description: The intended domain of validity for the proof. For example website.example
credentialStatus:
type: object
description: The method of credential status to issue the credential including. If omitted credential status will be included.
properties:
type:
type: string
description: The type of credential status to issue the credential with
example:
{
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"created": "2020-04-02T18:48:36Z",
"domain": "revocation.example",
"challenge": "d436f0c8-fbd9-4e48-bbb2-55fc5d0920a8",
"credentialStatus": { "type": "RevocationList2020Status" },
}
PresentCredentialOptions:
type: object
additionalProperties: false
description: Options for specifying how the LinkedDataProof is created.
properties:
verificationMethod:
type: string
description: The URI of the verificationMethod used for the proof. Default assertionMethod URI.
proofPurpose:
type: string
description: The purpose of the proof. Default 'assertionMethod'.
created:
type: string
description: The date and time of the proof (with a maximum accuracy in seconds). Default current system time.
challenge:
type: string
description: A challenge provided by the requesting party of the proof. For example 6e62f66e-67de-11eb-b490-ef3eeefa55f2
domain:
type: string
description: The intended domain of validity for the proof. For example website.example
example:
{
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"created": "2020-04-02T18:48:36Z",
"domain": "example.com",
"challenge": "d436f0c8-fbd9-4e48-bbb2-55fc5d0920a8",
}
DeriveCredentialOptions:
type: object
additionalProperties: false
description: Options for specifying how the derived credential is created.
properties:
nonce:
type: string
description: An encoded nonce provided by the holder of the credential to be included into the LinkedDataProof.
example:
{
"nonce": "lEixQKDQvRecCifKl789TQj+Ii6YWDLSwn3AxR0VpPJ1QV5htod/0VCchVf1zVM0y2E=",
}
VerifyOptions:
type: object
additionalProperties: false
description: Options for specifying how the LinkedDataProof is created.
properties:
verificationMethod:
type: string
description: The URI of the verificationMethod used for the proof. Default assertionMethod URI.
proofPurpose:
type: string
description: The purpose of the proof. Default 'assertionMethod'.
created:
type: string
description: The date and time of the proof (with a maximum accuracy in seconds). Default current system time.
challenge:
type: string
description: A challenge provided by the requesting party of the proof. For example 6e62f66e-67de-11eb-b490-ef3eeefa55f2
domain:
type: string
description: The intended domain of validity for the proof. For example website.example
example:
{
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"created": "2020-04-02T18:48:36Z",
"domain": "example.com",
"challenge": "d436f0c8-fbd9-4e48-bbb2-55fc5d0920a8",
}
VerificationResult:
type: object
additionalProperties: false
description: Object summarizing a verification
properties:
checks:
type: array
description: The checks performed
items:
type: string
warnings:
type: array
description: Warnings
items:
type: string
errors:
type: array
description: Errors
items:
type: string
example: { "checks": ["proof"], "warnings": [], "errors": [] }
Issuer:
type: object
description: A JSON-LD Verifiable Credential Issuer.
oneOf:
- type: string
- type: object
properties:
id:
type: string
example:
{ "id": "did:key:z6MkjRagNiMu91DduvCvgEsqLZDVzrJzFrwahc4tXLt9DoHd" }
Credential:
type: object
description: A JSON-LD Verifiable Credential without a proof.
properties:
"@context":
type: array
description: The JSON-LD context of the credential.
items:
type: string
"id":
type: string
description: The ID of the credential.
"type":
type: array
description: The JSON-LD type of the credential.
items:
type: string
"issuer":
$ref: "#/components/schemas/Issuer"
"issuanceDate":
type: string
description: The issuanceDate
"expirationDate":
type: string
description: The expirationDate
"credentialSubject":
type: object
description: The subject
example:
{
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:example:123",
"issuanceDate": "2020-03-16T22:37:26.544Z",
"credentialSubject":
{
"id": "did:example:123",
"degree":
{
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts",
},
},
}
VerifiableCredential:
type: object
description: A JSON-LD Verifiable Credential with a proof.
allOf:
- $ref: "#/components/schemas/Credential"
- type: object
properties:
proof:
$ref: "#/components/schemas/LinkedDataProof"
example:
{
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:example:123",
"issuanceDate": "2020-03-16T22:37:26.544Z",
"credentialSubject":
{
"id": "did:example:123",
"degree":
{
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts",
},
},
"proof":
{
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
},
}
Presentation:
type: object
description: A JSON-LD Verifiable Presentation without a proof.
properties:
"@context":
type: array
description: The JSON-LD context of the presentation.
items:
type: string
"id":
type: string
description: The ID of the presentation.
"type":
type: array
description: The JSON-LD type of the presentation.
items:
type: string
"holder":
type: object
description: The holder - will be ignored if no proof is present since there is no proof of authority over the credentials
nullable: true
"verifiableCredential":
type: array
description: The Verifiable Credentials
items:
type: object
example:
{
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"holder": "did:example:123",
"type": "VerifiablePresentation",
"verifiableCredential":
[
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:example:123",
"issuanceDate": "2020-03-16T22:37:26.544Z",
"credentialSubject":
{
"id": "did:example:123",
"degree":
{
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts",
},
},
"proof":
{
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
},
],
}
VerifiablePresentation:
type: object
description: A JSON-LD Verifiable Presentation with a proof.
allOf:
- $ref: "#/components/schemas/Presentation"
- type: object
properties:
proof:
$ref: "#/components/schemas/LinkedDataProof"
example:
{
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"holder": "did:example:123",
"type": "VerifiablePresentation",
"verifiableCredential":
[
"@context":
[
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:example:123",
"issuanceDate": "2020-03-16T22:37:26.544Z",
"credentialSubject":
{
"id": "did:example:123",
"degree":
{
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts",
},
},
"proof":
{
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
},
],
"proof":
{
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
},
}
IssueCredentialRequest:
type: object
properties:
credential:
$ref: "#/components/schemas/Credential"
options:
$ref: "#/components/schemas/IssueCredentialOptions"
IssueCredentialResponse:
$ref: "#/components/schemas/VerifiableCredential"
DeriveCredentialRequest:
type: object
properties:
verifiableCredential:
$ref: "#/components/schemas/VerifiableCredential"
frame:
type: object
description: A JSON-LD frame used for selective disclosure.
options:
$ref: "#/components/schemas/DeriveCredentialOptions"
DeriveCredentialResponse:
$ref: "#/components/schemas/VerifiableCredential"
ProvePresentationRequest:
type: object
properties:
presentation:
$ref: "#/components/schemas/Presentation"
options:
$ref: "#/components/schemas/PresentCredentialOptions"
ProvePresentationResponse:
$ref: "#/components/schemas/VerifiablePresentation"
VerifyCredentialRequest:
type: object
properties:
verifiableCredential:
$ref: "#/components/schemas/VerifiableCredential"
options:
$ref: "#/components/schemas/VerifyOptions"
VerifyCredentialResponse:
$ref: "#/components/schemas/VerificationResult"
VerifyPresentationRequest:
type: object
properties:
verifiablePresentation:
$ref: "#/components/schemas/VerifiablePresentation"
options:
$ref: "#/components/schemas/VerifyOptions"
ProoflessVerifyPresentationRequest:
type: object
properties:
presentation:
$ref: "#/components/schemas/Presentation"
VerifyPresentationResponse:
$ref: "#/components/schemas/VerificationResult"