{"eip":7861,"title":"ERC-721 Verifiable Credential Extension","description":"An extension to ERC-721 that adds collection-wide verifiable credential properties, this allows native support for onchain credentials.","authors":["Valerio Massimo Camaiani (@vmc-crossmint)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-01-14","requires":[165,721],"discussionsTo":"https://ethereum-magicians.org/t/erc-721-verifiable-credential-extension/22562","repo":"ERCs","label":"ERC-7861","officialUrl":"https://eips.ethereum.org/EIPS/eip-7861","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7861.md","url":"https://eips.huatuo.xyz/eip-7861/","tldr":{"en":"An ERC-721 extension that turns an NFT collection into a set of verifiable credentials, exposing the issuer, credential type, encryption and verification methods, a per-token credential URI and revocation status in one standard interface.","ja":"NFT コレクションを検証可能なクレデンシャル（VC）の集合に変える ERC-721 拡張。発行者、クレデンシャルの種類、暗号化と検証の方法、トークンごとのクレデンシャル URI、失効状態を 1 つの標準インターフェースで公開する。","ko":"NFT 컬렉션을 검증 가능한 자격 증명(VC)의 집합으로 바꾸는 ERC-721 확장. 발행자, 자격 증명 종류, 암호화 및 검증 방법, 토큰별 자격 증명 URI, 폐기 상태를 하나의 표준 인터페이스로 노출한다.","zh":"一个 ERC-721 扩展，把 NFT 合集变成一组可验证凭证，在一个标准接口中公开发行者、凭证类型、加密和验证方法、每个代币的凭证 URI 以及撤销状态。"},"tags":["nft","erc721","credentials","identity","verifiable-credentials"],"explainers":{"en":{"lang":"en","tldr":"An ERC-721 extension that turns an NFT collection into a set of verifiable credentials, exposing the issuer, credential type, encryption and verification methods, a per-token credential URI and revocation status in one standard interface.","tags":["nft","erc721","credentials","identity","verifiable-credentials"],"related":[721,165,5192,4973],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7861/","markdown":"## What problem does it solve?\n\nProjects already use NFTs to represent diplomas, memberships, KYC attestations and similar claims, but each collection invents its own way to say who issued them, where the actual credential lives, whether it is encrypted and whether it has been revoked. Verifiers have to write custom code for every collection.\n\nERC-7861 adds a small, shared interface on top of [ERC-721](/eip-721/) so any platform can discover and check a credential NFT the same way. It was designed with W3C Verifiable Credentials in mind but can link any private, off-chain payload to a wallet through an NFT.\n\n## How it works\n\nCollection-wide properties (the same for every token):\n\n- `issuer()`: issuer DID or address (an empty string means no issuer).\n- `credentialType()`: what kind of credential this collection holds.\n- `encryptionMethod()`: returns an empty string **if and only if** credentials are unencrypted; otherwise names the method. Extra decryption details can be exposed elsewhere.\n- `verificationMethod()`: how to verify the credential's proof, ideally matching the W3C \"verification method\" concept.\n\nPer token:\n\n- `credentialURI(tokenId)`: where the credential lives (IPFS, a private server with access control, …), or an empty string if retrieval works differently.\n- `isRevoked(tokenId)`: `true` once revoked; may also be `true` for tokens that do not exist. Revocation can be burning the NFT, a list in the contract, or an off-chain list.\n\nOptional events, `CredentialIssued(tokenId, to)` and `CredentialRevoked(tokenId)`, let indexers track the lifecycle.\n\nA verifier's flow: find the credential NFT in the holder's wallet → fetch from `credentialURI` → decrypt if `encryptionMethod()` is set (possibly needing the holder's consent) → verify with `verificationMethod()` → check `isRevoked`.\n\n## Sample code\n\nChecking a credential with ethers v6:\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst vc = new Contract(collection, [\n  \"function issuer() view returns (string)\",\n  \"function credentialType() view returns (string)\",\n  \"function encryptionMethod() view returns (string)\",\n  \"function verificationMethod() view returns (string)\",\n  \"function credentialURI(uint256) view returns (string)\",\n  \"function isRevoked(uint256) view returns (bool)\",\n], provider);\n\nif (await vc.isRevoked(tokenId)) throw new Error(\"credential revoked\");\n\nconst [iss, type, enc, method, uri] = await Promise.all([\n  vc.issuer(), vc.credentialType(), vc.encryptionMethod(),\n  vc.verificationMethod(), vc.credentialURI(tokenId),\n]);\nconsole.log({ iss, type, encrypted: enc !== \"\", method, uri });\n// next: fetch `uri`, decrypt if needed, verify the proof per `method`\n```\n\n## Things to know\n\n- Status is **Draft**, and the Rationale section is still TODO.\n- The ERC-165 interface ID is unclear in the current text: the specification gives `0x7861069` (only seven hex digits) while the reference implementation uses `0x74699c4e`. Check the final spec before relying on `supportsInterface`.\n- The spec recommends credentials be **non-transferable**; for that behaviour see [ERC-5192](/eip-5192/) (minimal soulbound) or [ERC-4973](/eip-4973/).\n- Everything onchain, including `credentialURI`, is public. Keep sensitive data encrypted off-chain.\n- Strict access control on issuing, revoking and setting collection properties is essential; the reference implementation leaves it out.\n"},"ja":{"lang":"ja","tldr":"NFT コレクションを検証可能なクレデンシャル（VC）の集合に変える ERC-721 拡張。発行者、クレデンシャルの種類、暗号化と検証の方法、トークンごとのクレデンシャル URI、失効状態を 1 つの標準インターフェースで公開する。","tags":["nft","erc721","credentials","identity","verifiable-credentials"],"related":[721,165,5192,4973],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7861/","markdown":"## 何を解決するのか\n\nプロジェクトはすでに、卒業証書、会員資格、KYC の証明などの主張を NFT で表現していますが、各コレクションが、誰が発行したか、実際のクレデンシャルがどこにあるか、暗号化されているか、失効したかを示す独自の方法を考案しています。検証者はコレクションごとに専用のコードを書く必要があります。\n\nERC-7861 は [ERC-721](/eip-721/) の上に小さな共通インターフェースを追加し、どのプラットフォームでもクレデンシャル NFT を同じ方法で発見・確認できるようにします。W3C の Verifiable Credentials を念頭に設計されていますが、プライベートなオフチェーンのペイロードを、NFT を通じてウォレットに結び付けることもできます。\n\n## 仕組み\n\nコレクション全体のプロパティ（すべてのトークンで共通）:\n\n- `issuer()`: 発行者の DID またはアドレス（空文字列は発行者なしを意味します）。\n- `credentialType()`: このコレクションが保持するクレデンシャルの種類。\n- `encryptionMethod()`: クレデンシャルが暗号化されて**いない場合に限り**、空文字列を返します。そうでなければ方式名を返します。復号の追加情報は別の場所で公開できます。\n- `verificationMethod()`: クレデンシャルの証明をどう検証するか。理想的には W3C の「verification method」の概念に合わせます。\n\nトークンごと:\n\n- `credentialURI(tokenId)`: クレデンシャルの場所（IPFS、アクセス制御付きのプライベートサーバーなど）。取得方法が別であれば空文字列。\n- `isRevoked(tokenId)`: 失効すると `true`。存在しないトークンに対しても `true` となることがあります。失効は、NFT のバーン、コントラクト内のリスト、オフチェーンのリストのいずれでも構いません。\n\n任意のイベント `CredentialIssued(tokenId, to)` と `CredentialRevoked(tokenId)` により、インデクサーはライフサイクルを追跡できます。\n\n検証者の流れ: 保有者のウォレットでクレデンシャル NFT を見つける → `credentialURI` から取得する → `encryptionMethod()` が設定されていれば復号する（保有者の同意が必要な場合あり） → `verificationMethod()` で検証する → `isRevoked` を確認する。\n\n## サンプルコード\n\nethers v6 でクレデンシャルを確認する:\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst vc = new Contract(collection, [\n  \"function issuer() view returns (string)\",\n  \"function credentialType() view returns (string)\",\n  \"function encryptionMethod() view returns (string)\",\n  \"function verificationMethod() view returns (string)\",\n  \"function credentialURI(uint256) view returns (string)\",\n  \"function isRevoked(uint256) view returns (bool)\",\n], provider);\n\nif (await vc.isRevoked(tokenId)) throw new Error(\"credential revoked\");\n\nconst [iss, type, enc, method, uri] = await Promise.all([\n  vc.issuer(), vc.credentialType(), vc.encryptionMethod(),\n  vc.verificationMethod(), vc.credentialURI(tokenId),\n]);\nconsole.log({ iss, type, encrypted: enc !== \"\", method, uri });\n// next: fetch `uri`, decrypt if needed, verify the proof per `method`\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** で、Rationale セクションはまだ TODO です。\n- ERC-165 のインターフェース ID は現在のテキストでは不明確です。仕様は `0x7861069`（16 進で 7 桁のみ）を示していますが、リファレンス実装は `0x74699c4e` を使っています。`supportsInterface` に頼る前に、最終版の仕様を確認してください。\n- 仕様は、クレデンシャルを**譲渡不可**にすることを推奨しています。その挙動については [ERC-5192](/eip-5192/)（最小限のソウルバウンド）や [ERC-4973](/eip-4973/) を参照してください。\n- `credentialURI` を含め、オンチェーンのものはすべて公開されます。機微なデータはオフチェーンで暗号化しておいてください。\n- 発行、失効、コレクションのプロパティ設定に対する厳格なアクセス制御が不可欠ですが、リファレンス実装には含まれていません。\n"},"ko":{"lang":"ko","tldr":"NFT 컬렉션을 검증 가능한 자격 증명(VC)의 집합으로 바꾸는 ERC-721 확장. 발행자, 자격 증명 종류, 암호화 및 검증 방법, 토큰별 자격 증명 URI, 폐기 상태를 하나의 표준 인터페이스로 노출한다.","tags":["nft","erc721","credentials","identity","verifiable-credentials"],"related":[721,165,5192,4973],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7861/","markdown":"## 어떤 문제를 해결하나요?\n\n프로젝트들은 이미 졸업장, 멤버십, KYC 증명 같은 주장을 NFT로 표현하고 있지만, 컬렉션마다 누가 발행했는지, 실제 자격 증명이 어디에 있는지, 암호화되어 있는지, 폐기되었는지를 나타내는 방식을 제각각 만들어 냅니다. 검증하는 쪽은 컬렉션마다 맞춤 코드를 작성해야 합니다.\n\nERC-7861은 [ERC-721](/eip-721/) 위에 작은 공통 인터페이스를 더해, 어떤 플랫폼이든 자격 증명 NFT를 같은 방식으로 찾고 확인할 수 있게 합니다. W3C Verifiable Credentials를 염두에 두고 설계되었지만, 비공개 오프체인 페이로드를 NFT를 통해 지갑에 연결하는 데에도 쓸 수 있습니다.\n\n## 어떻게 동작하나요?\n\n컬렉션 전체 속성(모든 토큰에 동일):\n\n- `issuer()`: 발행자 DID 또는 주소(빈 문자열은 발행자 없음을 뜻함).\n- `credentialType()`: 이 컬렉션이 담고 있는 자격 증명의 종류.\n- `encryptionMethod()`: 자격 증명이 암호화되어 **있지 않을 때에만** 빈 문자열을 반환하고, 그렇지 않으면 방식 이름을 반환합니다. 복호화에 관한 추가 정보는 다른 곳에서 공개할 수 있습니다.\n- `verificationMethod()`: 자격 증명의 증명을 어떻게 검증하는지. 이상적으로는 W3C의 \"verification method\" 개념과 일치합니다.\n\n토큰별:\n\n- `credentialURI(tokenId)`: 자격 증명이 있는 위치(IPFS, 접근 제어가 있는 비공개 서버 등). 가져오는 방식이 다르면 빈 문자열.\n- `isRevoked(tokenId)`: 폐기되면 `true`. 존재하지 않는 토큰에 대해서도 `true`일 수 있습니다. 폐기는 NFT 소각, 컨트랙트 내 목록, 오프체인 목록 중 무엇이든 될 수 있습니다.\n\n선택적 이벤트 `CredentialIssued(tokenId, to)`와 `CredentialRevoked(tokenId)`로 인덱서가 수명 주기를 추적할 수 있습니다.\n\n검증자의 흐름: 보유자의 지갑에서 자격 증명 NFT 찾기 → `credentialURI`에서 가져오기 → `encryptionMethod()`가 설정되어 있으면 복호화(보유자의 동의가 필요할 수 있음) → `verificationMethod()`로 검증 → `isRevoked` 확인.\n\n## 샘플 코드\n\nethers v6로 자격 증명 확인하기:\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst vc = new Contract(collection, [\n  \"function issuer() view returns (string)\",\n  \"function credentialType() view returns (string)\",\n  \"function encryptionMethod() view returns (string)\",\n  \"function verificationMethod() view returns (string)\",\n  \"function credentialURI(uint256) view returns (string)\",\n  \"function isRevoked(uint256) view returns (bool)\",\n], provider);\n\nif (await vc.isRevoked(tokenId)) throw new Error(\"credential revoked\");\n\nconst [iss, type, enc, method, uri] = await Promise.all([\n  vc.issuer(), vc.credentialType(), vc.encryptionMethod(),\n  vc.verificationMethod(), vc.credentialURI(tokenId),\n]);\nconsole.log({ iss, type, encrypted: enc !== \"\", method, uri });\n// next: fetch `uri`, decrypt if needed, verify the proof per `method`\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**이며, Rationale 섹션은 아직 TODO입니다.\n- ERC-165 인터페이스 ID는 현재 텍스트에서 불분명합니다. 사양은 `0x7861069`(16진수 7자리뿐)를 제시하지만 참조 구현은 `0x74699c4e`를 사용합니다. `supportsInterface`에 의존하기 전에 최종 사양을 확인하세요.\n- 사양은 자격 증명을 **양도 불가**로 할 것을 권장합니다. 그런 동작은 [ERC-5192](/eip-5192/)(최소 소울바운드)나 [ERC-4973](/eip-4973/)을 참고하세요.\n- `credentialURI`를 포함해 온체인의 모든 것은 공개됩니다. 민감한 데이터는 오프체인에서 암호화해 두세요.\n- 발행, 폐기, 컬렉션 속성 설정에 대한 엄격한 접근 제어가 필수이지만, 참조 구현에는 빠져 있습니다.\n"},"zh":{"lang":"zh","tldr":"一个 ERC-721 扩展，把 NFT 合集变成一组可验证凭证，在一个标准接口中公开发行者、凭证类型、加密和验证方法、每个代币的凭证 URI 以及撤销状态。","tags":["nft","erc721","credentials","identity","verifiable-credentials"],"related":[721,165,5192,4973],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7861/","markdown":"## 它解决什么问题？\n\n各项目已经在用 NFT 表示文凭、会员资格、KYC 证明等类似声明，但每个合集都自创了一套方式来说明是谁发行的、实际凭证存放在哪里、是否加密、是否已被撤销。验证方必须为每个合集编写定制代码。\n\nERC-7861 在 [ERC-721](/eip-721/) 之上增加了一个小型共享接口，使任何平台都能以相同方式发现和检查凭证 NFT。它在设计时考虑了 W3C 可验证凭证（Verifiable Credentials），但也可以通过 NFT 把任何私有的链下负载关联到钱包。\n\n## 它如何运作\n\n合集范围的属性（对每个代币都相同）：\n\n- `issuer()`：发行者的 DID 或地址（空字符串表示没有发行者）。\n- `credentialType()`：该合集所持有的凭证类型。\n- `encryptionMethod()`：**当且仅当**凭证未加密时返回空字符串；否则返回所用方法的名称。额外的解密细节可以在别处公开。\n- `verificationMethod()`：如何验证凭证的证明，最好与 W3C 的\"verification method\"概念一致。\n\n每个代币：\n\n- `credentialURI(tokenId)`：凭证的存放位置（IPFS、带访问控制的私有服务器等）；如果获取方式不同，则为空字符串。\n- `isRevoked(tokenId)`：撤销后为 `true`；对于不存在的代币也可能为 `true`。撤销可以是销毁 NFT、合约中的列表，或链下的列表。\n\n可选事件 `CredentialIssued(tokenId, to)` 和 `CredentialRevoked(tokenId)` 让索引器能够跟踪其生命周期。\n\n验证方的流程：在持有者的钱包中找到凭证 NFT → 从 `credentialURI` 获取 → 如果设置了 `encryptionMethod()` 则解密（可能需要持有者同意）→ 用 `verificationMethod()` 验证 → 检查 `isRevoked`。\n\n## 示例代码\n\n用 ethers v6 检查凭证：\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst vc = new Contract(collection, [\n  \"function issuer() view returns (string)\",\n  \"function credentialType() view returns (string)\",\n  \"function encryptionMethod() view returns (string)\",\n  \"function verificationMethod() view returns (string)\",\n  \"function credentialURI(uint256) view returns (string)\",\n  \"function isRevoked(uint256) view returns (bool)\",\n], provider);\n\nif (await vc.isRevoked(tokenId)) throw new Error(\"credential revoked\");\n\nconst [iss, type, enc, method, uri] = await Promise.all([\n  vc.issuer(), vc.credentialType(), vc.encryptionMethod(),\n  vc.verificationMethod(), vc.credentialURI(tokenId),\n]);\nconsole.log({ iss, type, encrypted: enc !== \"\", method, uri });\n// next: fetch `uri`, decrypt if needed, verify the proof per `method`\n```\n\n## 需要注意\n\n- 状态为 **Draft**，Rationale 一节仍是 TODO。\n- 当前文本中 ERC-165 接口 ID 并不清楚：规范给出的是 `0x7861069`（只有七位十六进制数字），而参考实现使用的是 `0x74699c4e`。在依赖 `supportsInterface` 之前，请先查看最终规范。\n- 规范建议凭证应为**不可转让**；该行为请参阅 [ERC-5192](/eip-5192/)（最小化灵魂绑定）或 [ERC-4973](/eip-4973/)。\n- 链上的一切，包括 `credentialURI`，都是公开的。请把敏感数据加密后放在链下。\n- 对发行、撤销和设置合集属性实施严格的访问控制至关重要；参考实现省略了这一点。\n"}}}
