ERC-8086 Privacy token base interface (Privacy Token)
Draft · Tokens · created 2025-11-19
Defines a minimal common interface (IZRC20) for privacy tokens that hide the transaction amount, sender, and recipient. Wrappers that add privacy to existing tokens and tokens that support both public and private modes build on top of this.
Why it is needed
Ethereum transactions are public by default, revealing who sent how much to whom. Several privacy projects already try to obscure this, but without a standard, each builds its own token logic from scratch. The original text points out that this leads to incompatible implementations, duplicated work, and greater security risk. There is also a client-side problem. Because proof systems, cryptographic algorithms, and tree structures differ across implementations, wallets must be developed separately for each token, making it impossible to build a general-purpose wallet that handles any privacy token, fragmenting the ecosystem. This standard aims to solve this by bundling the common principles of commitments, nullifiers, and encrypted notes into a single minimal interface, while exposing implementation-specific details through a configuration file.
What to implement
event NullifierSpent(bytes32 indexed nullifier);: Occurs when a nullifier is used (a note is spent). A nullifier that has been used once cannot be used again.function name() external view returns (string memory);: Returns the token name. Optional but recommended.function symbol() external view returns (string memory);: Returns the token symbol. Optional but recommended.function decimals() external view returns (uint8);: Returns the number of decimal places (usually 18). Used for displaying amounts.function totalSupply() external view returns (uint256);: Returns the total supply across all notes combined. Individual balances remain private; only the sum is visible.function nullifiers(bytes32 nullifier) external view returns (bool);: Looks up whether a given nullifier has already been used.function activeSubtreeRoot() external view returns (bytes32);: Returns the Merkle root of the currently active subtree. Used to quickly generate proofs for recent commitments.function privacyConfigURI() external view returns (string memory);: Returns a URI pointing to the privacy configuration file. It contains implementation-specific information needed for client integration.function setPrivacyConfigURI(string calldata configURI) external;: Sets or updates the configuration file URI. Implementations may restrict access, for example to the owner only.
In depth
Private balances built from commitments, nullifiers, and notes
This standard does not record balances against addresses. Instead, it accumulates commitments, which are cryptographic values that hide both the amount and the owner, in an append-only Merkle tree. The information the recipient needs to know, (amount, publicKey, randomness), is encrypted into a note and delivered off-chain. When a note is spent, a unique identifier called a nullifier is revealed, which proves that some commitment was spent without revealing which one, preventing double spending. Anyone can check whether a given nullifier has already been used via the nullifiers(bytes32) view function.
Four things a transfer proof must establish
The zero-knowledge proof included in transfer(uint8 proofType, bytes proof, bytes[] encryptedNotes) must establish four things. First, that the input commitment exists in the Merkle tree. Second, that the prover knows the corresponding private key. Third, that the nullifier has not yet been used. Fourth, that the amount-preservation condition sum(inputs) = sum(outputs) holds. mint(uint8 proofType, bytes proof, bytes encryptedNote) is a payable function whose proof must establish correct commitment creation and payment, with the specific minting rules defined by each implementation.
Routing multiple proof strategies via proofType
proofType (uint8), the first argument to mint and transfer, is a mechanism for supporting multiple proof strategies within a single function signature. A simple single-tree implementation only needs one proof type, but a dual-layer implementation may require different proofs for active state and archived state. The contract routes the proof to the appropriate verifier based on the proofType value. This allows new proof types to be added later without breaking the existing contract interface, achieving both interface stability and implementation flexibility.
Events and receipt scanning: encrypted notes and view tags
Since recipients are not identified by an on-chain address, they must scan events to find their share. The Transaction event discloses the new commitment(s) (usually one or two), the encrypted note, the ephemeral public key for ECDH key exchange (ephemeralPublicKey), and the view tag (viewTag). Without a view tag, every transaction would need to be decrypted and tried individually, which is expensive, but a single byte of tag data lets candidates be filtered quickly. The source describes this as a tradeoff between minor metadata exposure and practicality, and implementations that do not use it set it to 0. Separately, commitment additions are announced via CommitmentAppended, nullifier spends via NullifierSpent, and direct minting via the Minted event.
Privacy guarantees implementations must uphold
Implementations MUST guarantee four kinds of privacy. Amount privacy means transaction amounts are not exposed in events or storage; sender privacy means the sender's identity is not linkable across transactions; recipient privacy means the receiving address is not disclosed. Finally, for balance privacy, there must be no balance-lookup function such as balanceOf(address). Individual balances remain fully private, and even when totalSupply() is provided, only the aggregate is visible.
Choosing a tree structure: single tree vs. dual-layer tree
There are two options for state management, and the implementation must document its choice. A single tree accumulates all commitments chronologically into one tree, which is simple but makes proof generation more expensive as the tree grows. The recommended dual-layer tree splits this into an active subtree holding recent commitments (e.g., height 16) and a root tree holding the roots of finalized subtrees (e.g., height 20). This makes proofs for ordinary operations 2 to 3 times faster, and a 16x20 configuration can hold 68.7 billion notes, giving decades of capacity. activeSubtreeRoot() returns the root of the subtree currently being worked on, and single-tree implementations set subtreeIndex to 0 in their events.
Solving client compatibility with a privacy configuration file
Keeping the interface minimal comes at the cost that the proof system (Groth16, PLONK, STARK, etc.), circuits, encryption scheme, and tree structure can differ across implementations. The privacy configuration file, inspired by the registration file pattern in ERC-8004, fills this gap. privacyConfigURI() returns a URI in one of the forms ipfs://, https://, ar://, or data:, and the referenced JSON document contains required fields type, version, proofSystem, treeConfig, circuits, noteEncryption, hashFunction, along with optional fields keyDerivation and endpoints. Clients read the circuit file (WASM, ZKEY) addresses, the public signal schema, the note encryption algorithm, and the hash function from this file, allowing them to interact with any compatible token. All public signal values must be verified to be smaller than proofSystem.fieldSize.
Optional features and the standard's current status
name(), symbol(), and decimals() are optional but recommended for wallet display and ERC-20-compatible experience. totalSupply() is also optional; it should be provided when disclosing the aggregate is needed, such as for verifying a fixed supply, DAO treasuries, or tracking total deposits in wrapper protocols, and can be omitted to maximize privacy. This proposal, meanwhile, is in Draft status as of November 19, 2025. Its content may still change and it should be understood that this is not yet a finalized standard.
How upper-layer protocols build on this standard
This standard does not replace wrapper or dual-mode protocols; it provides the foundation for them. In the wrapper pattern, a user deposits an existing ERC-20 such as DAI into a wrapper contract, the wrapper mints a privacy token via IZRC20.mint, the user makes private transfers via IZRC20.transfer, and withdrawal returns the original token. The dual-mode pattern envisions a single contract implementing both ERC20 and IZRC20, adding mode switches such as toPrivacy()/toPublic(). The advantage of standardization is that the public mode remains compatible with existing DeFi while the private mode remains compatible with privacy wallets.
Things to watch out for
- Ensuring nullifier uniqueness: Accepting the same nullifier twice results in double spending, where a single commitment is spent multiple times. The source gives the example of spending a 100-token note twice with the same proof to create 200 tokens. Implementations must permanently record used nullifiers and reject duplicates, and nullifiers must never expire or be deleted.
- Verifying proofs: Attacks that create unauthorized commitments with invalid proofs or spend notes without authorization must be prevented. All zero-knowledge proofs must be verified on-chain before state changes, verifier contracts generated by a trusted ZK framework must be used, all public signals must be checked against the current contract state, and proofs must be routed to the correct verifier based on proofType.
- Merkle tree integrity: Modifying or deleting commitments in the tree invalidates all existing proofs and allows transaction history to be erased. The commitment tree must be append-only, commitment addition and root updates must occur atomically, and a proof's old root must be checked against the current state. Dual-layer implementations must verify both the active root and the finalized root during state transitions.
- Circuit soundness: A malicious circuit with improperly enforced constraints allows token minting or fund theft. Circuits must enforce amount preservation (sum of inputs = sum of outputs), Merkle membership of input commitments, nullifier binding derived from the commitment and private key, and consistency between public signals and on-chain state. Audited circuits and a trusted setup ceremony (or a transparent setup method) must be used.