DID: Decentralized Identifiers(分散型識別子)
DID(Decentralized Identifier)は、中央集権的な登録機関に依存しない新しい識別子の仕様です。このドキュメントでは、DID の概念と仕組みを解説します。
第1部: 概要編
DID とは何か?
DID は、分散型で検証可能な識別子です。従来の識別子(メールアドレス、電話番号など)とは異なり、発行者に依存せず、本人が管理できます。
従来の識別子:
メールアドレス: user@gmail.com
└── Google が管理・発行
└── Google がサービスを停止すると使えなくなる
└── Google が利用規約で禁止すると使えなくなる
電話番号: 090-1234-5678
└── 通信キャリアが管理・発行
└── MNP で変更可能だが、キャリアへの依存は残る
DID:
did:example:123456789abcdefghi
└── 本人が生成・管理
└── 特定の事業者に依存しない
└── 暗号技術で本人を証明可能
なぜ DID が必要なのか?
| 課題 | 従来の識別子 | DID |
|---|---|---|
| 所有権 | 発行者が所有 | 本人が所有 |
| 可搬性 | サービス間で移行困難 | どこでも使用可能 |
| プライバシー | 追跡されやすい | 用途別に複数作成可能 |
| 検証 | 発行者に問い合わせ必要 | 暗号技術で自己証明 |
| 永続性 | 発行者次第 | 分散台帳等で永続化 |
DID の構造
did:example:123456789abcdefghi
─┬─ ───┬─── ───── ───┬────────
│ │ │
│ │ └── DID 固有識別子
│ │ (Method-Specific Identifier)
│ │
│ └── DID メソッド
│ (どのシステムで管理するか)
│
└── スキーム(常に "did")
第2部: 詳細編
DID Document
DID を解決すると、DID Document が返されます。これは DID に関連付けられたメタデータを含む JSON-LD ドキュメントです。
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "did:example:123456789abcdefghi",
"authentication": [{
"id": "did:example:123456789abcdefghi#keys-1",
"type": "Ed25519VerificationKey2020",
"controller": "did:example:123456789abcdefghi",
"publicKeyMultibase": "zH3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
}],
"assertionMethod": [{
"id": "did:example:123456789abcdefghi#keys-2",
"type": "Ed25519VerificationKey2020",
"controller": "did:example:123456789abcdefghi",
"publicKeyMultibase": "z4BWwfeqdp1obQptLLMvPNgBw48p7og1ie6Hf9p5nTpNN"
}],
"service": [{
"id": "did:example:123456789abcdefghi#service-1",
"type": "LinkedDomains",
"serviceEndpoint": "https://example.com"
}]
}
DID Document の主要セクション
| セクション | 説明 |
|---|---|
id | DID 自身 |
controller | この DID Document を管理できる DID |
verificationMethod | 公開鍵のリスト |
authentication | 認証に使用できる鍵 |
assertionMethod | 署名(主張)に使用できる鍵 |
keyAgreement | 鍵交換に使用できる鍵 |
capabilityInvocation | 権限実行に使用できる鍵 |
capabilityDelegation | 権限委譲に使用できる鍵 |
service | サービスエンドポイント |
Verification Method(検証メソッド)
DID に関連付けられた公開鍵を定義します。
{
"verificationMethod": [{
"id": "did:example:123#key-1",
"type": "JsonWebKey2020",
"controller": "did:example:123",
"publicKeyJwk": {
"kty": "EC",
"crv": "P-256",
"x": "WKn-ZIGevcwGFOMJ0GeEei2Rew...",
"y": "y77t-RvAHRKTsSGdIYUfweuOvw..."
}
}]
}
Verification Relationships(検証関係)
公開鍵の用途を定義します。
┌────────────────────────────────────────────────────── ───────┐
│ Verification Method │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ id: "did:example:123#key-1" │ │
│ │ type: "Ed25519VerificationKey2020" │ │
│ │ publicKeyMultibase: "z..." │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│authentication │ │assertionMethod│ │ keyAgreement │
│ │ │ │ │ │
│ 認証用 │ │ 署名用 │ │ 暗号化用 │
│ (ログイン等) │ │ (VC発行等) │ │ (鍵交換) │
└───────────────┘ └───────────────┘ └───────────────┘