EIP.tools

EIP.tools

⚠️ DraftStandards Track: ERC

ERC-8516: Sovereign ERC-20 Receive Protection

Opt-in, recipient-sovereign gating for incoming ERC-20 transfers and mints via allow/denylists, one-time permits, and external policies.

Authors
Created2026-11-15
Discussion Linkhttps://ethereum-magicians.org/t/erc-8516-sovereign-erc-20-receive-protection/30485
Requires

Markdown

https://raw.githubusercontent.com/ethereum/ERCs/re...
Pull Request#2213PR open

EIP-GPT summary

Contents
AbstractMotivationSpecificationCore BehaviorCore Interface (REQUIRED β€” MUST)Account Protection Configuration ExtensionsOpt-In Toggle Extension (RECOMMENDED β€” SHOULD)Protection Level Extension (OPTIONAL β€” MAY)Signature-Based Protection Extension (OPTIONAL β€” MAY)External Policy Delegation Extension (OPTIONAL β€” MAY)Sender Authorization & Blocking ExtensionsOne-Time Receive Permit Extension (OPTIONAL β€” MAY)Embedded Allowlist Extension (OPTIONAL β€” MAY)Embedded Denylist Extension (OPTIONAL β€” MAY)Convenience & InteroperabilityAtomic Transfer Helpers (OPTIONAL β€” MAY)Compatibility with ERC-7943 (OPTIONAL β€” MAY)RationaleBackwards CompatibilityReference ImplementationSecurity ConsiderationsCopyright

Abstract

This ERC defines an opt-in extension to ERC-20 that enables any account to gate incoming token transfers and mints. A minimal core interface exposes standard protection status and pre-flight checks for integrations, while modular extensions allow recipients to authorize or block senders through per-token allow-lists, deny-lists, one-off off-chain signatures, or external policy contracts across both EOAs and smart accounts.

Motivation

Standard ERC-20 tokens allow any address to push tokens to any recipient without consent. This creates several recurring issues:

  1. Address poisoning and dust/spam transfers: Attackers send zero-value or dust transfers from lookalike addresses to pollute transaction history.
  2. Tainted inflows & compliance: Treasuries, decentralized autonomous organizations, and regulated entities may wish to reject transfers from unverified or sanctioned sources rather than custodying unexpected assets.
  3. Accounting hygiene: Automated treasury systems benefit from rejecting unsolicited inflows at the protocol layer.

Existing transfer-restriction standards (such as ERC-3643) are typically issuer-controlled, while earlier recipient-hook designs (such as ERC-777's tokensReceived) introduced state-mutating reentrancy vectors during transfers and did not natively protect EOAs. This proposal introduces recipient-side sovereignty for both EOAs and smart accounts without reentrancy risk, while remaining backwards-compatible with existing ERC-20 wallets, DEX routers, and bridges through an opt-in default.

Specification

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

Core Behavior

  1. Opt-In Default: Fresh accounts MUST default to isReceiveProtected(account) == false. Unprotected accounts MUST accept incoming transfers and mints with standard ERC-20 semantics.
  2. Economic Sender Attribution: When to has enabled protection (isReceiveProtected(to) == true), checks MUST evaluate from (the economic sender), NOT msg.sender (which may be a DEX router or spender in transferFrom).
  3. Exemptions & Minting:
    • Burns (to == address(0)) MUST NOT be blocked by receive protection.
    • Self-transfers (from == to) MUST be allowed even when to is protected.
    • Mints (from == address(0)) MUST be subject to to's protection rules; address(0) MAY be allow-listed or permitted via permitReceive.
  4. Authorization: When to != address(0), from != to, and isReceiveProtected(to) == true, the evaluation order and composition (OR vs. AND) across implemented authorization extensions are up to the token implementer, subject to the following invariants:
    • canReceive(from, to, amount) MUST return the exact same authorization outcome as the transfer check.
    • If a one-time receive permit (oneTimeReceiveLimit(from, to) > 0 && amount <= oneTimeReceiveLimit(from, to)) is used to authorize the transfer, the entire one-time limit MUST be cleared to 0 (strictly single-use, even for partial amounts).
    • If an external IReceivePolicy is queried, it MUST be invoked via staticcall and MUST fail closed (treat false or revert as denied).
    • If the transfer is not authorized, the token MUST revert with RecipientTransferNotAllowed(from, to, amount).

Core Interface (REQUIRED β€” MUST)

For external integrations and off-chain/on-chain tooling (wallets, DEXs, bridges, batch distributors, block explorers, and indexers), compliant tokens MUST implement the following minimal core interface to expose protection status, pre-flight transfer checks, and standard error decoding, and SHOULD implement ERC-165 (supportsInterface) to advertise Core and optional extension support:

interface IERCProtectedReceiveCore {
    event ReceiveProtectionUpdated(address indexed account, bool enabled);

    error RecipientTransferNotAllowed(address from, address to, uint256 amount);

    function isReceiveProtected(address account) external view returns (bool);
    function canReceive(address from, address to, uint256 amount) external view returns (bool);
}

Account Protection Configuration Extensions

These extensions govern how an account enables, configures, or delegates its receive protection state:

For account owners and wallet/custody interfaces (EOAs, hardware/cold wallets, MPC custody, and multisig dashboards), this extension provides a standard self-service toggle to enable or disable incoming transfer protection on the caller's own account:

interface IERCProtectedReceiveOptIn {
    function setReceiveProtection(bool enabled) external;
}

Protection Level Extension (OPTIONAL β€” MAY)

For wallet interfaces and smart accounts that support granular bytes32 protection bit masks or tiers (bytes32(0) = unprotected, bytes32(uint256(1)) = default), implementations MAY expose setReceiveProtection(bytes32). Updating between two non-zero levels MUST emit ReceiveProtectionLevelUpdated and MUST NOT re-emit ReceiveProtectionUpdated (which is reserved for 0 <-> non-zero transitions):

interface IERCProtectedReceiveLevel {
    event ReceiveProtectionLevelUpdated(address indexed account, bytes32 protectionLevel);

    function receiveProtectionLevel(address account) external view returns (bytes32);
    function setReceiveProtection(bytes32 protectionLevel) external;
}

Signature-Based Protection Extension (OPTIONAL β€” MAY)

For relayers, paymasters, senders, and wallet/checkout interfaces acting on behalf of 0-ETH accounts (such as recipient-derived one-off/invoice addresses, counterfactual smart accounts, or cold storage), implementations MAY expose EIP-712 signature-based protection management:

interface IERCProtectedReceiveSig {
    error ExpiredReceiveProtectionSetupSignature(uint256 deadline);
    error InvalidReceiveProtectionSetupSignature(address account);

    function setReceiveProtectionWithSig(
        address account,
        bytes32 protectionLevel,
        uint256 deadline,
        bytes calldata signature
    ) external;
}
  • EIP-712 Type Hash:

    SetReceiveProtection(address account,bytes32 protectionLevel,uint256 nonce,uint256 deadline)

    (The uint256 nonce MUST provide single-use replay protection per account, while the nonce scheme - sequential or unordered - and any on-chain query getter are implementation-defined and outside the scope of this standard.)

  • Atomic One-Off Account Protection: For recipient-derived one-off addresses, the sender or relayer can execute 1. transfer(S, amount) β†’ 2. setReceiveProtectionWithSig(S, level, deadline, sig) in a single transactionβ€”leaving S funded and immediately protected with 0 ETH and no unprotected window.

    (Note: in sender-derived stealth schemes such as ERC-5564 where the recipient does not know S until after scanning the announcement, S remains unprotected between the funding tx and the relayed setReceiveProtectionWithSig tx.)

External Policy Delegation Extension (OPTIONAL β€” MAY)

For treasuries, modular smart accounts, and power users that need shared multi-token rules or custom receive logic (such as cross-token allow-lists/deny-lists, minimum-amount dust filters, rate limits, or compliance and taint checks) without duplicating state per token:

interface IERCProtectedReceivePolicy {
    event ReceivePolicyUpdated(address indexed account, address indexed policy);

    function receivePolicy(address account) external view returns (address);
    function setReceivePolicy(address policy) external;
}

interface IReceivePolicy {
    function canReceive(
        address token,
        address from,
        address to,
        uint256 amount,
        bytes calldata data
    ) external view returns (bool allowed);
}

Tokens MUST query IReceivePolicy.canReceive via staticcall (enforced by the view interface), guaranteeing EVM-level read-only execution during _update without reentrancy risk. The data parameter allows tokens to pass optional ABI-encoded context (such as msg.sender, allowance, token-specific flags, or sender/recipient account metadata like tiers or compliance attributes; "" by default). Because data is opaque and token-defined, generic multi-token policies SHOULD NOT assume a fixed data schema across arbitrary tokens unless coordinated with the calling token. Modular smart accounts (such as ERC-7579 accounts) or shared registries can implement IReceivePolicy directly to enforce unified account-level receive rules across all supporting tokens.

Sender Authorization & Blocking Extensions

These extensions govern which senders or individual transfers are authorized or blocked for a protected recipient:

One-Time Receive Permit Extension (OPTIONAL β€” MAY)

For protected recipients, senders, relayers, and checkout/invoice interfaces settling single, amount-capped incoming payments (such as one-off invoices, OTC trades, or rare senders) without adding the sender to a persistent allow-list policy:

interface IERCProtectedReceivePermit {
    event OneTimeReceivePermitted(
        address indexed from,
        address indexed to,
        uint256 indexed nonce,
        uint256 maxAmount,
        uint256 deadline
    );

    error ExpiredReceivePermit(uint256 deadline);
    error InvalidReceivePermitSignature(address recipient);
    error InvalidReceiveNonce(address recipient, uint256 nonce);

    function oneTimeReceiveLimit(address from, address to) external view returns (uint256);
    function isReceiveNonceUsed(address account, uint256 nonce) external view returns (bool);

    function permitReceive(
        address from,
        address to,
        uint256 maxAmount,
        uint256 nonce,
        uint256 deadline,
        bytes calldata signature
    ) external;
}
  • EIP-712 Type Hash:
    PermitReceive(address from,address to,uint256 maxAmount,uint256 nonce,uint256 deadline)
  • Signature Verification & Domain Discovery: Implementations MUST support both ECDSA and ERC-1271 smart contract signatures (e.g., via OpenZeppelin SignatureChecker), and SHOULD implement ERC-5267 (eip712Domain()) so wallets can dynamically discover the EIP-712 signing domain. The authorized signer MAY be the recipient to itself or a designated delegated signer configured for to (e.g., an ops/treasury co-signer or ERC-1271 validator).
  • Replay Protection (Unordered Nonces): Sequential nonces serialize concurrent off-chain permitsβ€”if a recipient issues permits to multiple senders, out-of-order settlement would revert or collide. Instead, permitReceive uses arbitrary unordered uint256 nonces scoped per recipient to. Implementations MUST mark each consumed nonce as used, MUST report that status via isReceiveNonceUsed(to, nonce), and MUST revert with InvalidReceiveNonce(to, nonce) if a nonce has already been used. As a gas-efficient reference pattern (like Permit2), implementations MAY store nonces in an unordered 256-bit bitmap indexed by wordPos = uint248(nonce >> 8) and bitPos = uint8(nonce) (mask = 1 << bitPos), packing 256 concurrent permits into a single storage slot; off-chain signers can then choose axes by need (e.g., wordPos = 0 for warm-slot packing, wordPos = uint248(uint160(from)) for per-sender isolation, or a random uint248 wordPos for stateless multi-device issuance).
  • Unlimited Cap: Signing maxAmount = type(uint256).max permits any single transfer amount once.
  • Zero-Address Checks: Implementations MUST revert if to is address(0) (from == address(0) MAY be used to permit one-time mint).

Embedded Allowlist Extension (OPTIONAL β€” MAY)

For explorers, indexers, and wallet/custody interfaces inspecting embedded allowlist. How entries are administered (e.g., direct msg.sender setters, batching, or delegated managers) is left to the implementation:

interface IERCProtectedReceiveAllowlist {
    event ReceiveSenderAllowlistUpdated(address indexed from, address indexed to, uint40 expiry);

    function receiveSenderAllowlistedUntil(address from, address to) external view returns (uint40);
}

Embedded Denylist Extension (OPTIONAL β€” MAY)

For explorers, indexers, and wallet/custody interfaces inspecting embedded denylist entries (e.g., for denylist-only protection or explicit sender blocks), this extension exposes current block expirations and updates. How entries are administered (e.g., direct msg.sender setters, batching, or delegated managers) and how they compose with allow-lists, permitReceive, or protectionLevel are left to the implementation:

interface IERCProtectedReceiveDenylist {
    event ReceiveSenderDenylistUpdated(address indexed from, address indexed to, uint40 expiry);

    function receiveSenderDenylistedUntil(address from, address to) external view returns (uint40);
}
  • Expiry Semantics: expiry == 0 or expiry <= block.timestamp means not actively denied; expiry > block.timestamp blocks from until expiry; type(uint40).max denotes a permanent block.
  • Other Deny Rules: Minimum-amount dust filters, rate limits, or taint screening belong in IReceivePolicy and IERCProtectedReceiveLevel.

Convenience & Interoperability

Atomic Transfer Helpers (OPTIONAL β€” MAY)

Implementations MAY expose convenience helpers for single-transaction settlement:

  • transferWithReceivePermit(address to, uint256 amount, uint256 maxAmount, uint256 nonce, uint256 deadline, bytes calldata receiveSignature): Calls permitReceive and transfer atomically.
  • transferFromWithPermits(address from, address to, uint256 amount, SpendPermit calldata spendPermit, ReceivePermit calldata receivePermit): Combines ERC-2612 permit (from from, where SpendPermit carries {deadline, v, r, s} using on-chain nonces(from)), permitReceive (from to, where ReceivePermit carries {maxAmount, nonce, deadline, signature}), and transferFrom in one relayer transaction.

Compatibility with ERC-7943 (OPTIONAL β€” MAY)

Tokens implementing both this standard and ERC-7943 keep canReceive(from, to, amount) as the canonical recipient-gating check, with the following optional interaction:

  • canTransfer(address from, address to, uint256 amount): If implemented alongside this standard, canTransfer(from, to, amount) MUST return false whenever canReceive(from, to, amount) returns false.

Rationale

  • Opt-in vs. Opt-out: Opting in by default avoids breaking exchange withdrawals, bridges, and cold addresses that have never sent a transaction.
  • Hybrid Embedded + Policy Model: Embedded allow-lists require zero external calls for simple users, while optional IReceivePolicy delegation lets treasuries and power users maintain one shared allowlist across all supporting tokens.
  • Read-Only Policy Calls (staticcall + EIP-1153): Requiring IReceivePolicy.canReceive to be view (staticcall) eliminates reentrancy risk during _update, while still letting policies read EIP-1153 transient storage (TLOAD) populated earlier in the same transaction (e.g., signed allowlist tickets for 10,000+ senders without SSTORE bloat or Merkle privacy leaks).
  • Strictly One-Time Permits: Clearing the entire oneTimeReceiveLimit on the first matching transfer prevents a sender from splitting an authorized amount into multiple dust/spam transfers.
  • Burn Exemption (to == address(0)): Burns destroy tokens rather than delivering funds to a recipient; explicitly exempting to == address(0) ensures protected accounts can always burn or redeem their tokens without accidentally triggering receive checks.
  • Self-Transfer Exemption (from == to): Transfers where from == to cannot introduce tainted inflows, new senders, or lookalike address-poisoning logs, and exempting them avoids breaking net-zero internal/accounting flows in smart accounts and protocols.
  • Mint Gating (from == address(0)): Mints increase a recipient's balance and can still be used for unsolicited airdrops or accounting noise; gating from == address(0) keeps protection consistent while letting recipients explicitly allowlist address(0) or issue a permitReceive when expecting a mint.

Backwards Compatibility

This standard is a purely additive extension to ERC-20 and is compatible with any canonical ERC-20 implementation, wallet, DEX, or bridge:

  • Unchanged Canonical Interface: No existing ERC-20 function signatures (transfer, transferFrom, approve, balanceOf, allowance, totalSupply) or events (Transfer, Approval) are altered or removed. Support is discoverable via ERC-165 (supportsInterface).
  • Identical Default Behavior: Because accounts default to isReceiveProtected(account) == false, all existing EOAs, smart contracts, liquidity pools, and cold addresses behave identically to canonical ERC-20 unless they explicitly opt in.
  • Aggregator & Router Compatibility: Evaluating from rather than msg.sender in transferFrom ensures DEX routers, aggregators, and relayers work seamlessly without needing to be allow-listed themselves.
  • Revert Behavior for Protected Accounts: When isReceiveProtected(to) == true and a transfer is unauthorized, transfer and transferFrom revertβ€”consistent with ERC-20 transfer-restriction patterns (such as ERC-3643). Protocols executing push-based batch distributions to arbitrary recipients should pre-check canReceive(from, to, amount) or isolate/skip reverting transfers so one protected recipient cannot block the entire batch.

Reference Implementation

  • IERCProtectedReceiveCore.sol β€” Minimal required integrator core (MUST).
  • IERCProtectedReceiveOptIn.sol β€” Self-service opt-in toggle extension (SHOULD).
  • IERCProtectedReceiveLevel.sol β€” Optional granular bytes32 protection-level extension (MAY).
  • IERCProtectedReceiveSig.sol β€” Optional EIP-712 signature-based protection extension (MAY).
  • IERCProtectedReceiveAllowlist.sol β€” Optional embedded allowlist inspection extension (MAY).
  • IERCProtectedReceiveDenylist.sol β€” Optional embedded denylist inspection extension (MAY).
  • IERCProtectedReceivePermit.sol β€” Optional one-time EIP-712 receive permit extension (MAY).
  • IERCProtectedReceivePolicy.sol β€” External policy delegation extension (MAY).
  • IERCProtectedReceive.sol β€” Consolidating token interface (Core + OptIn + Level + Sig + Allowlist + Denylist + Permit + Policy).
  • IReceivePolicy.sol β€” External read-only policy interface.
  • ProtectedERC20.sol β€” Abstract OpenZeppelin v5-based ERC-20 + ERC-20 Permit implementation. Supports DENYLIST_PROTECTION_LEVEL (default-allow unless deny-listed) and uses the example precedence (0) embedded denylist hard veto β†’ (1) one-time receive permit β†’ (2) embedded allowlist β†’ (3) external IReceivePolicy (OR composition); other implementations may reorder (e.g., checking the embedded allowlist first to save an SLOAD on frequent transfers, or enforcing IReceivePolicy first/AND for compliance).
  • MultiTokenAllowlistPolicy.sol β€” Example multi-token shared allowlist registry supporting both persistent mappings and EIP-1153 transient Signed Allowlist Tickets for large sets: combines a single packed TicketConfig(signer, epoch) slot with TSTORE/TLOAD so senders can batch a 65-byte EIP-712 AllowlistTicket verification immediately before transfer/transferFrom, incurring zero permanent storage growth while supporting O(1) mass revocation (epoch++) and sparse per-sender early revocation.

Security Considerations

  • Fail-Closed Policy Calls: If an account configures a buggy or reverting IReceivePolicy, ProtectedERC20 catches the revert and treats the transfer as denied (false). The account owner can recover at any time by calling setReceivePolicy(address(0)) or setReceiveProtection(false).
  • Zero-Amount Transfers: Checks explicitly require oneTimeLimit > 0 so uninitialized storage (0) never authorizes a 0-value transfer.
  • Read-Only Policy Queries (staticcall): Querying IReceivePolicy.canReceive via staticcall guarantees at the EVM level that a malicious or buggy policy cannot mutate state or reenter the token during _update.
  • Pre-flight Divergence with Caller-Sensitive Policy data: If a token forwards caller-sensitive context (such as msg.sender) in data and an IReceivePolicy depends on it, pre-flight canReceive(from, to, amount) view calls (where _msgSender() is the querying UI/wallet) MAY return a different result than the subsequent transferFrom execution (where _msgSender() is a router or relayer). Policies SHOULD avoid depending on msg.sender unless that trade-off is explicitly intended.

Copyright and related rights waived via CC0.

EIP.tools

EIP.tools

Search, read, and map Ethereum improvement proposals, ERCs, RIPs, and CAIPs from one focused interface.

Farcaster
by @apoorveth