---
eip: 7734
label: ERC-7734
title: Decentralized Identity Verification (DID)
status: Final
type: Standards Track
category: ERC
created: 2024-06-26
official: https://eips.ethereum.org/EIPS/eip-7734
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7734.md
canonical: https://eips.huatuo.xyz/ja/eip-7734/
lang: ja
tldr: 各アドレスが自分の身元データと検証証明のハッシュだけを保存する最小限のオンチェーン ID レジストリ。作成・検証・失効のイベントを備える。
tags: [identity, did, privacy, registry]
---

# ERC-7734: Decentralized Identity Verification (DID)

> A privacy-preserving method for decentralized identity verification, enabling secure integration of identity management in dApps.

**TL;DR:** 各アドレスが自分の身元データと検証証明のハッシュだけを保存する最小限のオンチェーン ID レジストリ。作成・検証・失効のイベントを備える。

## 何を解決するのか

多くの dApp は、ユーザーが何らかの本人確認を通過したことを知る必要があります。DeFi プールのための KYC、ゲームのための年齢確認、エアドロップのための「実在の人間」チェックなどです。中央集権的な ID プロバイダーは生の個人データを保持し、しばしば情報漏えいの標的になり、ユーザーにほとんど制御権を残しません。既存の分散型 ID の標準は、導入が重いことがあります。

ERC-7734 は、意図的に小さなインターフェースを提案します。個人データはオフチェーンに置き、暗号学的なハッシュだけをオンチェーンに保存し、イベントを発行することで、ID がいつ作成・検証・失効されたかを誰でも追跡できるようにするものです。

## 仕組み

各アドレスは 1 つの `Identity` レコードを持てます。

| フィールド | 意味 |
| --- | --- |
| `userAddress` | 所有者のアドレス（ID そのもの） |
| `identityHash` | オフチェーンの ID データのハッシュ |
| `verificationHashes` | オフチェーンの証明やアテステーションから導かれる 2 つのハッシュ |
| `isVerified` | 現在のステータス |
| `timestamp` | ID が作成された時刻 |

呼び出し元が管理できるのは自分のレコードだけです。

- `createIdentity(identityHash)` はレコードを登録し（アドレスごとに 1 回）、`IdentityCreated` を発行します。
- `verifyIdentity(bytes32[2])` は 2 つの検証ハッシュを保存し、レコードを検証済みにして、`IdentityVerified` を発行します。
- `revokeIdentity()` は `isVerified` を false に戻し、`IdentityRevoked` を発行します。
- `getIdentity(user)` は、誰でも読めるようにレコードを返します。

検証ハッシュが何を意味し、どう生成されるか（第三者によるアテステーション、署名付き文書、暗号学的チャレンジなど）は、実装者に委ねられています。氏名、年齢、その他の属性はオフチェーンに残ります。

## サンプルコード

標準のインターフェース:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IDecentralizedIdentity {
    struct Identity {
        address userAddress;
        bytes32 identityHash;
        bytes32[2] verificationHashes;
        bool isVerified;
        uint256 timestamp;
    }

    event IdentityCreated(address indexed userAddress, bytes32 identityHash, uint256 timestamp);
    event IdentityVerified(address indexed userAddress, bytes32[2] verificationHashes, uint256 timestamp);
    event IdentityRevoked(address indexed userAddress, uint256 timestamp);

    function createIdentity(bytes32 identityHash) external;
    function verifyIdentity(bytes32[2] calldata verificationHashes) external;
    function revokeIdentity() external;
    function getIdentity(address userAddress) external view returns (Identity memory);
}
```

dApp からユーザーのステータスを確認する例（ethers v6）:

```ts
import { Contract, JsonRpcProvider } from "ethers";

const abi = [
  "function getIdentity(address) view returns (tuple(address userAddress, bytes32 identityHash, bytes32[2] verificationHashes, bool isVerified, uint256 timestamp))",
];
const registry = new Contract(REGISTRY_ADDRESS, abi, new JsonRpcProvider(RPC_URL));
const id = await registry.getIdentity(user);
console.log(id.isVerified ? "verified" : "not verified");
```

## 知っておくべきこと

- ステータスは **Final** です。
- リファレンス実装では、`verifyIdentity` はユーザーが自分のレコードに対して呼び出し、外部の検証者に対するチェックは行われません。そのため `isVerified` だけでは、「所有者が証明を提出した」ことを意味するだけで、「信頼できる第三者が承認した」ことを意味しません。実際の運用では、誰が検証できるかを制限するか、dApp 側でハッシュを信頼できるアテスターと照合する必要があります。
- 仕様は、リプレイを防ぐために検証ハッシュに nonce やタイムスタンプを含めること、そして強力なハッシュ関数を使うことを推奨しています。
- エントロピーの低い個人データ（生年月日、パスポート番号）のハッシュは総当たりで破られる可能性があります。ハッシュ化する前に salt を付けてください。
- 別の、より古いオンチェーン ID のアプローチについては [ERC-1056](/eip-1056/) を、ユーザープロフィールについては [ERC-7866](/eip-7866/) を参照してください。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7734
