ERC-8085 · Draft · ERC · 2025-11-15
ERC-8085: Dual-Mode Fungible Tokens
A token design where one contract holds both a normal ERC-20 balance and a zk-SNARK-shielded balance, letting holders move value between public and private mode without a separate wrapped token.
What problem does it solve?
A new token usually has to pick one of two options: ERC-20, which plugs into every wallet and DEX but exposes every balance and transfer, or a privacy protocol, which hides activity but lives apart from DeFi. Wrapping a public token into a privacy pool works, but creates a second token, splits liquidity and adds unwrap friction.
ERC-8085 proposes a "dual-mode" token: a single contract and a single address, where each holder chooses per use whether value sits in transparent mode (plain ERC-20) or privacy mode (shielded notes based on ERC-8086).
How it works
- The contract implements both
IERC20and the ERC-8086 privacy interfaceIZRC20. - ERC-20 functions only see public balances.
balanceOf,transfer,approveandtransferFrombehave exactly as normal. Private holdings never appear inbalanceOf. toPrivate(amount, proofType, proof, encryptedNote)burns public tokens (emittingTransfer(account, 0x0, amount)) and inserts a hidden commitment, proven correct with a zk-SNARK.toPublic(recipient, proofType, proof, encryptedNotes)spends private notes (marking their nullifiers as used) and mints public tokens torecipient(emittingTransfer(0x0, recipient, amount)).- Supply invariant:
totalSupply() == sum(balanceOf) + totalPrivacySupply().totalPrivacySupply()is a running counter updated on conversions, so only the aggregate private supply is visible. - Private-to-private transfers use the
IZRC20transfer inherited from ERC-8086.proofTypelets an implementation support several proof/tree variants.
The key safety rule: when converting to public, the circuit must send the converted amount to a provably unspendable BURN_ADDRESS note. Otherwise the same value could be spent again privately, minting tokens out of nothing.
Sample code
User flow with ethers v6. Proofs are generated off-chain by the implementation's prover; the snippet only shows the contract calls:
import { Contract, parseUnits } from "ethers";
const abi = [
"function balanceOf(address) view returns (uint256)",
"function totalSupply() view returns (uint256)",
"function totalPrivacySupply() view returns (uint256)",
"function toPrivate(uint256 amount, uint8 proofType, bytes proof, bytes encryptedNote)",
"function toPublic(address recipient, uint8 proofType, bytes proof, bytes[] encryptedNotes)",
];
const token = new Contract(tokenAddress, abi, signer);
// shield 100 tokens
const amount = parseUnits("100", 18);
const { proof, encryptedNote } = await prover.proveDeposit(amount); // implementation-specific
await token.toPrivate(amount, 0, proof, encryptedNote);
// later: unshield to a fresh address for DeFi use
const out = await prover.proveWithdraw(parseUnits("40", 18)); // implementation-specific
await token.toPublic(freshAddress, 0, out.proof, out.encryptedNotes);
Things to know
- Status: Draft, and it depends on ERC-8086, also a Draft. Interfaces and circuits may change.
- It is aimed at new tokens. Existing tokens cannot gain a privacy mode this way; wrapper-based pools fill that role.
- Conversions are public: the amount and the recipient of
toPublicare visible on-chain, which limits privacy around entry and exit. - DeFi only sees public balances. You must convert to public before trading or lending.
- Security rests on the verifier and circuits, especially nullifier uniqueness and the burn-address check. Treat any implementation as unaudited until proven otherwise.