@nuggetslife/vc 0.0.30 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/Cargo.toml +11 -0
  2. package/W3C_CONFORMANCE.md +6 -5
  3. package/bench/frame_compare.mjs +203 -0
  4. package/bench/v2_internals.mjs +115 -0
  5. package/bench/vc_ops.mjs +308 -0
  6. package/interop-allowlist.json +3 -0
  7. package/interop-smoke-allowlist.json +3 -0
  8. package/package.json +8 -7
  9. package/scripts/fetch-w3c-tests.sh +8 -0
  10. package/src/jsonld.rs +211 -140
  11. package/src/ld_signatures.rs +11 -2
  12. package/test-fixtures/interop/README.md +46 -0
  13. package/test-fixtures/interop/_contexts/README.md +51 -0
  14. package/test-fixtures/interop/_contexts/bbs-bound-v1.jsonld +92 -0
  15. package/test-fixtures/interop/_contexts/citizenship-v1.jsonld +58 -0
  16. package/test-fixtures/interop/_contexts/credentials-v1.jsonld +316 -0
  17. package/test-fixtures/interop/_contexts/elm-edc-ap.jsonld +809 -0
  18. package/test-fixtures/interop/_contexts/essif-schemas-vc-2020-v1.jsonld +47 -0
  19. package/test-fixtures/interop/_contexts/identity-v2.jsonld +195 -0
  20. package/test-fixtures/interop/_contexts/nuggets-identity-v1.jsonld +175 -0
  21. package/test-fixtures/interop/_contexts/nuggets-kyb-v1.jsonld +333 -0
  22. package/test-fixtures/interop/_contexts/openbadges-v3.jsonld +445 -0
  23. package/test-fixtures/interop/_contexts/security-bbs-v1.jsonld +93 -0
  24. package/test-fixtures/interop/ebsi/diploma-elm/README.md +29 -0
  25. package/test-fixtures/interop/ebsi/diploma-elm/expected.nq +70 -0
  26. package/test-fixtures/interop/ebsi/diploma-elm/frame.jsonld +24 -0
  27. package/test-fixtures/interop/ebsi/diploma-elm/input.jsonld +444 -0
  28. package/test-fixtures/interop/ebsi/diploma-simple/README.md +19 -0
  29. package/test-fixtures/interop/ebsi/diploma-simple/expected.nq +9 -0
  30. package/test-fixtures/interop/ebsi/diploma-simple/frame.jsonld +13 -0
  31. package/test-fixtures/interop/ebsi/diploma-simple/input.jsonld +24 -0
  32. package/test-fixtures/interop/idv2/full-disclosure/README.md +9 -0
  33. package/test-fixtures/interop/idv2/full-disclosure/expected.nq +59 -0
  34. package/test-fixtures/interop/idv2/full-disclosure/frame.jsonld +9 -0
  35. package/test-fixtures/interop/idv2/full-disclosure/input.jsonld +82 -0
  36. package/test-fixtures/interop/nuggets/identity-v1/README.md +17 -0
  37. package/test-fixtures/interop/nuggets/identity-v1/expected.nq +21 -0
  38. package/test-fixtures/interop/nuggets/identity-v1/frame.jsonld +17 -0
  39. package/test-fixtures/interop/nuggets/identity-v1/input.jsonld +31 -0
  40. package/test-fixtures/interop/nuggets/kyb-v1/README.md +15 -0
  41. package/test-fixtures/interop/nuggets/kyb-v1/expected.nq +18 -0
  42. package/test-fixtures/interop/nuggets/kyb-v1/frame.jsonld +24 -0
  43. package/test-fixtures/interop/nuggets/kyb-v1/input.jsonld +60 -0
  44. package/test-fixtures/interop/openbadges-v3/basic-achievement/README.md +17 -0
  45. package/test-fixtures/interop/openbadges-v3/basic-achievement/expected.nq +12 -0
  46. package/test-fixtures/interop/openbadges-v3/basic-achievement/frame.jsonld +17 -0
  47. package/test-fixtures/interop/openbadges-v3/basic-achievement/input.jsonld +25 -0
  48. package/test-fixtures/interop/openbadges-v3/with-allowed-values/README.md +11 -0
  49. package/test-fixtures/interop/openbadges-v3/with-allowed-values/expected.nq +25 -0
  50. package/test-fixtures/interop/openbadges-v3/with-allowed-values/frame.jsonld +22 -0
  51. package/test-fixtures/interop/openbadges-v3/with-allowed-values/input.jsonld +40 -0
  52. package/test-fixtures/interop/vp/single-vc-wrap/README.md +6 -0
  53. package/test-fixtures/interop/vp/single-vc-wrap/expected.nq +7 -0
  54. package/test-fixtures/interop/vp/single-vc-wrap/frame.jsonld +17 -0
  55. package/test-fixtures/interop/vp/single-vc-wrap/input.jsonld +27 -0
  56. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/README.md +5 -0
  57. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/expected.nq +13 -0
  58. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/frame.jsonld +14 -0
  59. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/input.jsonld +29 -0
  60. package/test_interop.mjs +184 -0
  61. package/test_interop_smoke.mjs +388 -0
  62. package/test_jsonld_crossverify.mjs +8 -2
  63. package/test_w3c_conformance.mjs +80 -7
  64. package/tools/regen_expected.mjs +108 -0
  65. package/w3c-baseline.json +881 -263
  66. package/w3c-denylist.json +6 -1
@@ -0,0 +1,92 @@
1
+ {
2
+ "__url__": "https://schemas.nuggets.life/bbsBoundv1.json",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "id": "@id",
6
+ "type": "@type",
7
+ "BbsBlsHolderBoundSignature2022": {
8
+ "@id": "https://w3id.org/security#BbsBlsHolderBoundSignature2022",
9
+ "@context": {
10
+ "@version": 1.1,
11
+ "@protected": true,
12
+ "id": "@id",
13
+ "type": "@type",
14
+ "challenge": "https://w3id.org/security#challenge",
15
+ "created": {
16
+ "@id": "http://purl.org/dc/terms/created",
17
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
18
+ },
19
+ "domain": "https://w3id.org/security#domain",
20
+ "proofValue": "https://w3id.org/security#proofValue",
21
+ "nonce": "https://w3id.org/security#nonce",
22
+ "proofPurpose": {
23
+ "@id": "https://w3id.org/security#proofPurpose",
24
+ "@type": "@vocab",
25
+ "@context": {
26
+ "@version": 1.1,
27
+ "@protected": true,
28
+ "id": "@id",
29
+ "type": "@type",
30
+ "assertionMethod": {
31
+ "@id": "https://w3id.org/security#assertionMethod",
32
+ "@type": "@id",
33
+ "@container": "@set"
34
+ },
35
+ "authentication": {
36
+ "@id": "https://w3id.org/security#authenticationMethod",
37
+ "@type": "@id",
38
+ "@container": "@set"
39
+ }
40
+ }
41
+ },
42
+ "verificationMethod": {
43
+ "@id": "https://w3id.org/security#verificationMethod",
44
+ "@type": "@id"
45
+ }
46
+ }
47
+ },
48
+ "BbsBlsHolderBoundSignatureProof2022": {
49
+ "@id": "https://w3id.org/security#BbsBlsHolderBoundSignatureProof2022",
50
+ "@context": {
51
+ "@version": 1.1,
52
+ "@protected": true,
53
+ "id": "@id",
54
+ "type": "@type",
55
+ "challenge": "https://w3id.org/security#challenge",
56
+ "created": {
57
+ "@id": "http://purl.org/dc/terms/created",
58
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
59
+ },
60
+ "domain": "https://w3id.org/security#domain",
61
+ "nonce": "https://w3id.org/security#nonce",
62
+ "proofPurpose": {
63
+ "@id": "https://w3id.org/security#proofPurpose",
64
+ "@type": "@vocab",
65
+ "@context": {
66
+ "@version": 1.1,
67
+ "@protected": true,
68
+ "id": "@id",
69
+ "type": "@type",
70
+ "sec": "https://w3id.org/security#",
71
+ "assertionMethod": {
72
+ "@id": "https://w3id.org/security#assertionMethod",
73
+ "@type": "@id",
74
+ "@container": "@set"
75
+ },
76
+ "authentication": {
77
+ "@id": "https://w3id.org/security#authenticationMethod",
78
+ "@type": "@id",
79
+ "@container": "@set"
80
+ }
81
+ }
82
+ },
83
+ "proofValue": "https://w3id.org/security#proofValue",
84
+ "verificationMethod": {
85
+ "@id": "https://w3id.org/security#verificationMethod",
86
+ "@type": "@id"
87
+ }
88
+ }
89
+ },
90
+ "Bls12381G2Key2020": "https://w3id.org/security#Bls12381G2Key2020"
91
+ }
92
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "__url__": "https://w3id.org/citizenship/v1",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "@protected": true,
6
+
7
+ "name": "http://schema.org/name",
8
+ "description": "http://schema.org/description",
9
+ "identifier": "http://schema.org/identifier",
10
+ "image": { "@id": "http://schema.org/image", "@type": "@id" },
11
+
12
+ "PermanentResidentCard": {
13
+ "@id": "https://w3id.org/citizenship#PermanentResidentCard",
14
+ "@context": {
15
+ "@version": 1.1,
16
+ "@protected": true,
17
+
18
+ "id": "@id",
19
+ "type": "@type",
20
+
21
+ "description": "http://schema.org/description",
22
+ "name": "http://schema.org/name",
23
+ "identifier": "http://schema.org/identifier",
24
+ "image": { "@id": "http://schema.org/image", "@type": "@id" }
25
+ }
26
+ },
27
+
28
+ "PermanentResident": {
29
+ "@id": "https://w3id.org/citizenship#PermanentResident",
30
+ "@context": {
31
+ "@version": 1.1,
32
+ "@protected": true,
33
+
34
+ "id": "@id",
35
+ "type": "@type",
36
+
37
+ "ctzn": "https://w3id.org/citizenship#",
38
+ "schema": "http://schema.org/",
39
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
40
+
41
+ "birthCountry": "ctzn:birthCountry",
42
+ "birthDate": { "@id": "schema:birthDate", "@type": "xsd:dateTime" },
43
+ "commuterClassification": "ctzn:commuterClassification",
44
+ "familyName": "schema:familyName",
45
+ "gender": "schema:gender",
46
+ "givenName": "schema:givenName",
47
+ "lprCategory": "ctzn:lprCategory",
48
+ "lprNumber": "ctzn:lprNumber",
49
+ "residentSince": {
50
+ "@id": "ctzn:residentSince",
51
+ "@type": "xsd:dateTime"
52
+ }
53
+ }
54
+ },
55
+
56
+ "Person": "http://schema.org/Person"
57
+ }
58
+ }
@@ -0,0 +1,316 @@
1
+ {
2
+ "__url__": "https://www.w3.org/2018/credentials/v1",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "@protected": true,
6
+ "id": "@id",
7
+ "type": "@type",
8
+ "VerifiableCredential": {
9
+ "@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
10
+ "@context": {
11
+ "@version": 1.1,
12
+ "@protected": true,
13
+ "id": "@id",
14
+ "type": "@type",
15
+ "cred": "https://www.w3.org/2018/credentials#",
16
+ "sec": "https://w3id.org/security#",
17
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
18
+ "credentialSchema": {
19
+ "@id": "cred:credentialSchema",
20
+ "@type": "@id",
21
+ "@context": {
22
+ "@version": 1.1,
23
+ "@protected": true,
24
+ "id": "@id",
25
+ "type": "@type",
26
+ "cred": "https://www.w3.org/2018/credentials#",
27
+ "JsonSchemaValidator2018": "cred:JsonSchemaValidator2018"
28
+ }
29
+ },
30
+ "credentialStatus": {
31
+ "@id": "cred:credentialStatus",
32
+ "@type": "@id"
33
+ },
34
+ "credentialSubject": {
35
+ "@id": "cred:credentialSubject",
36
+ "@type": "@id"
37
+ },
38
+ "evidence": {
39
+ "@id": "cred:evidence",
40
+ "@type": "@id"
41
+ },
42
+ "expirationDate": {
43
+ "@id": "cred:expirationDate",
44
+ "@type": "xsd:dateTime"
45
+ },
46
+ "holder": {
47
+ "@id": "cred:holder",
48
+ "@type": "@id"
49
+ },
50
+ "issued": {
51
+ "@id": "cred:issued",
52
+ "@type": "xsd:dateTime"
53
+ },
54
+ "issuer": {
55
+ "@id": "cred:issuer",
56
+ "@type": "@id"
57
+ },
58
+ "issuanceDate": {
59
+ "@id": "cred:issuanceDate",
60
+ "@type": "xsd:dateTime"
61
+ },
62
+ "proof": {
63
+ "@id": "sec:proof",
64
+ "@type": "@id",
65
+ "@container": "@graph"
66
+ },
67
+ "refreshService": {
68
+ "@id": "cred:refreshService",
69
+ "@type": "@id",
70
+ "@context": {
71
+ "@version": 1.1,
72
+ "@protected": true,
73
+ "id": "@id",
74
+ "type": "@type",
75
+ "cred": "https://www.w3.org/2018/credentials#",
76
+ "ManualRefreshService2018": "cred:ManualRefreshService2018"
77
+ }
78
+ },
79
+ "termsOfUse": {
80
+ "@id": "cred:termsOfUse",
81
+ "@type": "@id"
82
+ },
83
+ "validFrom": {
84
+ "@id": "cred:validFrom",
85
+ "@type": "xsd:dateTime"
86
+ },
87
+ "validUntil": {
88
+ "@id": "cred:validUntil",
89
+ "@type": "xsd:dateTime"
90
+ }
91
+ }
92
+ },
93
+ "VerifiablePresentation": {
94
+ "@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
95
+ "@context": {
96
+ "@version": 1.1,
97
+ "@protected": true,
98
+ "id": "@id",
99
+ "type": "@type",
100
+ "cred": "https://www.w3.org/2018/credentials#",
101
+ "sec": "https://w3id.org/security#",
102
+ "holder": {
103
+ "@id": "cred:holder",
104
+ "@type": "@id"
105
+ },
106
+ "proof": {
107
+ "@id": "sec:proof",
108
+ "@type": "@id",
109
+ "@container": "@graph"
110
+ },
111
+ "verifiableCredential": {
112
+ "@id": "cred:verifiableCredential",
113
+ "@type": "@id",
114
+ "@container": "@graph"
115
+ }
116
+ }
117
+ },
118
+ "EcdsaSecp256k1Signature2019": {
119
+ "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019",
120
+ "@context": {
121
+ "@version": 1.1,
122
+ "@protected": true,
123
+ "id": "@id",
124
+ "type": "@type",
125
+ "sec": "https://w3id.org/security#",
126
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
127
+ "challenge": "sec:challenge",
128
+ "created": {
129
+ "@id": "http://purl.org/dc/terms/created",
130
+ "@type": "xsd:dateTime"
131
+ },
132
+ "domain": "sec:domain",
133
+ "expires": {
134
+ "@id": "sec:expiration",
135
+ "@type": "xsd:dateTime"
136
+ },
137
+ "jws": "sec:jws",
138
+ "nonce": "sec:nonce",
139
+ "proofPurpose": {
140
+ "@id": "sec:proofPurpose",
141
+ "@type": "@vocab",
142
+ "@context": {
143
+ "@version": 1.1,
144
+ "@protected": true,
145
+ "id": "@id",
146
+ "type": "@type",
147
+ "sec": "https://w3id.org/security#",
148
+ "assertionMethod": {
149
+ "@id": "sec:assertionMethod",
150
+ "@type": "@id",
151
+ "@container": "@set"
152
+ },
153
+ "authentication": {
154
+ "@id": "sec:authenticationMethod",
155
+ "@type": "@id",
156
+ "@container": "@set"
157
+ }
158
+ }
159
+ },
160
+ "proofValue": "sec:proofValue",
161
+ "verificationMethod": {
162
+ "@id": "sec:verificationMethod",
163
+ "@type": "@id"
164
+ }
165
+ }
166
+ },
167
+ "EcdsaSecp256r1Signature2019": {
168
+ "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019",
169
+ "@context": {
170
+ "@version": 1.1,
171
+ "@protected": true,
172
+ "id": "@id",
173
+ "type": "@type",
174
+ "sec": "https://w3id.org/security#",
175
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
176
+ "challenge": "sec:challenge",
177
+ "created": {
178
+ "@id": "http://purl.org/dc/terms/created",
179
+ "@type": "xsd:dateTime"
180
+ },
181
+ "domain": "sec:domain",
182
+ "expires": {
183
+ "@id": "sec:expiration",
184
+ "@type": "xsd:dateTime"
185
+ },
186
+ "jws": "sec:jws",
187
+ "nonce": "sec:nonce",
188
+ "proofPurpose": {
189
+ "@id": "sec:proofPurpose",
190
+ "@type": "@vocab",
191
+ "@context": {
192
+ "@version": 1.1,
193
+ "@protected": true,
194
+ "id": "@id",
195
+ "type": "@type",
196
+ "sec": "https://w3id.org/security#",
197
+ "assertionMethod": {
198
+ "@id": "sec:assertionMethod",
199
+ "@type": "@id",
200
+ "@container": "@set"
201
+ },
202
+ "authentication": {
203
+ "@id": "sec:authenticationMethod",
204
+ "@type": "@id",
205
+ "@container": "@set"
206
+ }
207
+ }
208
+ },
209
+ "proofValue": "sec:proofValue",
210
+ "verificationMethod": {
211
+ "@id": "sec:verificationMethod",
212
+ "@type": "@id"
213
+ }
214
+ }
215
+ },
216
+ "Ed25519Signature2018": {
217
+ "@id": "https://w3id.org/security#Ed25519Signature2018",
218
+ "@context": {
219
+ "@version": 1.1,
220
+ "@protected": true,
221
+ "id": "@id",
222
+ "type": "@type",
223
+ "sec": "https://w3id.org/security#",
224
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
225
+ "challenge": "sec:challenge",
226
+ "created": {
227
+ "@id": "http://purl.org/dc/terms/created",
228
+ "@type": "xsd:dateTime"
229
+ },
230
+ "domain": "sec:domain",
231
+ "expires": {
232
+ "@id": "sec:expiration",
233
+ "@type": "xsd:dateTime"
234
+ },
235
+ "jws": "sec:jws",
236
+ "nonce": "sec:nonce",
237
+ "proofPurpose": {
238
+ "@id": "sec:proofPurpose",
239
+ "@type": "@vocab",
240
+ "@context": {
241
+ "@version": 1.1,
242
+ "@protected": true,
243
+ "id": "@id",
244
+ "type": "@type",
245
+ "sec": "https://w3id.org/security#",
246
+ "assertionMethod": {
247
+ "@id": "sec:assertionMethod",
248
+ "@type": "@id",
249
+ "@container": "@set"
250
+ },
251
+ "authentication": {
252
+ "@id": "sec:authenticationMethod",
253
+ "@type": "@id",
254
+ "@container": "@set"
255
+ }
256
+ }
257
+ },
258
+ "proofValue": "sec:proofValue",
259
+ "verificationMethod": {
260
+ "@id": "sec:verificationMethod",
261
+ "@type": "@id"
262
+ }
263
+ }
264
+ },
265
+ "RsaSignature2018": {
266
+ "@id": "https://w3id.org/security#RsaSignature2018",
267
+ "@context": {
268
+ "@version": 1.1,
269
+ "@protected": true,
270
+ "challenge": "sec:challenge",
271
+ "created": {
272
+ "@id": "http://purl.org/dc/terms/created",
273
+ "@type": "xsd:dateTime"
274
+ },
275
+ "domain": "sec:domain",
276
+ "expires": {
277
+ "@id": "sec:expiration",
278
+ "@type": "xsd:dateTime"
279
+ },
280
+ "jws": "sec:jws",
281
+ "nonce": "sec:nonce",
282
+ "proofPurpose": {
283
+ "@id": "sec:proofPurpose",
284
+ "@type": "@vocab",
285
+ "@context": {
286
+ "@version": 1.1,
287
+ "@protected": true,
288
+ "id": "@id",
289
+ "type": "@type",
290
+ "sec": "https://w3id.org/security#",
291
+ "assertionMethod": {
292
+ "@id": "sec:assertionMethod",
293
+ "@type": "@id",
294
+ "@container": "@set"
295
+ },
296
+ "authentication": {
297
+ "@id": "sec:authenticationMethod",
298
+ "@type": "@id",
299
+ "@container": "@set"
300
+ }
301
+ }
302
+ },
303
+ "proofValue": "sec:proofValue",
304
+ "verificationMethod": {
305
+ "@id": "sec:verificationMethod",
306
+ "@type": "@id"
307
+ }
308
+ }
309
+ },
310
+ "proof": {
311
+ "@id": "https://w3id.org/security#proof",
312
+ "@type": "@id",
313
+ "@container": "@graph"
314
+ }
315
+ }
316
+ }