---
eip: 8143
label: ERC-8143
title: Smart Credential Resolution Interface
status: Draft
type: Standards Track
category: ERC
created: 2025-12-15
requires: 165, 3668
official: https://eips.ethereum.org/EIPS/eip-8143
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8143.md
canonical: https://eips.huatuo.xyz/ja/eip-8143/
lang: ja
tldr: `getCredential(key)` 1 つだけの関数を持つコントラクトインターフェース。ウォレット、アプリ、AI エージェントが、KYC、人間性の証明、評判など発行者が管理するクレデンシャルを、オンチェーンまたは CCIP-Read 経由で統一的に参照できるようにする。
tags: [identity, credentials, kyc, agents, ccip-read]
---

# ERC-8143: Smart Credential Resolution Interface

> Resolve credentials.

**TL;DR:** `getCredential(key)` 1 つだけの関数を持つコントラクトインターフェース。ウォレット、アプリ、AI エージェントが、KYC、人間性の証明、評判など発行者が管理するクレデンシャルを、オンチェーンまたは CCIP-Read 経由で統一的に参照できるようにする。

## 何を解決するのか

ユーザーに関する事実のなかには、そのユーザー自身が管理すべきでないものがあります。「この人は KYC を通過した」「このアカウントは唯一の人間に属する」「この AI エージェントの評判スコアは 95」などです。こうした記録は、ユーザーではなく第三者の**発行者**が書き込みます。

発行者は既にコントラクトからデータを公開でき、[ERC-3668](/eip-3668/)（CCIP-Read）によるオフチェーンデータも含まれます。しかし発行者ごとに公開のしかたが異なるため、クライアントは 1 つずつ手作業で対応する必要があります。ERC-8143 は最小限のインターフェースを標準化し、自律エージェントを含むあらゆるクライアントが、クレデンシャルを解決し、標準イベントを監視して新しいクレデンシャルを発見することまでできるようにします。仕様における「ユーザー」とは、人間と AI エージェントの両方を意味します。

## 仕組み

Smart Credential コントラクトは次を実装します。

- クレデンシャルを取得する `getCredential(string key) returns (bytes)`。
- クレデンシャルが設定または更新されるたびに emit される `event CredentialSet(string key)`。クライアントは事前に知らなくても新しい key を発見できます。
- [ERC-165](/eip-165/) の `supportsInterface`。インターフェース ID `0xd091187f` に対して true を返します。

この標準は、key の形式や返される bytes のエンコーディングをあえて**定めていません**。それぞれの発行者が自分で定義し、文書化します。key は [ERC-8119](/eip-8119/) のパラメータ化されたスタイル（`kyc:0xabc…`、`pop/0xabc…`）に従ってもかまいませんが、任意です。クライアントが key の形式を知らない場合は、bytes を生の UTF-8 として扱うべきです。

オフチェーンデータの場合、`getCredential` は ERC-3668 の `OffchainLookup` で revert できます。準拠するクライアントは CCIP-Read のフローに従わなければなりません。ゲートウェイから取得し、次にコントラクトのコールバックを呼びます。コールバックは、レスポンスを返す前に検証します（署名、Merkle 証明、ZK 証明など）。

## サンプルコード

インターフェースと、単純なオンチェーン発行者:

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

interface IERC8143 {
    event CredentialSet(string key);
    function getCredential(string calldata key) external view returns (bytes memory result);
}

contract SimpleIssuer is IERC8143 {
    address public immutable issuer = msg.sender;
    mapping(string => bytes) private creds;

    function setCredential(string calldata key, bytes calldata value) external {
        require(msg.sender == issuer, "not issuer");
        creds[key] = value;
        emit CredentialSet(key);
    }

    function getCredential(string calldata key) external view returns (bytes memory) {
        return creds[key];
    }

    function supportsInterface(bytes4 id) external pure returns (bool) {
        return id == 0xd091187f || id == 0x01ffc9a7; // ERC-8143, ERC-165
    }
}
```

ethers v6 でクライアントから解決する例（`enableCcipRead` が ERC-3668 の revert に従います）:

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

const c = new Contract(issuerAddr, ["function getCredential(string) view returns (bytes)"], provider);
const raw = await c.getCredential(`pop:${user}`, { enableCcipRead: true });
const [isHuman] = AbiCoder.defaultAbiCoder().decode(["bool"], raw); // format defined by issuer
```

## 知っておくべきこと

- **ステータス: Draft。** インターフェースは変更される可能性があります。
- クレデンシャルの信頼性は、発行者の信頼性を超えません。クライアントは、結果に頼る前に、どの発行者コントラクトを信頼するかを決めておくべきです。
- クレデンシャルのエンコーディングは推測できません。key ごとに発行者のドキュメントを確認してください。
- KYC の記録のような個人データをオンチェーンに置くと、永続的かつ公開になります。プライバシーを守る設計（CCIP-Read によるオフチェーン保存や、仕様が明示的にサポートを目指しているゼロ知識証明）を検討する価値があります。


---

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