---
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/eip-8143/
lang: en
tldr: A one-function contract interface, `getCredential(key)`, that lets wallets, apps and AI agents look up issuer-controlled credentials such as KYC, proof of personhood or reputation in a uniform way, onchain or via CCIP-Read.
tags: [identity, credentials, kyc, agents, ccip-read]
---

# ERC-8143: Smart Credential Resolution Interface

> Resolve credentials.

**TL;DR:** A one-function contract interface, `getCredential(key)`, that lets wallets, apps and AI agents look up issuer-controlled credentials such as KYC, proof of personhood or reputation in a uniform way, onchain or via CCIP-Read.

## What problem does it solve?

Some facts about a user should not be under that user's control: "this person passed KYC", "this account belongs to a unique human", "this AI agent has a reputation score of 95". Such records are written by a third-party **issuer**, not by the user.

Issuers can already publish data from contracts, including offchain data via [ERC-3668](/eip-3668/) (CCIP-Read). But every issuer exposes it differently, so a client has to integrate each one by hand. ERC-8143 standardizes a minimal interface so that any client, including an autonomous agent, can resolve credentials and even discover new ones by watching a standard event. In the spec, "users" means both humans and AI agents.

## How it works

A Smart Credential contract implements:

- `getCredential(string key) returns (bytes)` to fetch a credential.
- `event CredentialSet(string key)`, emitted whenever a credential is set or updated, so clients can discover new keys without knowing them in advance.
- [ERC-165](/eip-165/) `supportsInterface`, returning true for interface ID `0xd091187f`.

The standard deliberately does **not** fix the key format or the encoding of the returned bytes. Each issuer defines and documents its own. Keys may follow the [ERC-8119](/eip-8119/) parameterized style (`kyc:0xabc…`, `pop/0xabc…`), but that is optional. If a client knows no format for a key, it should treat the bytes as raw UTF-8.

For offchain data, `getCredential` can revert with ERC-3668 `OffchainLookup`. Compliant clients must follow the CCIP-Read flow: fetch from the gateway, then call the contract's callback, which verifies the response (signature, Merkle proof, ZK proof…) before returning it.

## Sample code

Interface and a simple onchain issuer:

```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
    }
}
```

Resolving from a client with ethers v6 (`enableCcipRead` follows ERC-3668 reverts):

```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
```

## Things to know

- **Status: Draft.** The interface may change.
- A credential is only as trustworthy as its issuer. Clients should decide which issuer contracts they trust before relying on any result.
- You cannot guess the encoding of a credential; consult the issuer's documentation for each key.
- Putting personal data such as KYC records onchain is permanent and public. Privacy-preserving designs (offchain storage via CCIP-Read, or zero-knowledge proofs, which the spec explicitly aims to support) are worth considering.


---

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