2024年6月24日月曜日

W3C Verifiable Credentials Overviewを読む(5)

こんにちは、富士榮です。


続けてW3C Verifiable Credentials Overviewを読んでいきます。

  1. Introduction
  2. Ecosystem Overview
  3. Verifiable Credentials Data Model
  4. Securing Credentials
  5. Bitstring Status List
  6. Additional Publications
今回は3つ目のVerifiable Credentials Data Modelの続きのシリアライズの部分です。

2. Serialization in JSON

In the [VC-DATA-MODEL-2.0] specification, as in the other documents, Verifiable Credentials and Presentations are mostly expressed in JSON [RFC7519], more specifically [JSON-LD11]. In this serialization, properties of claims are represented as JSON names, and values as JSON literals or objects. Subjects of claims are either explicitly identified by an id property, or implicitly by appearing as an object of another claim. 
Standard properties defined by the [VC-DATA-MODEL-2.0] form a distinct set of JSON names, referred to as a (standard) vocabulary. An important characteristics of Verifiable Credentials in JSON-LD is that it favors a decentralized and permissionless approach to extend to a new application area through application-specific set of properties, i.e., vocabularies, distributed on the Web. Anyone can "publish" such a vocabulary, following some rules described in the extensibility section of the specification.

[VC-DATA-MODEL-2.0]仕様では、他の文書と同様に、検証可能な資格情報とプレゼンテーションは、主にJSON [RFC7519]、より具体的には[JSON-LD11]で表現されます。このシリアライズでは、クレームのプロパティはJSON名として、値はJSONリテラルまたはオブジェクトとして表現されます。クレームのサブジェクトは、idプロパティで明示的に識別されるか、別のクレームのオブジェクトとして表示されることで暗黙的に識別されます。

[VC-DATA-MODEL-2.0]で定義された標準プロパティは、JSON名として一意のセットを形成し、(標準)語彙と呼ばれます。JSON-LDにおける検証可能なクレデンシャルの重要な特性は、分散型で許可不要のアプローチを推奨し、Web上に分散されたアプリケーション固有のプロパティセット、すなわち語彙を通じて、新しいアプリケーション領域への拡張を可能にすることです。仕様書の拡張性セクションに記載されているいくつかのルールに従うことで、誰もがこのような語彙を「公開」することができます。

重要な点はW3C Verifiable Credentials Data Model 2.0においてはVerifiable CredentialsやVerifiable PresentationはJSON-LDによって表現される、ということですね。VCDM1.1まではJSONシリアライゼーションについても許容していましたが、SD-JWT-VCがIETFで策定が進められることになったことを受けW3C側ではJSON-LD+Data Integrity Proofに振り切った、ということですね。標準が割れるのはうーん、、ですね。今後どうやって棲み分けていくのかは要注目です。

The following JSON-LD code is an example for a simple Credential. It states that the person named "Pat", identified by https://www.exampl.org/persons/pat, is an alumni of the Example University (identified by did:example:c276e12ec21ebfeb1f712ebc6f1). The Credential is valid from the 1st of January 2010, and is issued by an entity identified by did:example:2g55q912ec3476eba2l9812ecbfe. Most of the properties in the Credential are from the standard Verifiable Credentials vocabulary, but some terms (like alumniOf, AlumniCredential) are added by the application-specific vocabulary referred to by https://www.example.org/vocabs/alumni.

以下の JSON-LD コードは、シンプルなクレデンシャルの例です。https://www.exampl.org/persons/pat で識別される「Pat」という人物が、Example University の卒業生(did:example:c276e12ec21ebfeb1f712ebc6f1 で識別)であることを示しています。この資格情報は2010年1月1日より有効であり、did:example:2g55q912ec3476eba2l9812ecbfeで識別されるエンティティによって発行されたものである。クレデンシャルのプロパティのほとんどは、標準の検証可能なクレデンシャル用語集に由来しますが、一部の用語(alumniOf、AlumniCredentialなど)は、https://www.example.org/vocabs/alumniで参照されているアプリケーション固有の用語集に追加されています。

EXAMPLE 1: A Simple Credential
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://www.example.org/vocabs/alumni"
  ],
  "id": "https://university.example/Credential123",
  "type": ["VerifiableCredential", "ExampleAlumniCredential"],
  "issuer": "did:example:2g55q912ec3476eba2l9812ecbfe",
  "validFrom": "2010-01-01T00:00:00Z",
  "credentialSubject": {
    "id": "https://www.example.org/persons/pat",
    "name": "Pat",
    "alumniOf": {
      "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
      "name": "Example University"
    }
  }
}

Figure 6 shows the same Credential, but represented as a graph of claims, as described in 3.1.1 Claims, Properties.

図6は、3.1.1節「クレーム、プロパティ」で説明されているように、同じクレデンシャルをクレームのグラフとして表したものです。

図6. Credential in Example 1 represented as a collection of claims.

 

Note
The Credential in Example 1 is used throughout this document to show how to apply additional features defined by the various specifications.

例 1 の「Credential」は、この文書全体を通して、さまざまな仕様で定義された追加機能の使用方法を示すために使用されています。

The Credential in Example 1, issued by Example University, is stored by a holder (who may be a person, a digital wallet, or any other entity). On request, the holder may "present" a Credential to a verifier, encapsulated in a Verifiable Presentation. This is how the result may look like in the JSON-LD serialization:

例 1 のクレデンシャルは、例大学が発行したもので、保有者(人、デジタルウォレット、またはその他のエンティティ)によって保管されます。要求に応じて、保有者は検証者に「提示」することができます。これは、検証可能なプレゼンテーションにカプセル化されています。JSON-LD シリアライズでは、結果は次のようになります。

EXAMPLE 2: Presenting the Credential
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://www.example.org/vocabs/alumni"
  ],
  "type": "VerifiablePresentation",
  "id": "urn:uuid:313801ba-24b7-11ee-be02-ff560265cf9b",
  "holder": "did:example:12345678",
  "validUntil": "2020-12-31T00:00:00Z"
  "verifiableCredential": {
    "id": "https://university.example/Credential123",
    "type": ["VerifiableCredential", "ExampleAlumniCredential"],
    "issuer": "did:example:2g55q912ec3476eba2l9812ecbfe",
    "validFrom": "2010-01-01T00:00:00Z",
    "credentialSubject": {
      "id": "https://www.example.org/persons/pat",
      "name": "Pat",
      "alumniOf": {
        "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
        "name": "Example University"
      }
    }
  }
}

 

Note that the holder could have presented several Credentials within the same presentation or create a new Credential by either combining it with others, or removing some claims as irrelevant for the specific context.

保有者は、同じプレゼンテーションの中で複数のクレデンシャルを提出することも、他のクレデンシャルと組み合わせたり、特定の状況では無関係なクレームを削除したりして、新しいクレデンシャルを作成することもできることに留意してください。 


後半はコードサンプルですね。

次回は3.3. Checking Structure with JSON Schemasをみていこうと思います。 

 


 

 

 


0 件のコメント: