@twin.org/immutable-proof-service 0.0.2-next.3 → 0.0.3-next.10

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.
@@ -63,7 +63,7 @@
63
63
  "schema": {
64
64
  "type": "string"
65
65
  },
66
- "description": "e.g. test:1234567890"
66
+ "description": "e.g. test%3A1234567890"
67
67
  }
68
68
  }
69
69
  },
@@ -165,7 +165,7 @@
165
165
  "type": "string"
166
166
  },
167
167
  "style": "simple",
168
- "example": "ais:1234567890"
168
+ "example": "immutable-proof:1234567890"
169
169
  },
170
170
  {
171
171
  "name": "accept",
@@ -189,28 +189,37 @@
189
189
  "content": {
190
190
  "application/json": {
191
191
  "schema": {
192
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
192
+ "$ref": "#/components/schemas/DidVerifiableCredential"
193
193
  },
194
194
  "examples": {
195
195
  "immutableProofGetResponseExample": {
196
196
  "value": {
197
197
  "@context": [
198
+ "https://www.w3.org/2018/credentials/v1",
198
199
  "https://schema.twindev.org/immutable-proof/",
199
200
  "https://schema.twindev.org/common/"
200
201
  ],
201
- "type": "ImmutableProof",
202
- "id": "ais:1234567890",
203
- "nodeIdentity": "node-1",
204
- "userIdentity": "user-1",
205
- "proofObjectId": "test:1234567890",
206
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
202
+ "type": [
203
+ "VerifiableCredential",
204
+ "ImmutableProof"
205
+ ],
206
+ "id": "immutable-proof:1234567890",
207
+ "credentialSubject": {
208
+ "id": "ais:1234567890",
209
+ "proofIntegrity": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y="
210
+ },
207
211
  "proof": {
208
- "@context": "https://www.w3.org/ns/credentials/v2",
209
212
  "type": "DataIntegrityProof",
210
213
  "cryptosuite": "eddsa-jcs-2022",
211
214
  "created": "2024-08-22T11:56:56.272Z",
212
215
  "proofPurpose": "assertionMethod",
213
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
216
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv...",
217
+ "verificationMethod": "did:iota:testnet:0xcb07cabaa2f23b7e53d8cdc4228efb351ebb270554d13bc382e4f94ca8d3136b#immutable-proof-assertion",
218
+ "verifiableStorageId": "verifiable-storage:1234567890",
219
+ "immutableReceipt": {
220
+ "id": "immutable-receipt:1234567890",
221
+ "type": "ImmutableReceipt"
222
+ }
214
223
  }
215
224
  }
216
225
  }
@@ -218,28 +227,37 @@
218
227
  },
219
228
  "application/ld+json": {
220
229
  "schema": {
221
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
230
+ "$ref": "#/components/schemas/DidVerifiableCredential"
222
231
  },
223
232
  "examples": {
224
233
  "immutableProofJsonLdGetResponseExample": {
225
234
  "value": {
226
235
  "@context": [
236
+ "https://www.w3.org/2018/credentials/v1",
227
237
  "https://schema.twindev.org/immutable-proof/",
228
238
  "https://schema.twindev.org/common/"
229
239
  ],
230
- "type": "ImmutableProof",
231
- "id": "ais:1234567890",
232
- "nodeIdentity": "node-1",
233
- "userIdentity": "user-1",
234
- "proofObjectId": "test:1234567890",
235
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
240
+ "type": [
241
+ "VerifiableCredential",
242
+ "ImmutableProof"
243
+ ],
244
+ "id": "immutable-proof:1234567890",
245
+ "credentialSubject": {
246
+ "id": "ais:1234567890",
247
+ "proofIntegrity": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y="
248
+ },
236
249
  "proof": {
237
- "@context": "https://www.w3.org/ns/credentials/v2",
238
250
  "type": "DataIntegrityProof",
239
251
  "cryptosuite": "eddsa-jcs-2022",
240
252
  "created": "2024-08-22T11:56:56.272Z",
241
253
  "proofPurpose": "assertionMethod",
242
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
254
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv...",
255
+ "verificationMethod": "did:iota:testnet:0xcb07cabaa2f23b7e53d8cdc4228efb351ebb270554d13bc382e4f94ca8d3136b#immutable-proof-assertion",
256
+ "verifiableStorageId": "verifiable-storage:1234567890",
257
+ "immutableReceipt": {
258
+ "id": "immutable-receipt:1234567890",
259
+ "type": "ImmutableReceipt"
260
+ }
243
261
  }
244
262
  }
245
263
  }
@@ -353,7 +371,7 @@
353
371
  "type": "string"
354
372
  },
355
373
  "style": "simple",
356
- "example": "ais:1234567890"
374
+ "example": "immutable-proof:1234567890"
357
375
  },
358
376
  {
359
377
  "name": "accept",
@@ -391,7 +409,7 @@
391
409
  "@context": "https://schema.twindev.org/immutable-proof/",
392
410
  "type": "ImmutableProofVerification",
393
411
  "verified": false,
394
- "failure": "proofTypeMismatch"
412
+ "failure": "verificationFailure"
395
413
  }
396
414
  }
397
415
  }
@@ -489,20 +507,20 @@
489
507
  "anyOf": [
490
508
  {
491
509
  "type": "string",
492
- "const": "https://www.w3.org/ns/credentials/v2"
510
+ "const": "https://w3id.org/security/data-integrity/v2"
493
511
  },
494
512
  {
495
513
  "type": "array",
496
514
  "minItems": 1,
497
- "items": {
498
- "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
499
- },
500
515
  "prefixItems": [
501
516
  {
502
517
  "type": "string",
503
- "const": "https://www.w3.org/ns/credentials/v2"
518
+ "const": "https://w3id.org/security/data-integrity/v2"
504
519
  }
505
- ]
520
+ ],
521
+ "items": {
522
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
523
+ }
506
524
  }
507
525
  ],
508
526
  "description": "JSON-LD Context."
@@ -554,12 +572,9 @@
554
572
  },
555
573
  {
556
574
  "type": "array",
557
- "items": false,
558
- "prefixItems": [
559
- {
560
- "type": "string"
561
- }
562
- ]
575
+ "items": {
576
+ "type": "string"
577
+ }
563
578
  }
564
579
  ],
565
580
  "description": "One or more security domains in which the proof is meant to be used."
@@ -571,12 +586,9 @@
571
586
  },
572
587
  {
573
588
  "type": "array",
574
- "items": false,
575
- "prefixItems": [
576
- {
577
- "type": "string"
578
- }
579
- ]
589
+ "items": {
590
+ "type": "string"
591
+ }
580
592
  }
581
593
  ],
582
594
  "description": "Provided to mitigate replay attacks on domains."
@@ -595,9 +607,47 @@
595
607
  "cryptosuite",
596
608
  "proofPurpose"
597
609
  ],
598
- "additionalProperties": false,
599
610
  "description": "Interface describing a did proof. https://www.w3.org/TR/vc-data-integrity/"
600
611
  },
612
+ "DidCredentialSchema": {
613
+ "type": "object",
614
+ "properties": {
615
+ "id": {
616
+ "type": "string",
617
+ "description": "The URI id."
618
+ },
619
+ "type": {
620
+ "type": "string",
621
+ "description": "The credential schema type."
622
+ }
623
+ },
624
+ "required": [
625
+ "id",
626
+ "type"
627
+ ],
628
+ "description": "Interface describing a DID credential schema."
629
+ },
630
+ "DidCredentialStatus": {
631
+ "type": "object",
632
+ "properties": {
633
+ "id": {
634
+ "type": "string",
635
+ "description": "The URI id."
636
+ },
637
+ "type": {
638
+ "type": "string",
639
+ "description": "The credential status type."
640
+ }
641
+ },
642
+ "required": [
643
+ "id",
644
+ "type"
645
+ ],
646
+ "additionalProperties": {
647
+ "description": "Additional properties."
648
+ },
649
+ "description": "Interface describing a DID credential status."
650
+ },
601
651
  "DidCryptoSuites": {
602
652
  "anyOf": [
603
653
  {
@@ -613,6 +663,441 @@
613
663
  ],
614
664
  "description": "The types for DID Proof crypto suites."
615
665
  },
666
+ "DidLabel": {
667
+ "type": "object",
668
+ "properties": {
669
+ "@value": {
670
+ "type": "string",
671
+ "description": "The value for the label."
672
+ },
673
+ "@language": {
674
+ "type": "string",
675
+ "description": "The language for the label."
676
+ },
677
+ "@direction": {
678
+ "type": "string",
679
+ "description": "The direction of the label."
680
+ }
681
+ },
682
+ "required": [
683
+ "@value",
684
+ "@language"
685
+ ],
686
+ "description": "Interface describing a DID Label."
687
+ },
688
+ "DidVerifiableCredential": {
689
+ "anyOf": [
690
+ {
691
+ "$ref": "#/components/schemas/DidVerifiableCredentialV1"
692
+ },
693
+ {
694
+ "$ref": "#/components/schemas/DidVerifiableCredentialV2"
695
+ }
696
+ ],
697
+ "description": "Interface describing a verifiable credential."
698
+ },
699
+ "DidVerifiableCredentialV1": {
700
+ "type": "object",
701
+ "properties": {
702
+ "id": {
703
+ "type": "string",
704
+ "description": "The identifier for the verifiable credential."
705
+ },
706
+ "type": {
707
+ "anyOf": [
708
+ {
709
+ "type": "string"
710
+ },
711
+ {
712
+ "type": "array",
713
+ "items": {
714
+ "type": "string"
715
+ }
716
+ }
717
+ ],
718
+ "description": "The types of the data stored in the verifiable credential."
719
+ },
720
+ "credentialSubject": {
721
+ "anyOf": [
722
+ {
723
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
724
+ },
725
+ {
726
+ "type": "array",
727
+ "items": {
728
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
729
+ }
730
+ }
731
+ ],
732
+ "description": "The data for the verifiable credential."
733
+ },
734
+ "credentialStatus": {
735
+ "anyOf": [
736
+ {
737
+ "$ref": "#/components/schemas/DidCredentialStatus"
738
+ },
739
+ {
740
+ "type": "array",
741
+ "items": {
742
+ "$ref": "#/components/schemas/DidCredentialStatus"
743
+ }
744
+ }
745
+ ],
746
+ "description": "Used to discover information about the current status of the verifiable credential, such as whether it is suspended or revoked."
747
+ },
748
+ "credentialSchema": {
749
+ "anyOf": [
750
+ {
751
+ "$ref": "#/components/schemas/DidCredentialSchema"
752
+ },
753
+ {
754
+ "type": "array",
755
+ "items": {
756
+ "$ref": "#/components/schemas/DidCredentialSchema"
757
+ }
758
+ }
759
+ ],
760
+ "description": "Annotate type definitions or lock them to specific versions of the vocabulary."
761
+ },
762
+ "issuer": {
763
+ "anyOf": [
764
+ {
765
+ "type": "string"
766
+ },
767
+ {
768
+ "type": "object",
769
+ "properties": {
770
+ "id": {
771
+ "type": "string"
772
+ },
773
+ "name": {
774
+ "anyOf": [
775
+ {
776
+ "type": "string"
777
+ },
778
+ {
779
+ "type": "array",
780
+ "items": {
781
+ "$ref": "#/components/schemas/DidLabel"
782
+ }
783
+ }
784
+ ]
785
+ },
786
+ "description": {
787
+ "anyOf": [
788
+ {
789
+ "type": "string"
790
+ },
791
+ {
792
+ "type": "array",
793
+ "items": {
794
+ "$ref": "#/components/schemas/DidLabel"
795
+ }
796
+ }
797
+ ]
798
+ }
799
+ },
800
+ "required": [
801
+ "id"
802
+ ]
803
+ }
804
+ ],
805
+ "description": "The issuing identity."
806
+ },
807
+ "name": {
808
+ "anyOf": [
809
+ {
810
+ "type": "string"
811
+ },
812
+ {
813
+ "type": "array",
814
+ "items": {
815
+ "$ref": "#/components/schemas/DidLabel"
816
+ }
817
+ }
818
+ ],
819
+ "description": "The name of the credential."
820
+ },
821
+ "description": {
822
+ "anyOf": [
823
+ {
824
+ "type": "string"
825
+ },
826
+ {
827
+ "type": "array",
828
+ "items": {
829
+ "$ref": "#/components/schemas/DidLabel"
830
+ }
831
+ }
832
+ ],
833
+ "description": "The description of the credential."
834
+ },
835
+ "evidence": {
836
+ "anyOf": [
837
+ {
838
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
839
+ },
840
+ {
841
+ "type": "array",
842
+ "items": {
843
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
844
+ }
845
+ }
846
+ ],
847
+ "description": "Evidence associated with the Credential."
848
+ },
849
+ "proof": {
850
+ "anyOf": [
851
+ {
852
+ "$ref": "#/components/schemas/Proof"
853
+ },
854
+ {
855
+ "type": "array",
856
+ "items": {
857
+ "$ref": "#/components/schemas/Proof"
858
+ }
859
+ }
860
+ ],
861
+ "description": "Proofs that the verifiable credential is valid. Optional if a different proof method is used, such as JWT."
862
+ },
863
+ "@context": {
864
+ "anyOf": [
865
+ {
866
+ "type": "string",
867
+ "const": "https://www.w3.org/2018/credentials/v1"
868
+ },
869
+ {
870
+ "type": "array",
871
+ "minItems": 1,
872
+ "prefixItems": [
873
+ {
874
+ "type": "string",
875
+ "const": "https://www.w3.org/2018/credentials/v1"
876
+ }
877
+ ],
878
+ "items": {
879
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
880
+ }
881
+ }
882
+ ],
883
+ "description": "The context for the verifiable credential."
884
+ },
885
+ "issuanceDate": {
886
+ "type": "string",
887
+ "description": "The date the verifiable credential was issued, depending on version validFrom might be set instead."
888
+ },
889
+ "expirationDate": {
890
+ "type": "string",
891
+ "description": "The date the verifiable credential expires, depending on version validUntil might be set instead."
892
+ }
893
+ },
894
+ "required": [
895
+ "@context",
896
+ "type"
897
+ ],
898
+ "description": "Interface describing a verifiable credential. https://www.w3.org/TR/vc-data-model-1.1"
899
+ },
900
+ "DidVerifiableCredentialV2": {
901
+ "type": "object",
902
+ "properties": {
903
+ "id": {
904
+ "type": "string",
905
+ "description": "The identifier for the verifiable credential."
906
+ },
907
+ "type": {
908
+ "anyOf": [
909
+ {
910
+ "type": "string"
911
+ },
912
+ {
913
+ "type": "array",
914
+ "items": {
915
+ "type": "string"
916
+ }
917
+ }
918
+ ],
919
+ "description": "The types of the data stored in the verifiable credential."
920
+ },
921
+ "credentialSubject": {
922
+ "anyOf": [
923
+ {
924
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
925
+ },
926
+ {
927
+ "type": "array",
928
+ "items": {
929
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
930
+ }
931
+ }
932
+ ],
933
+ "description": "The data for the verifiable credential."
934
+ },
935
+ "credentialStatus": {
936
+ "anyOf": [
937
+ {
938
+ "$ref": "#/components/schemas/DidCredentialStatus"
939
+ },
940
+ {
941
+ "type": "array",
942
+ "items": {
943
+ "$ref": "#/components/schemas/DidCredentialStatus"
944
+ }
945
+ }
946
+ ],
947
+ "description": "Used to discover information about the current status of the verifiable credential, such as whether it is suspended or revoked."
948
+ },
949
+ "credentialSchema": {
950
+ "anyOf": [
951
+ {
952
+ "$ref": "#/components/schemas/DidCredentialSchema"
953
+ },
954
+ {
955
+ "type": "array",
956
+ "items": {
957
+ "$ref": "#/components/schemas/DidCredentialSchema"
958
+ }
959
+ }
960
+ ],
961
+ "description": "Annotate type definitions or lock them to specific versions of the vocabulary."
962
+ },
963
+ "issuer": {
964
+ "anyOf": [
965
+ {
966
+ "type": "string"
967
+ },
968
+ {
969
+ "type": "object",
970
+ "properties": {
971
+ "id": {
972
+ "type": "string"
973
+ },
974
+ "name": {
975
+ "anyOf": [
976
+ {
977
+ "type": "string"
978
+ },
979
+ {
980
+ "type": "array",
981
+ "items": {
982
+ "$ref": "#/components/schemas/DidLabel"
983
+ }
984
+ }
985
+ ]
986
+ },
987
+ "description": {
988
+ "anyOf": [
989
+ {
990
+ "type": "string"
991
+ },
992
+ {
993
+ "type": "array",
994
+ "items": {
995
+ "$ref": "#/components/schemas/DidLabel"
996
+ }
997
+ }
998
+ ]
999
+ }
1000
+ },
1001
+ "required": [
1002
+ "id"
1003
+ ]
1004
+ }
1005
+ ],
1006
+ "description": "The issuing identity."
1007
+ },
1008
+ "name": {
1009
+ "anyOf": [
1010
+ {
1011
+ "type": "string"
1012
+ },
1013
+ {
1014
+ "type": "array",
1015
+ "items": {
1016
+ "$ref": "#/components/schemas/DidLabel"
1017
+ }
1018
+ }
1019
+ ],
1020
+ "description": "The name of the credential."
1021
+ },
1022
+ "description": {
1023
+ "anyOf": [
1024
+ {
1025
+ "type": "string"
1026
+ },
1027
+ {
1028
+ "type": "array",
1029
+ "items": {
1030
+ "$ref": "#/components/schemas/DidLabel"
1031
+ }
1032
+ }
1033
+ ],
1034
+ "description": "The description of the credential."
1035
+ },
1036
+ "evidence": {
1037
+ "anyOf": [
1038
+ {
1039
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1040
+ },
1041
+ {
1042
+ "type": "array",
1043
+ "items": {
1044
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1045
+ }
1046
+ }
1047
+ ],
1048
+ "description": "Evidence associated with the Credential."
1049
+ },
1050
+ "proof": {
1051
+ "anyOf": [
1052
+ {
1053
+ "$ref": "#/components/schemas/Proof"
1054
+ },
1055
+ {
1056
+ "type": "array",
1057
+ "items": {
1058
+ "$ref": "#/components/schemas/Proof"
1059
+ }
1060
+ }
1061
+ ],
1062
+ "description": "Proofs that the verifiable credential is valid. Optional if a different proof method is used, such as JWT."
1063
+ },
1064
+ "@context": {
1065
+ "anyOf": [
1066
+ {
1067
+ "type": "string",
1068
+ "const": "https://www.w3.org/ns/credentials/v2"
1069
+ },
1070
+ {
1071
+ "type": "array",
1072
+ "minItems": 1,
1073
+ "prefixItems": [
1074
+ {
1075
+ "type": "string",
1076
+ "const": "https://www.w3.org/ns/credentials/v2"
1077
+ }
1078
+ ],
1079
+ "items": {
1080
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
1081
+ }
1082
+ }
1083
+ ],
1084
+ "description": "The context for the verifiable credential."
1085
+ },
1086
+ "validFrom": {
1087
+ "type": "string",
1088
+ "description": "The date the verifiable credential is valid from."
1089
+ },
1090
+ "validUntil": {
1091
+ "type": "string",
1092
+ "description": "The date the verifiable credential is valid until."
1093
+ }
1094
+ },
1095
+ "required": [
1096
+ "@context",
1097
+ "type"
1098
+ ],
1099
+ "description": "Interface describing a verifiable credential. https://www.w3.org/TR/vc-data-model-2.0"
1100
+ },
616
1101
  "Error": {
617
1102
  "type": "object",
618
1103
  "properties": {
@@ -645,7 +1130,6 @@
645
1130
  "name",
646
1131
  "message"
647
1132
  ],
648
- "additionalProperties": false,
649
1133
  "description": "Model to describe serialized error."
650
1134
  },
651
1135
  "ImmutableProofCreateRequest": {
@@ -658,12 +1142,63 @@
658
1142
  "required": [
659
1143
  "document"
660
1144
  ],
661
- "additionalProperties": false,
662
1145
  "description": "The parameters from the body."
663
1146
  },
1147
+ "JsonWebSignature2020Proof": {
1148
+ "type": "object",
1149
+ "properties": {
1150
+ "@context": {
1151
+ "anyOf": [
1152
+ {
1153
+ "type": "string",
1154
+ "const": "https://w3id.org/security/suites/jws-2020/v1"
1155
+ },
1156
+ {
1157
+ "type": "array",
1158
+ "minItems": 1,
1159
+ "prefixItems": [
1160
+ {
1161
+ "type": "string",
1162
+ "const": "https://w3id.org/security/suites/jws-2020/v1"
1163
+ }
1164
+ ],
1165
+ "items": {
1166
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
1167
+ }
1168
+ }
1169
+ ],
1170
+ "description": "JSON-LD Context."
1171
+ },
1172
+ "type": {
1173
+ "type": "string",
1174
+ "const": "JsonWebSignature2020",
1175
+ "description": "JSON-LD Type."
1176
+ },
1177
+ "proofPurpose": {
1178
+ "type": "string",
1179
+ "description": "The reason the proof was created."
1180
+ },
1181
+ "verificationMethod": {
1182
+ "type": "string",
1183
+ "description": "The verification method of the proof."
1184
+ },
1185
+ "created": {
1186
+ "type": "string",
1187
+ "description": "The iso date of when the proof was created."
1188
+ },
1189
+ "jws": {
1190
+ "type": "string",
1191
+ "description": "The JSON Web Signature."
1192
+ }
1193
+ },
1194
+ "required": [
1195
+ "type",
1196
+ "proofPurpose"
1197
+ ],
1198
+ "description": "Interface describing a did proof in JSON Web Signature 2020 Format. https://www.w3.org/TR/vc-jws-2020/"
1199
+ },
664
1200
  "NotFoundResponse": {
665
1201
  "type": "object",
666
- "additionalProperties": false,
667
1202
  "properties": {
668
1203
  "notFoundId": {
669
1204
  "type": "string",
@@ -699,6 +1234,17 @@
699
1234
  "name"
700
1235
  ],
701
1236
  "description": "The body which contains the error."
1237
+ },
1238
+ "Proof": {
1239
+ "anyOf": [
1240
+ {
1241
+ "$ref": "#/components/schemas/DataIntegrityProof"
1242
+ },
1243
+ {
1244
+ "$ref": "#/components/schemas/JsonWebSignature2020Proof"
1245
+ }
1246
+ ],
1247
+ "description": "Interface describing a proof."
702
1248
  }
703
1249
  },
704
1250
  "securitySchemes": {