ERC-8085 Dual-mode fungible token (Dual-Mode Fungible Tokens)
Draft · Tokens · created 2025-11-15
A standard that lets a single token contract support both a transparent ERC-20 mode and a zero-knowledge-proof-based privacy mode, allowing holders to freely switch their balances between the two modes.
Why it is needed
When creating a new token, a project had to choose one of two options. Using ERC-20, where everything is visible transparently, integrates well with the DeFi ecosystem but offers no privacy at all, while using a pure privacy protocol keeps things private but limits integration with the existing ecosystem. A DAO wants its treasury operations to be visible transparently but wants voting to be anonymous, a company wants its accounting to be auditable and public while keeping payroll payments private, and ordinary users want to participate in DeFi while hiding their personal holdings. The existing wrapper-based privacy pools created two separate tokens, the original token and the wrapped token, splitting liquidity in two, and users had to go through the hassle of unwrapping again to use DeFi. This approach works for tokens that are already deployed, but for tokens being newly issued right now, a better way was needed to build privacy in as a core feature from the start.
What to implement
function totalSupply() external view override(IERC20, IZRC20) returns (uint256);: Returns the total supply combining public mode and privacy mode.function totalPrivacySupply() external view returns (uint256);: Returns the total supply in privacy mode.function isNullifierSpent(bytes32 nullifier) external view returns (bool);: Checks whether a specific nullifier has already been used.
In depth
Definitions of the two modes
This standard clearly distinguishes between transparent mode and privacy mode. Transparent mode stores balances the standard ERC-20 way, so anyone can look them up with balanceOf(). Privacy mode hides the amount and owner using a cryptographic commitment, recorded in the Privacy State, an authenticated data structure (e.g. a Merkle tree) that tracks them. The value that proves a commitment has already been used is the nullifier, which prevents the same commitment from being used twice. The process of moving value between the two modes is called Mode Conversion, and when converting from privacy to public mode, it must go through BURN_ADDRESS, an unusable elliptic curve point, to be safe.
ERC-20 functions only operate in transparent mode
Implementing this standard requires implementing all of ERC-20, and balanceOf(), transfer(), approve(), and transferFrom() all apply only to transparent mode balances. Privacy mode balances are hidden and are not included in balanceOf(). totalSupply() must return the sum of all transparent balances plus totalPrivacySupply(). Standard ERC-20 Transfer events must also be emitted during mode conversion: toPrivate() emits Transfer(account, address(0), amount), and toPublic() emits Transfer(address(0), recipient, amount).
Supply invariant
An implementation must always maintain totalSupply() == sum(all balanceOf()) + totalPrivacySupply(). totalPrivacySupply() is not computed from commitment values in the Merkle tree (since commitment values are encrypted and cannot be computed), but is tracked separately, incrementing when toPrivate() is called and decrementing when toPublic() is called. If the public mode supply is needed, it can be obtained as totalSupply() - totalPrivacySupply(), so no separate totalPublicSupply() function is provided.
Mode conversion functions and proofType
toPrivate() takes amount, proofType, proof, and encryptedNote, burns the transparent balance, and generates an IZRC20-style privacy commitment. toPublic() takes recipient, proofType, proof, and encryptedNotes (an array), verifies the proof that consumes the privacy note, mints transparent tokens to the recipient, and returns any change as encryptedNotes. The proofType parameter allows an implementation to support multiple proof strategies, for example letting it accept proofs suited to different data structures or optimization strategies, such as an active tree versus an archival tree.
Safely moving value via BURN_ADDRESS
The ZK circuit only enforces the value conservation rule that input amounts must equal output amounts, and has no awareness that the value is moving into public mode. That's why toPublic() requires the first output to be sent to BURN_ADDRESS, which has no owner and can never be used again. For example, taking a note worth 100 as input, outputting 50 to BURN_ADDRESS and 50 in change to the user satisfies the circuit condition (100 = 50 + 50), while the 50 sent to BURN_ADDRESS is permanently unusable, and the contract mints a new public balance of 50 to the user in exchange. This way, total supply stays constant during mode conversion and is only redistributed between modes.
Backwards compatibility with ERC-20 and ERC-8086
This standard inherits from both ERC-20 and ERC-8086 (IZRC20), making it fully backwards compatible. All ERC-20 functions and events operate as-is in transparent mode, so existing wallets, DEXs, and DeFi protocols can use public mode without any modifications. Privacy-related functions and events are provided as-is from ERC-8086's IZRC20, with privacy mode added as an additional, optional feature.
Limitations: new tokens only, exposure on conversion
This standard is not designed to add privacy to already-deployed tokens, but to build privacy in from the start for newly issued tokens. Also, privacy mode balances cannot interact directly with DEXs or DeFi, so using DeFi requires first converting via toPublic(), and this conversion process has the limitation of revealing the amount in an on-chain event.
Proposal status
This standard is a Draft proposal written in November 2025, has not yet been finalized, and its content may change or discussion may stall.
Things to watch out for
- BURN_ADDRESS verification omission attack: If an implementation fails to verify that the toPublic() output truly goes to an unusable address, an attacker could send the proof's output to their own privacy address while still receiving a public balance. This would leave a still-usable note in privacy mode while also creating a new public balance, allowing a single note worth 100 to generate value like 50+50+50. Implementations must verify that the toPublic() output is sent to an unusable address.
- Preventing double payment: Double spending in transparent mode is prevented by standard ERC-20 balance checks, while in privacy mode the uniqueness of the nullifier derived from each commitment must be enforced on-chain to prevent the same commitment from being used twice.
- Preventing supply inflation: To prevent malicious proofs claiming false values, the ZK circuit must enforce value conservation, and the verifier contract must verify the proof on-chain before changing state. The invariant between totalSupply() and the sum of balances and privacy supply must always be maintained after every operation.