diff --git a/index.html b/index.html index 3d8521fb8..caccc2894 100644 --- a/index.html +++ b/index.html @@ -2180,6 +2180,158 @@

Status

+
+

Data Schemas

+ +

+Data schemas are useful when enforcing a specific structure on a given +collection of data. There are at least two types of data schemas that this +specification considers: +

+ + + +

+It is important to understand that data schemas serve a different purpose from +the `@context` property, which neither enforces data structure or +data syntax, nor enables the definition of arbitrary encodings to alternate +representation formats. +

+

+This specification defines the following [=property=] for the expression of a +data schema, which can be included by an [=issuer=] in +the [=verifiable credentials=] that it issues: +

+ +
+
credentialSchema
+
+

+The value of the `credentialSchema` [=property=] MUST be one or +more data schemas that provide [=verifiers=] with enough information to +determine whether the provided data conforms to the provided schema(s). Each +`credentialSchema` MUST specify its `type` (for example, +`JsonSchema`), and an `id` [=property=] +that MUST be a [=URL=] identifying the schema file. The precise contents of +each data schema is determined by the specific type definition. +

+

+If multiple schemas are present, validity is determined according to the +processing rules outlined by each associated `credentialSchema` +`type` property. +

+
+
+ +

+The `credentialSchema` [=property=] provides an opportunity to +annotate type definitions or lock them to specific versions of the vocabulary. +Authors of [=verifiable credentials=] can include a static version of their +vocabulary using `credentialSchema` that is locked to some content +integrity protection mechanism. The `credentialSchema` +[=property=] also makes it possible to perform syntactic checking on the +[=credential=] and to use [=verification=] mechanisms such as JSON Schema +[[?VC-JSON-SCHEMA]] validation. +

+ +
+{
+  "@context": [
+    "https://www.w3.org/ns/credentials/v2",
+    "https://www.w3.org/ns/credentials/examples/v2"
+  ],
+  "id": "http://university.example/credentials/3732",
+  "type": ["VerifiableCredential", "ExampleDegreeCredential", "ExamplePersonCredential"],
+  "issuer": "https://university.example/issuers/14",
+  "validFrom": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "ExampleBachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    },
+    "alumniOf": {
+      "name": "Example University"
+    }
+  },
+  "credentialSchema": [{
+    "id": "https://example.org/examples/degree.json",
+    "type": "JsonSchema"
+  },
+  {
+    "id": "https://example.org/examples/alumni.json",
+    "type": "JsonSchema"
+  }]
+}
+        
+ +

+In the example above, the [=issuer=] is specifying a +`credentialSchema`, which points to a [[?VC-JSON-SCHEMA]] file that +can be used by a [=verifier=] to determine whether the +[=verifiable credential=] is well-formed. +

+ +

+For information about linkages to JSON Schema [[?VC-JSON-SCHEMA]] or other +optional schema validation mechanisms, see the [[[VC-IMP-GUIDE]]] document. +

+ +

+Data schemas can also be used to specify mappings to other formats, such as +those used to perform zero-knowledge proofs. For more information on using the +`credentialSchema` [=property=] with zero-knowledge proofs, +see Section [[[#zero-knowledge-proofs]]]. +

+ +
+{
+  "@context": [
+    "https://www.w3.org/ns/credentials/v2",
+    "https://www.w3.org/ns/credentials/examples/v2"
+  ],
+  "id": "http://university.example/credentials/3732",
+  "type": ["VerifiableCredential", "ExampleDegreeCredential"],
+  "issuer": "https://university.example/issuers/14",
+  "validFrom": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "ExampleBachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    }
+  },
+  "credentialSchema": {
+    "id": "https://example.org/examples/degree",
+    "type": "ZkpExampleSchema2018"
+  }
+}
+        
+ +

+In the example above, the [=issuer=] is specifying a +`credentialSchema` pointing to a means of transforming the input data +into a format which can then be used by a [=verifier=] to determine whether +the proof provided with the [=verifiable credential=] is well-formed. +

+ + +
+

Securing Mechanisms

@@ -2596,158 +2748,6 @@

Presentations Including Holder Claims

-
-

Data Schemas

- -

-Data schemas are useful when enforcing a specific structure on a given -collection of data. There are at least two types of data schemas that this -specification considers: -

- - - -

-It is important to understand that data schemas serve a different purpose from -the `@context` property, which neither enforces data structure or -data syntax, nor enables the definition of arbitrary encodings to alternate -representation formats. -

-

-This specification defines the following [=property=] for the expression of a -data schema, which can be included by an [=issuer=] in -the [=verifiable credentials=] that it issues: -

- -
-
credentialSchema
-
-

-The value of the `credentialSchema` [=property=] MUST be one or -more data schemas that provide [=verifiers=] with enough information to -determine whether the provided data conforms to the provided schema(s). Each -`credentialSchema` MUST specify its `type` (for example, -`JsonSchema`), and an `id` [=property=] -that MUST be a [=URL=] identifying the schema file. The precise contents of -each data schema is determined by the specific type definition. -

-

-If multiple schemas are present, validity is determined according to the -processing rules outlined by each associated `credentialSchema` -`type` property. -

-
-
- -

-The `credentialSchema` [=property=] provides an opportunity to -annotate type definitions or lock them to specific versions of the vocabulary. -Authors of [=verifiable credentials=] can include a static version of their -vocabulary using `credentialSchema` that is locked to some content -integrity protection mechanism. The `credentialSchema` -[=property=] also makes it possible to perform syntactic checking on the -[=credential=] and to use [=verification=] mechanisms such as JSON Schema -[[?VC-JSON-SCHEMA]] validation. -

- -
-{
-  "@context": [
-    "https://www.w3.org/ns/credentials/v2",
-    "https://www.w3.org/ns/credentials/examples/v2"
-  ],
-  "id": "http://university.example/credentials/3732",
-  "type": ["VerifiableCredential", "ExampleDegreeCredential", "ExamplePersonCredential"],
-  "issuer": "https://university.example/issuers/14",
-  "validFrom": "2010-01-01T19:23:24Z",
-  "credentialSubject": {
-    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
-    "degree": {
-      "type": "ExampleBachelorDegree",
-      "name": "Bachelor of Science and Arts"
-    },
-    "alumniOf": {
-      "name": "Example University"
-    }
-  },
-  "credentialSchema": [{
-    "id": "https://example.org/examples/degree.json",
-    "type": "JsonSchema"
-  },
-  {
-    "id": "https://example.org/examples/alumni.json",
-    "type": "JsonSchema"
-  }]
-}
-        
- -

-In the example above, the [=issuer=] is specifying a -`credentialSchema`, which points to a [[?VC-JSON-SCHEMA]] file that -can be used by a [=verifier=] to determine whether the -[=verifiable credential=] is well-formed. -

- -

-For information about linkages to JSON Schema [[?VC-JSON-SCHEMA]] or other -optional schema validation mechanisms, see the [[[VC-IMP-GUIDE]]] document. -

- -

-Data schemas can also be used to specify mappings to other formats, such as -those used to perform zero-knowledge proofs. For more information on using the -`credentialSchema` [=property=] with zero-knowledge proofs, -see Section [[[#zero-knowledge-proofs]]]. -

- -
-{
-  "@context": [
-    "https://www.w3.org/ns/credentials/v2",
-    "https://www.w3.org/ns/credentials/examples/v2"
-  ],
-  "id": "http://university.example/credentials/3732",
-  "type": ["VerifiableCredential", "ExampleDegreeCredential"],
-  "issuer": "https://university.example/issuers/14",
-  "validFrom": "2010-01-01T19:23:24Z",
-  "credentialSubject": {
-    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
-    "degree": {
-      "type": "ExampleBachelorDegree",
-      "name": "Bachelor of Science and Arts"
-    }
-  },
-  "credentialSchema": {
-    "id": "https://example.org/examples/degree",
-    "type": "ZkpExampleSchema2018"
-  }
-}
-        
- -

-In the example above, the [=issuer=] is specifying a -`credentialSchema` pointing to a means of transforming the input data -into a format which can then be used by a [=verifier=] to determine whether -the proof provided with the [=verifiable credential=] is well-formed. -

- - -
-