From 3d360b71bf2c5ad0d54600f73d276815086388fc Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Sun, 12 Feb 2023 21:07:49 -0500 Subject: [PATCH 1/5] Add initial section on Rendering. --- index.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.html b/index.html index 9f24e75d6..65f649198 100644 --- a/index.html +++ b/index.html @@ -2645,6 +2645,22 @@

Refreshing

+
+

Rendering

+ +

+Rendering hints can be used when the issuer has a specific way that +they want to express a verifiable credential to an observer through +a visual, auditory, or haptic mechanism. For example, an issuer of an +employee badge credential might want to include rich imagery of their corporate +logo and specific placement of employee information in specific areas of the +badge. They might also want to provide an audio read out of the important +aspects of the badge for individuals that have accessibility needs related +to their eyesight. +

+ +
+

Terms of Use

From 17e07ef294ae649bc9e3a35a6f70a8da6b163c05 Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Sun, 12 Feb 2023 21:40:40 -0500 Subject: [PATCH 2/5] Add SvgRenderingTemplate2023 data model and example. --- index.html | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/index.html b/index.html index 65f649198..02d89a373 100644 --- a/index.html +++ b/index.html @@ -2659,6 +2659,104 @@

Rendering

to their eyesight.

+
+
render
+
+The value of the render property MUST specify one or +more rendering hints that can be used by software to express the +verifiable credential using a visual, auditory, or haptic mechanism. +Each render value MUST specify its type, for example, +SvgRenderingTemplate2023. The precise contents of each +rendering hint is determined by the specific render type +definition. +
+
+ +
+

SvgRenderingTemplate2023

+ +

+When an issuer desires to specify SVG rendering instructions for a +verifiable credential, they MAY add a `render` property that uses the +data model described below. +

+ + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
id +A URL that dereferences to an SVG image [[SVG]] with an associated +`image/svg+xml` media type. +
type +The type property MUST be SvgRenderingTemplate2023. +
digestMultibase +An optional multibase-encoded multihash of the SVG image. The multibase value +MUST be `z` and the multihash value MUST be SHA-2 with 256-bits of output +(`0x12`). +

+The Working Group is seeking feedback related to the mechanism used to express +the cryptographic hash of the SVG image. This property is a placeholder for that +discussion and is not meant to imply a final decision related to the way this +will be done if the feature is accepted in the future. +

+
+ +

+The data model shown above is expressed in a verifiable credential +in the example below. +

+ +
+{
+  "@context": [
+    "https://www.w3.org/ns/credentials/v2",
+    "https://www.w3.org/ns/credentials/examples/v2"
+  ],
+  "id": "http://example.edu/credentials/3732",
+  "type": ["VerifiableCredential", "UniversityDegreeCredential"],
+  "issuer": "https://example.edu/issuers/14",
+  "validFrom": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "BachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    }
+  },
+  "render": [{
+    "id": "https://example.edu/credentials/BachelorDegree.svg",
+    "type": "SvgRenderingTemplate2023",
+    "digestMultibase": "zQmAPdhyxzznFCwYxAp2dRerWC85Wg6wFl9G270iEu5h6JqW"
+  }]
+  
+}
+        
+ +

+In the example above, the issuer has provided an SVG rendering template +for a bachelor's degree that will be filled in with the information in the +verifiable credential. +

+
From 98beb6de361004a06c88ccfd9da26bd691c92805 Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Sun, 12 Feb 2023 22:14:47 -0500 Subject: [PATCH 3/5] Add SvgRenderingTemplate2023 algorithm. --- index.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/index.html b/index.html index 02d89a373..a855cf886 100644 --- a/index.html +++ b/index.html @@ -144,6 +144,18 @@ -moz-user-select: none; -ms-user-select: none; user-select: none; +} +ol.algorithm { + counter-reset: numsection; + list-style-type: none; +} +ol.algorithm li { + margin: 0.5em 0; +} +ol.algorithm li:before { + font-weight: bold; + counter-increment: numsection; + content: counters(numsection, ".") ") "; } @@ -2756,6 +2768,42 @@

SvgRenderingTemplate2023

for a bachelor's degree that will be filled in with the information in the verifiable credential.

+ +
+
SvgRenderingTemplate2023 Algorithm
+ +

+The following algorithm is used to transform the SVG image template into the +final SVG image that is displayed. The inputs to the algorithm are the +verifiable credential (`verifiableCredential`) and the SVG image +source code (`svgImage`). The output is a SVG image. +

+ +
    +
  1. +Generate a map, `replacementMap`, by finding all strings in `svgImage` that +start with `{{` (double open parenthesis) and end with `}}` +(double close parenthesis). For each string, `templateKey`, that is found: +
      +
    1. +Generate another string, `templateValue`, by evaluating the value of +`templateKey` (without the opening or closing parenthesis) using the JSON +Pointer [[RFC6901]] algorithm with the `verifiableCredential` as input to the +algorithm. If the evaluation is `null`, set `templateValue` to the empty string. +
    2. +
    3. +Set a key in `replacementMap` by using `templateKey` and associate it with +`templateValue`. +
    4. +
    +
  2. +
  3. +For every key in `replacementMap`, replace each corresponding +string in `svgImage` that matches the key with the associated value in the +`replacementMap`. +
  4. +
+
From e97f7fa8bfe2354cb84a5697ac727117da458179 Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Sun, 12 Feb 2023 22:28:47 -0500 Subject: [PATCH 4/5] Add that rendering is a feature at risk. --- index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.html b/index.html index a855cf886..a07938f47 100644 --- a/index.html +++ b/index.html @@ -2660,6 +2660,14 @@

Refreshing

Rendering

+

+The rendering feature might not be included in the final version 2.0 +specification and is thus considered a feature at risk. It is unknown at this +time if there will be enough implementations for the feature. The Working +Group is seeking implementer feedback on whether or not they see this +feature as worth keeping in the final version 2.0 specification. +

+

Rendering hints can be used when the issuer has a specific way that they want to express a verifiable credential to an observer through From ee96f984938ecca5d5a538245ba0434da6097614 Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Fri, 17 Feb 2023 05:02:42 -0500 Subject: [PATCH 5/5] Fix parenthesis language to braces language. Co-authored-by: Ted Thibodeau Jr --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index a07938f47..8a58868ff 100644 --- a/index.html +++ b/index.html @@ -2790,12 +2790,12 @@

SvgRenderingTemplate2023 Algorithm
  1. Generate a map, `replacementMap`, by finding all strings in `svgImage` that -start with `{{` (double open parenthesis) and end with `}}` -(double close parenthesis). For each string, `templateKey`, that is found: +start with `{{` (double open braces) and end with `}}` +(double close braces). For each string, `templateKey`, that is found:
    1. Generate another string, `templateValue`, by evaluating the value of -`templateKey` (without the opening or closing parenthesis) using the JSON +`templateKey` (without the opening or closing braces) using the JSON Pointer [[RFC6901]] algorithm with the `verifiableCredential` as input to the algorithm. If the evaluation is `null`, set `templateValue` to the empty string.