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:
- Address poisoning and dust/spam transfers: Attackers send zero-value or dust transfers from lookalike addresses to pollute transaction history.
- 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.
- 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
- Opt-In Default: Fresh accounts MUST default to
isReceiveProtected(account) == false. Unprotected accounts MUST accept incoming transfers and mints with standard ERC-20 semantics. - Economic Sender Attribution: When
tohas enabled protection (isReceiveProtected(to) == true), checks MUST evaluatefrom(the economic sender), NOTmsg.sender(which may be a DEX router or spender intransferFrom). - Exemptions & Minting:
- Burns (
to == address(0)) MUST NOT be blocked by receive protection. - Self-transfers (
from == to) MUST be allowed even whentois protected. - Mints (
from == address(0)) MUST be subject toto's protection rules;address(0)MAY be allow-listed or permitted viapermitReceive.
- Burns (
- Authorization: When
to != address(0),from != to, andisReceiveProtected(to) == true, the evaluation order and composition (ORvs.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 to0(strictly single-use, even for partial amounts). - If an external
IReceivePolicyis queried, it MUST be invoked viastaticcalland MUST fail closed (treatfalseor 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:
Opt-In Toggle Extension (RECOMMENDED β SHOULD)
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 nonceMUST provide single-use replay protection peraccount, 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βleavingSfunded 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
Suntil after scanning the announcement,Sremains unprotected between the funding tx and the relayedsetReceiveProtectionWithSigtx.)
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 recipienttoitself or a designated delegated signer configured forto(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,
permitReceiveuses arbitrary unordereduint256nonces scoped per recipientto. Implementations MUST mark each consumednonceas used, MUST report that status viaisReceiveNonceUsed(to, nonce), and MUST revert withInvalidReceiveNonce(to, nonce)if anoncehas already been used. As a gas-efficient reference pattern (likePermit2), implementations MAY store nonces in an unordered 256-bit bitmap indexed bywordPos = uint248(nonce >> 8)andbitPos = 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 = 0for warm-slot packing,wordPos = uint248(uint160(from))for per-sender isolation, or a randomuint248wordPosfor stateless multi-device issuance). - Unlimited Cap: Signing
maxAmount = type(uint256).maxpermits any single transfer amount once. - Zero-Address Checks: Implementations MUST revert if
toisaddress(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 == 0orexpiry <= block.timestampmeans not actively denied;expiry > block.timestampblocksfromuntilexpiry;type(uint40).maxdenotes a permanent block. - Other Deny Rules: Minimum-amount dust filters, rate limits, or taint
screening belong in
IReceivePolicyandIERCProtectedReceiveLevel.
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): CallspermitReceiveandtransferatomically.transferFromWithPermits(address from, address to, uint256 amount, SpendPermit calldata spendPermit, ReceivePermit calldata receivePermit): Combines ERC-2612permit(fromfrom, whereSpendPermitcarries{deadline, v, r, s}using on-chainnonces(from)),permitReceive(fromto, whereReceivePermitcarries{maxAmount, nonce, deadline, signature}), andtransferFromin 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 returnfalsewhenevercanReceive(from, to, amount)returnsfalse.
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
IReceivePolicydelegation lets treasuries and power users maintain one shared allowlist across all supporting tokens. - Read-Only Policy Calls (
staticcall+ EIP-1153): RequiringIReceivePolicy.canReceiveto beview(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 withoutSSTOREbloat or Merkle privacy leaks). - Strictly One-Time Permits: Clearing the entire
oneTimeReceiveLimiton 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 exemptingto == address(0)ensures protected accounts can always burn or redeem their tokens without accidentally triggering receive checks. - Self-Transfer Exemption (
from == to): Transfers wherefrom == tocannot 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; gatingfrom == address(0)keeps protection consistent while letting recipients explicitly allowlistaddress(0)or issue apermitReceivewhen 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
fromrather thanmsg.senderintransferFromensures DEX routers, aggregators, and relayers work seamlessly without needing to be allow-listed themselves. - Revert Behavior for Protected Accounts: When
isReceiveProtected(to) == trueand a transfer is unauthorized,transferandtransferFromrevertβconsistent with ERC-20 transfer-restriction patterns (such as ERC-3643). Protocols executing push-based batch distributions to arbitrary recipients should pre-checkcanReceive(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 granularbytes32protection-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. SupportsDENYLIST_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(ORcomposition); other implementations may reorder (e.g., checking the embedded allowlist first to save anSLOADon frequent transfers, or enforcingIReceivePolicyfirst/ANDfor 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 packedTicketConfig(signer, epoch)slot withTSTORE/TLOADso senders can batch a 65-byte EIP-712AllowlistTicketverification immediately beforetransfer/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,ProtectedERC20catches the revert and treats the transfer as denied (false). The account owner can recover at any time by callingsetReceivePolicy(address(0))orsetReceiveProtection(false). - Zero-Amount Transfers: Checks explicitly require
oneTimeLimit > 0so uninitialized storage (0) never authorizes a0-value transfer. - Read-Only Policy Queries (
staticcall): QueryingIReceivePolicy.canReceiveviastaticcallguarantees 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 asmsg.sender) indataand anIReceivePolicydepends on it, pre-flightcanReceive(from, to, amount)view calls (where_msgSender()is the querying UI/wallet) MAY return a different result than the subsequenttransferFromexecution (where_msgSender()is a router or relayer). Policies SHOULD avoid depending onmsg.senderunless that trade-off is explicitly intended.
Copyright
Copyright and related rights waived via CC0.
