EIPs Explained

ERC-7994 · Final · ERC · 2025-07-29

ERC-7994: Purpose-Bound ERC-20 with Conditional Unlock

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.

What problem does it solve?

ERC-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:

  • A scholarship paid only to a KYC-verified student under 25 enrolled at a university.
  • NGO aid usable only for food and medicine, and only after a given date.
  • Payroll tokens that unlock monthly and can only be spent at approved vendors.

ERC-7994 adds a standard way for an ERC-20 token to lock an amount for a recipient behind a set of conditions, and release it only when all of them hold.

How it works

Each locked transfer is called a purpose binding. It has:

  • a recipient and an amount,
  • a list of UnlockConditions, 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),
  • an optional expiry after which the binding can no longer be claimed.

Three functions make up the interface:

  • bindPurpose(recipient, amount, conditions, expiry) locks tokens and returns a bindingId.
  • isUnlocked(bindingId) returns true only if every condition is currently satisfied.
  • claim(bindingId) lets the recipient take the tokens once unlocked.

In 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.

Sample code

The interface from the standard:

pragma solidity ^0.8.23;

interface IPurposeBoundERC20 {
    struct UnlockCondition {
        bytes32 conditionType; // e.g. "TIME", "KYC", "WHITELIST"
        bytes conditionData;   // e.g. timestamp, Merkle root
    }

    function bindPurpose(
        address recipient,
        uint256 amount,
        UnlockCondition[] calldata conditions,
        uint256 expiry
    ) external returns (bytes32 bindingId);

    function claim(bytes32 bindingId) external;
    function isUnlocked(bytes32 bindingId) external view returns (bool);
}

Locking tokens until a date (ethers v6):

import { AbiCoder, encodeBytes32String } from "ethers";

const unlockAt = BigInt(Math.floor(Date.parse("2027-01-01") / 1000));
const conditions = [{
  conditionType: encodeBytes32String("TIME"),
  conditionData: AbiCoder.defaultAbiCoder().encode(["uint256"], [unlockAt]),
}];
const tx = await token.bindPurpose(student, amount, conditions, 0n); // 0 = no expiry
await tx.wait();

Things to know

  • The standard is marked Final.
  • 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.
  • 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.
  • 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.
  • Binding IDs must be unique, and claim must verify all conditions atomically, to avoid replay and partial-claim bugs.

#token #erc20 #conditional #compliance #payments

Details

Authors
Anushka Yadav (@64anushka), Akash Kothawade (@akash3927), Atishek Singh (@atisheksingh)
Status
Final
Type
Standards Track / ERC
Created
2025-07-29
Requires

Machine-readable: Markdown · JSON