{"eip":7994,"title":"Purpose-Bound ERC-20 with Conditional Unlock","description":"Extends ERC-20 with programmable restrictions, enabling transfers based on multiple unlock conditions as defined in EIP-7291.","authors":["Anushka Yadav (@64anushka)","Akash Kothawade (@akash3927)","Atishek Singh (@atisheksingh)"],"status":"Final","type":"Standards Track","category":"ERC","created":"2025-07-29","requires":[20,7291],"discussionsTo":"https://ethereum-magicians.org/t/erc-7994-purpose-bound-erc20-with-multi-condition-unlocking-extension-of-eip-7291/24945","repo":"ERCs","label":"ERC-7994","officialUrl":"https://eips.ethereum.org/EIPS/eip-7994","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7994.md","url":"https://eips.huatuo.xyz/eip-7994/","tldr":{"en":"Extends ERC-20 so tokens can be locked for a recipient until several conditions (time, KYC, whitelist and so on) are all met, building on the purpose-bound money idea of ERC-7291.","ja":"ERC-20 を拡張し、複数の条件（時間、KYC、ホワイトリストなど）がすべて満たされるまで、受取人向けにトークンをロックできるようにする。ERC-7291 の目的限定マネーの考え方を土台にしている。","ko":"ERC-20을 확장해 여러 조건(시간, KYC, 화이트리스트 등)이 모두 충족될 때까지 수령인을 위해 토큰을 잠글 수 있게 한다. ERC-7291의 목적 한정 화폐 개념을 기반으로 한다.","zh":"扩展 ERC-20，使代币可以为某个接收方锁定，直到多个条件（时间、KYC、白名单等）全部满足，建立在 ERC-7291 的\"用途绑定货币\"理念之上。"},"tags":["token","erc20","conditional","compliance","payments"],"explainers":{"en":{"lang":"en","tldr":"Extends ERC-20 so tokens can be locked for a recipient until several conditions (time, KYC, whitelist and so on) are all met, building on the purpose-bound money idea of ERC-7291.","tags":["token","erc20","conditional","compliance","payments"],"related":[20,7291],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7994/","markdown":"## What problem does it solve?\n\n[ERC-7291](/eip-7291/) introduced \"purpose-bound money\": tokens restricted in how and where they can be spent. Many real uses need several conditions at once before money can be used. For example:\n\n- A scholarship paid only to a KYC-verified student under 25 enrolled at a university.\n- NGO aid usable only for food and medicine, and only after a given date.\n- Payroll tokens that unlock monthly and can only be spent at approved vendors.\n\nERC-7994 adds a standard way for an [ERC-20](/eip-20/) token to lock an amount for a recipient behind a set of conditions, and release it only when all of them hold.\n\n## How it works\n\nEach locked transfer is called a **purpose binding**. It has:\n\n- a `recipient` and an `amount`,\n- a list of `UnlockCondition`s, each a `conditionType` (a `bytes32` label such as `\"TIME\"`, `\"KYC\"` or `\"WHITELIST\"`) plus `conditionData` used to evaluate it (a timestamp, a Merkle root and so on),\n- an optional `expiry` after which the binding can no longer be claimed.\n\nThree functions make up the interface:\n\n- `bindPurpose(recipient, amount, conditions, expiry)` locks tokens and returns a `bindingId`.\n- `isUnlocked(bindingId)` returns true only if every condition is currently satisfied.\n- `claim(bindingId)` lets the recipient take the tokens once unlocked.\n\nIn the reference implementation, each `conditionType` maps to a separate checker contract with `isConditionMet(recipient, conditionData)`, so new kinds of condition can be plugged in without changing the token. Tokens are held by the token contract itself while locked.\n\n## Sample code\n\nThe interface from the standard:\n\n```solidity\npragma solidity ^0.8.23;\n\ninterface IPurposeBoundERC20 {\n    struct UnlockCondition {\n        bytes32 conditionType; // e.g. \"TIME\", \"KYC\", \"WHITELIST\"\n        bytes conditionData;   // e.g. timestamp, Merkle root\n    }\n\n    function bindPurpose(\n        address recipient,\n        uint256 amount,\n        UnlockCondition[] calldata conditions,\n        uint256 expiry\n    ) external returns (bytes32 bindingId);\n\n    function claim(bytes32 bindingId) external;\n    function isUnlocked(bytes32 bindingId) external view returns (bool);\n}\n```\n\nLocking tokens until a date (ethers v6):\n\n```ts\nimport { AbiCoder, encodeBytes32String } from \"ethers\";\n\nconst unlockAt = BigInt(Math.floor(Date.parse(\"2027-01-01\") / 1000));\nconst conditions = [{\n  conditionType: encodeBytes32String(\"TIME\"),\n  conditionData: AbiCoder.defaultAbiCoder().encode([\"uint256\"], [unlockAt]),\n}];\nconst tx = await token.bindPurpose(student, amount, conditions, 0n); // 0 = no expiry\nawait tx.wait();\n```\n\n## Things to know\n\n- The standard is marked Final.\n- The interface does not define events, how condition types are registered, or what happens to tokens after `expiry`; those are left to implementations. Check how a given token handles expired, unclaimed funds.\n- In the reference implementation `setConditionResolver` is public \"for demo purposes\". A production token must restrict who can register checkers, or anyone could plug in a checker that always returns true.\n- Off-chain checks such as KYC depend on whoever maintains the on-chain proof (for example a Merkle root). The token is only as trustworthy as those checkers.\n- Binding IDs must be unique, and `claim` must verify all conditions atomically, to avoid replay and partial-claim bugs.\n"},"ja":{"lang":"ja","tldr":"ERC-20 を拡張し、複数の条件（時間、KYC、ホワイトリストなど）がすべて満たされるまで、受取人向けにトークンをロックできるようにする。ERC-7291 の目的限定マネーの考え方を土台にしている。","tags":["token","erc20","conditional","compliance","payments"],"related":[20,7291],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7994/","markdown":"## 何を解決するのか\n\n[ERC-7291](/eip-7291/) は「目的限定マネー（purpose-bound money）」、つまり使い方や使える場所を制限したトークンを導入しました。実際の利用場面では、お金を使えるようになる前に複数の条件が同時に必要になることが多くあります。たとえば次のようなケースです。\n\n- KYC 済みで、大学に在籍する 25 歳未満の学生にのみ支払われる奨学金。\n- 特定の日付以降で、食料と医薬品にのみ使える NGO の支援金。\n- 毎月ロック解除され、承認されたベンダーでのみ使える給与トークン。\n\nERC-7994 は、[ERC-20](/eip-20/) トークンが受取人向けにある額を一連の条件の背後にロックし、すべての条件が満たされたときにのみ解放するための標準的な方法を追加します。\n\n## 仕組み\n\nロックされた 1 件ごとの送金は **purpose binding** と呼ばれ、次の要素を持ちます。\n\n- `recipient` と `amount`\n- `UnlockCondition` のリスト。それぞれが `conditionType`（`\"TIME\"`、`\"KYC\"`、`\"WHITELIST\"` のような `bytes32` のラベル）と、評価に使う `conditionData`（タイムスタンプや Merkle root など）で構成される\n- 任意の `expiry`。これを過ぎるとその binding は請求できなくなる\n\nインターフェースは 3 つの関数で構成されます。\n\n- `bindPurpose(recipient, amount, conditions, expiry)` はトークンをロックし、`bindingId` を返します。\n- `isUnlocked(bindingId)` は、すべての条件が現在満たされている場合にのみ true を返します。\n- `claim(bindingId)` は、ロックが解除された後に受取人がトークンを受け取れるようにします。\n\nリファレンス実装では、各 `conditionType` が `isConditionMet(recipient, conditionData)` を持つ個別のチェッカーコントラクトに対応づけられるため、トークン本体を変更せずに新しい種類の条件を追加できます。ロック中のトークンは、トークンコントラクト自身が保持します。\n\n## サンプルコード\n\n標準のインターフェース:\n\n```solidity\npragma solidity ^0.8.23;\n\ninterface IPurposeBoundERC20 {\n    struct UnlockCondition {\n        bytes32 conditionType; // e.g. \"TIME\", \"KYC\", \"WHITELIST\"\n        bytes conditionData;   // e.g. timestamp, Merkle root\n    }\n\n    function bindPurpose(\n        address recipient,\n        uint256 amount,\n        UnlockCondition[] calldata conditions,\n        uint256 expiry\n    ) external returns (bytes32 bindingId);\n\n    function claim(bytes32 bindingId) external;\n    function isUnlocked(bytes32 bindingId) external view returns (bool);\n}\n```\n\n指定した日付までトークンをロックする（ethers v6）:\n\n```ts\nimport { AbiCoder, encodeBytes32String } from \"ethers\";\n\nconst unlockAt = BigInt(Math.floor(Date.parse(\"2027-01-01\") / 1000));\nconst conditions = [{\n  conditionType: encodeBytes32String(\"TIME\"),\n  conditionData: AbiCoder.defaultAbiCoder().encode([\"uint256\"], [unlockAt]),\n}];\nconst tx = await token.bindPurpose(student, amount, conditions, 0n); // 0 = no expiry\nawait tx.wait();\n```\n\n## 知っておくべきこと\n\n- この標準は Final とされています。\n- インターフェースは、イベント、条件タイプの登録方法、`expiry` 後のトークンの扱いを定義していません。これらは実装に委ねられています。あるトークンが期限切れで未請求の資金をどう扱うかを確認してください。\n- リファレンス実装では、`setConditionResolver` が「デモ用に」public になっています。本番のトークンでは、チェッカーを登録できる主体を制限する必要があります。さもないと、常に true を返すチェッカーを誰でも差し込めてしまいます。\n- KYC のようなオフチェーンの確認は、オンチェーンの証明（たとえば Merkle root）を管理する主体に依存します。トークンの信頼性は、それらのチェッカーの信頼性に左右されます。\n- リプレイや部分的な請求のバグを避けるため、binding ID は一意でなければならず、`claim` はすべての条件をアトミックに検証する必要があります。\n"},"ko":{"lang":"ko","tldr":"ERC-20을 확장해 여러 조건(시간, KYC, 화이트리스트 등)이 모두 충족될 때까지 수령인을 위해 토큰을 잠글 수 있게 한다. ERC-7291의 목적 한정 화폐 개념을 기반으로 한다.","tags":["token","erc20","conditional","compliance","payments"],"related":[20,7291],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7994/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-7291](/eip-7291/)은 \"목적 한정 화폐(purpose-bound money)\", 즉 사용 방식과 사용처가 제한된 토큰을 도입했습니다. 실제 사용 사례 중에는 돈을 쓰기 전에 여러 조건이 동시에 필요한 경우가 많습니다. 예를 들면 다음과 같습니다.\n\n- KYC 인증을 받았고 대학에 재학 중인 25세 미만 학생에게만 지급되는 장학금.\n- 특정 날짜 이후에만, 식량과 의약품에만 쓸 수 있는 NGO 지원금.\n- 매달 잠금이 풀리고 승인된 업체에서만 쓸 수 있는 급여 토큰.\n\nERC-7994는 [ERC-20](/eip-20/) 토큰이 수령인을 위한 일정 금액을 여러 조건 뒤에 잠그고, 모든 조건이 충족될 때만 해제하는 표준 방식을 추가합니다.\n\n## 어떻게 동작하나요?\n\n잠긴 전송 하나하나를 **purpose binding**이라고 부릅니다. 각 binding은 다음을 가집니다.\n\n- `recipient`와 `amount`,\n- `UnlockCondition`의 목록. 각 항목은 `conditionType`(`\"TIME\"`, `\"KYC\"`, `\"WHITELIST\"` 같은 `bytes32` 라벨)과 이를 평가하는 데 쓰는 `conditionData`(타임스탬프, Merkle root 등)로 구성됩니다,\n- 선택적인 `expiry`. 이 시점이 지나면 binding은 더 이상 청구할 수 없습니다.\n\n인터페이스는 세 개의 함수로 이루어집니다.\n\n- `bindPurpose(recipient, amount, conditions, expiry)`는 토큰을 잠그고 `bindingId`를 반환합니다.\n- `isUnlocked(bindingId)`는 모든 조건이 현재 충족된 경우에만 true를 반환합니다.\n- `claim(bindingId)`는 잠금이 풀린 뒤 수령인이 토큰을 가져가게 합니다.\n\n레퍼런스 구현에서는 각 `conditionType`이 `isConditionMet(recipient, conditionData)`를 가진 별도의 체커 컨트랙트에 매핑되므로, 토큰을 바꾸지 않고도 새로운 종류의 조건을 연결할 수 있습니다. 잠겨 있는 동안 토큰은 토큰 컨트랙트 자신이 보관합니다.\n\n## 샘플 코드\n\n표준의 인터페이스:\n\n```solidity\npragma solidity ^0.8.23;\n\ninterface IPurposeBoundERC20 {\n    struct UnlockCondition {\n        bytes32 conditionType; // e.g. \"TIME\", \"KYC\", \"WHITELIST\"\n        bytes conditionData;   // e.g. timestamp, Merkle root\n    }\n\n    function bindPurpose(\n        address recipient,\n        uint256 amount,\n        UnlockCondition[] calldata conditions,\n        uint256 expiry\n    ) external returns (bytes32 bindingId);\n\n    function claim(bytes32 bindingId) external;\n    function isUnlocked(bytes32 bindingId) external view returns (bool);\n}\n```\n\n특정 날짜까지 토큰 잠그기(ethers v6):\n\n```ts\nimport { AbiCoder, encodeBytes32String } from \"ethers\";\n\nconst unlockAt = BigInt(Math.floor(Date.parse(\"2027-01-01\") / 1000));\nconst conditions = [{\n  conditionType: encodeBytes32String(\"TIME\"),\n  conditionData: AbiCoder.defaultAbiCoder().encode([\"uint256\"], [unlockAt]),\n}];\nconst tx = await token.bindPurpose(student, amount, conditions, 0n); // 0 = no expiry\nawait tx.wait();\n```\n\n## 알아둘 점\n\n- 이 표준은 Final로 표시되어 있습니다.\n- 인터페이스는 이벤트, 조건 타입을 등록하는 방법, `expiry` 이후 토큰이 어떻게 되는지를 정의하지 않으며, 이는 구현에 맡겨져 있습니다. 특정 토큰이 만료되어 청구되지 않은 자금을 어떻게 처리하는지 확인하세요.\n- 레퍼런스 구현에서는 `setConditionResolver`가 \"데모 목적으로\" public입니다. 프로덕션 토큰은 누가 체커를 등록할 수 있는지 제한해야 하며, 그렇지 않으면 누구나 항상 true를 반환하는 체커를 연결할 수 있습니다.\n- KYC 같은 오프체인 검사는 온체인 증명(예: Merkle root)을 관리하는 주체에 의존합니다. 토큰은 그 체커들만큼만 신뢰할 수 있습니다.\n- 리플레이와 부분 청구 버그를 피하려면 binding ID는 고유해야 하며, `claim`은 모든 조건을 원자적으로 검증해야 합니다.\n"},"zh":{"lang":"zh","tldr":"扩展 ERC-20，使代币可以为某个接收方锁定，直到多个条件（时间、KYC、白名单等）全部满足，建立在 ERC-7291 的\"用途绑定货币\"理念之上。","tags":["token","erc20","conditional","compliance","payments"],"related":[20,7291],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7994/","markdown":"## 它解决什么问题？\n\n[ERC-7291](/eip-7291/) 提出了\"用途绑定货币\"（purpose-bound money）：对如何使用、在哪里使用有限制的代币。许多现实场景需要同时满足多个条件，资金才能使用。例如：\n\n- 奖学金只发放给通过 KYC 验证、年龄在 25 岁以下且就读于某所大学的学生。\n- NGO 援助款只能用于食品和药品，并且只能在某个日期之后使用。\n- 每月解锁、且只能在获批商户处消费的工资代币。\n\nERC-7994 为 [ERC-20](/eip-20/) 代币增加了一种标准方式：为接收方在一组条件之后锁定一定数量，并且只有在所有条件都满足时才释放。\n\n## 它如何运作\n\n每一笔被锁定的转账称为一个 **purpose binding**。它包含：\n\n- 一个 `recipient` 和一个 `amount`，\n- 一组 `UnlockCondition`，每个由 `conditionType`（`bytes32` 标签，如 `\"TIME\"`、`\"KYC\"` 或 `\"WHITELIST\"`）和用于评估它的 `conditionData`（时间戳、Merkle root 等）组成，\n- 可选的 `expiry`，超过该时间后该 binding 不能再被领取。\n\n接口由三个函数组成：\n\n- `bindPurpose(recipient, amount, conditions, expiry)` 锁定代币并返回 `bindingId`。\n- `isUnlocked(bindingId)` 仅当每个条件当前都已满足时才返回 true。\n- `claim(bindingId)` 让接收方在解锁后取走代币。\n\n在参考实现中，每个 `conditionType` 对应一个独立的检查器合约，其带有 `isConditionMet(recipient, conditionData)`，因此无需修改代币即可接入新的条件类型。代币被锁定期间由代币合约自身持有。\n\n## 示例代码\n\n标准中的接口：\n\n```solidity\npragma solidity ^0.8.23;\n\ninterface IPurposeBoundERC20 {\n    struct UnlockCondition {\n        bytes32 conditionType; // e.g. \"TIME\", \"KYC\", \"WHITELIST\"\n        bytes conditionData;   // e.g. timestamp, Merkle root\n    }\n\n    function bindPurpose(\n        address recipient,\n        uint256 amount,\n        UnlockCondition[] calldata conditions,\n        uint256 expiry\n    ) external returns (bytes32 bindingId);\n\n    function claim(bytes32 bindingId) external;\n    function isUnlocked(bytes32 bindingId) external view returns (bool);\n}\n```\n\n锁定代币直到某个日期（ethers v6）：\n\n```ts\nimport { AbiCoder, encodeBytes32String } from \"ethers\";\n\nconst unlockAt = BigInt(Math.floor(Date.parse(\"2027-01-01\") / 1000));\nconst conditions = [{\n  conditionType: encodeBytes32String(\"TIME\"),\n  conditionData: AbiCoder.defaultAbiCoder().encode([\"uint256\"], [unlockAt]),\n}];\nconst tx = await token.bindPurpose(student, amount, conditions, 0n); // 0 = no expiry\nawait tx.wait();\n```\n\n## 需要注意\n\n- 该标准被标记为 Final。\n- 接口没有定义事件、条件类型如何注册，以及 `expiry` 之后代币如何处理；这些都留给具体实现。请确认某个代币如何处理已过期且未被领取的资金。\n- 在参考实现中，`setConditionResolver` 是\"为演示目的\"而公开的。生产环境的代币必须限制谁能注册检查器，否则任何人都可以接入一个永远返回 true 的检查器。\n- 像 KYC 这样的链下检查取决于维护链上证明（例如 Merkle root）的一方。代币的可信度取决于这些检查器。\n- Binding ID 必须唯一，且 `claim` 必须原子性地验证所有条件，以避免重放和部分领取的漏洞。\n"}}}
