ERC-7984 Confidential fungible token
Draft · Tokens · created 2025-07-03
A standard that lets accounts send and receive tokens and delegate transfer authority to third parties under an account-based model, while hiding transfer amounts and balances from the public using bytes32 pointers.
Why it is needed
With existing fungible tokens like ERC-20, every account's balance and transfer amount is fully exposed on the blockchain for anyone to query. However, for use cases that must not reveal amounts, such as payroll, institutional settlement, or confidential DeFi, this transparency becomes an obstacle rather than a benefit. To address this, tokens are being built that hide amounts using different confidentiality technologies such as fully homomorphic encryption (FHE), zero-knowledge proofs, and secure enclaves, but without a common interface, each project ends up representing balances and transfers in its own way, forcing wallets, exchanges, and DeFi protocols to write separate integration code for every token.
What to implement
function name() external view returns (string memory): Returns the token's name.function symbol() external view returns (string memory): Returns the token's symbol.function decimals() external view returns (uint8): Returns the number of decimal places the token uses, as a plaintext uint8.function contractURI() external view returns (string memory): Returns the token's metadata URI.function confidentialTotalSupply() external view returns (bytes32): Returns a pointer to the total supply.function confidentialBalanceOf(address account) external view returns (bytes32): Returns a pointer to the balance of the specified account.function isOperator(address holder, address spender) external view returns (bool): Checks whether spender currently has authority to transfer on holder's behalf.function setOperator(address operator, uint48 until) external: Grants operator the authority to transfer on the caller's behalf until the specified time.function confidentialTransfer(address to, bytes32 amount) external returns (bytes32): Confidentially transfers amount from the caller's balance to to.function confidentialTransfer(address to, bytes32 amount, bytes calldata data) external returns (bytes32): Performs a confidential transfer while also carrying implementation-specific data, such as a proof.function confidentialTransferFrom(address from, address to, bytes32 amount) external returns (bytes32): The operator confidentially transfers from from's balance to to.function confidentialTransferFrom(address from, address to, bytes32 amount, bytes calldata data) external returns (bytes32): The operator performs a confidential transfer on someone else's behalf while carrying implementation-specific data.function confidentialTransferAndCall(address to, bytes32 amount, bytes calldata callData) external returns (bytes32): Calls a callback on the to contract after a confidential transfer.function confidentialTransferAndCall(address to, bytes32 amount, bytes calldata data, bytes calldata callData) external returns (bytes32): Performs a confidential transfer carrying implementation-specific data and callback callData, then invokes the callback.function confidentialTransferFromAndCall(address from, address to, bytes32 amount, bytes calldata callData) external returns (bytes32): The operator performs a confidential transfer on someone else's behalf, then calls a callback on the to contract.function confidentialTransferFromAndCall(address from, address to, bytes32 amount, bytes calldata data, bytes calldata callData) external returns (bytes32): The operator performs a confidential transfer on someone else's behalf carrying implementation-specific data, then invokes the callback.function onConfidentialTransferReceived(address operator, address from, bytes32 amount, bytes calldata data) external returns (bytes32 success);: A callback function that lets a contract receiving an AndCall transfer decide whether to accept the transfer.event ConfidentialTransfer(address indexed from, address indexed to, bytes32 indexed amount): Emitted whenever a confidential balance changes; from is the zero address on minting, and to is the zero address on burning.event OperatorSet(address indexed holder, address indexed operator, uint48 until): Emitted when the expiration time is set for a holder/operator pair.event AmountDisclosed(bytes32 indexed handle, uint256 amount): May be emitted when an amount hidden behind a pointer is disclosed via an implementation-specific mechanism.
In depth
Pointer-based amounts
In this standard, every amount is represented as a bytes32 pointer. The pointer is not an actual numeric value but merely a reference indicating that the value is stored somewhere on-chain or off-chain, and the way the pointer is resolved and manipulated differs by implementation. This design exists so that implementations using different privacy technologies, such as FHE (fully homomorphic encryption), zero-knowledge proofs, and secure enclaves, can all comply with the same interface.
Basic information lookup and ERC-165
Compliant tokens must implement ERC-165, and supportsInterface must return true for interface ID 0x4958f2a4. name(), symbol(), and decimals() return the token's name, symbol, and decimal places as a plaintext uint8, respectively. contractURI() returns the token's metadata URI, and it is recommended to follow the ERC-7572 schema. confidentialTotalSupply() and confidentialBalanceOf(account) return the total supply and per-account balance, respectively, as bytes32 pointers.
Operator model
Calling setOperator(operator, until) grants operator the authority to transfer tokens on the caller's behalf until the plaintext uint48 timestamp until. While authorized, the operator can transfer the holder's tokens with no amount limit, and a single account can have multiple operators at once. isOperator(holder, spender) checks whether the authorization is currently valid. A time-limited approach is used instead of an ERC-20-style approve with an amount limit, in order to remove the burden on external confidential computation systems of having to track approved amounts.
Confidential transfer function family
The confidentialTransfer(to, amount) overload, and the one that also takes data, move an amount from the caller's own balance to to, and may revert if the balance is insufficient. confidentialTransferFrom(from, to, amount) is a function where an operator moves funds from from's balance to to, and it must revert if the caller is not an operator for from. The data parameter is for implementation-specific information such as cryptographic proofs, and all transfer functions return a pointer to the amount actually moved.
AndCall callback flow
Functions in the confidentialTransferAndCall family invoke a callback on the to address after the transfer logic completes. If to has no code, the callback is treated as succeeding with no action. If it has code, onConfidentialTransferReceived is called with the operator, from, the actual amount transferred, and callData; if this call reverts, the entire transaction reverts. If the callback returns false, the token contract attempts to send the received tokens back to the original sender, but this return can fail if the receiving contract has already spent the tokens inside the callback.
Event
ConfidentialTransfer must be emitted every time a confidential balance changes, including transfers of zero amount, and from must be the zero address on minting while to must be the zero address on burning. OperatorSet must be emitted whenever the expiration time is set for a holder/operator pair, including via a setOperator call. AmountDisclosed may be emitted when a pointer-based amount is converted to a disclosed value via an implementation-specific mechanism.
Technology-agnostic design and proposal status
Making amount a bytes32 pointer rather than a number is a choice meant to keep the interface compatible regardless of which confidential technology is used, whether FHE, zero-knowledge proofs, or secure enclaves. This proposal is still in Draft status, so the detailed rules may change or discussion may stall.
Things to watch out for
- Dependence on the pointer mechanism: Since security depends on the underlying pointer-based mechanism, implementations must guard against side-channel attacks and properly manage key handling for off-chain computation.
- Callback reentrancy and gas griffing: AndCall-style callbacks carry reentrancy and gas griefing risks, so reentrancy guards and gas limits should be considered when using callbacks.