ERC-8065 Zero-knowledge token privacy wrapper (Zero Knowledge Token Wrapper)
Draft · Tokens · created 2025-10-18
This standard lets anyone wrap existing tokens such as ERC-20, ERC-721, ERC-1155, and ERC-6909 to add privacy features. This function breaks traceability through provable burn-and-remint.
Why it is needed
Most tokens lack privacy features due to regulation, technical limitations, or issuer indifference. Users who want privacy must rely on dedicated privacy blockchains or privacy-specific dApps, which reduces the token's usability and harms composability with the existing ecosystem. In addition, the range of supported token types is often limited, and whitelisting is frequently enforced or the privacy method itself is constrained. In the end, users have no way to add privacy while continuing to use the tokens they already hold, and their fund flows and holdings remain traceable by anyone.
What to implement
event CommitmentUpdated(uint256 indexed id, bytes32 indexed commitment, address indexed to, uint256 amount);: This optional event may be emitted when a commitment managed by the contract is updated.event Deposited(address indexed from, address indexed to, uint256 indexed id, uint256 amount);: Signals that the original token has been deposited and the corresponding amount of ZWToken has been minted to the recipient.event Withdrawn(address indexed from, address indexed to, uint256 indexed id, uint256 amount);: Signals that ZWToken has been burned and the original token has been returned to the recipient.event Reminted(address indexed from, address indexed to, uint256 indexed id, uint256 amount, bool redeem);: Signals, via a zero-knowledge proof, that ZWToken has been reminted or the original token has been withdrawn.function deposit(address to, uint256 id, uint256 amount, bytes calldata data) external payable;: Deposits the original token and mints the corresponding amount of ZWToken to the specified address.function withdraw(address to, uint256 id, uint256 amount, bytes calldata data) external;: Burns ZWToken and returns the corresponding amount of the original token to the specified address.function previewDeposit(address to, uint256 id, uint256 amount, bytes calldata data) external view returns (uint256);: Precomputes the actual amount of ZWToken that will be received on deposit, net of fees.function previewWithdraw(address to, uint256 id, uint256 amount, bytes calldata data) external view returns (uint256);: Precomputes the actual amount of the original token that will be received on withdrawal, net of fees.function previewRemint(address to, uint256 id, uint256 amount, RemintData calldata data) external view returns (uint256);: Precomputes the actual amount of ZWToken or the original token that will be received on remint, net of fees.function getLatestCommitment(uint256 id) external view returns (bytes32);: Returns the most recent top-level commitment (root hash) for the given token identifier.function hasCommitment(uint256 id, bytes32 commitment) external view returns (bool);: Checks whether a specific top-level commitment exists in the contract.function getCommitLeafCount(uint256 id) external view returns (uint256);: Returns the total number of stored commitment leaves.function getCommitLeaves(uint256 id, uint256 startIndex, uint256 length) external view returns (bytes32[] memory commitHashes, address[] memory recipients, uint256[] memory amounts);: Looks up leaf-level hash, recipient, and amount data in the commitment tree.function getUnderlying() external view returns (address);: Returns the address of the original token contract wrapped by this ZWToken. For ETH this is address(0).
In depth
Wrapping and commitment-based privacy layer
ZWToken adds a commitment-based privacy layer on top of the original token standard without modifying it. The commitment mechanism can be implemented with Merkle trees, cryptographic accumulators, or other verifiable cryptographic structures. ZWToken preserves the original token's properties such as transferability, tradability, and composability while maintaining interoperability with existing Ethereum infrastructure.
Provably burned address
The burn address to which ZWToken is sent must be provably unmanipulable by any user and must be provably unrelated to any externally owned account (EOA) or smart contract. This address can only be derived by its originator, for example through a signature-based or deterministic generation method. Once ZWToken is sent to such an address, it becomes eligible to be reminted via the remint interface, and in this process the traceability of the fund flow is broken.
Privacy differences between FTs and NFTs
Fungible tokens (FTs) such as ERC-20 can break fund-flow traceability through the burn-and-remint process. Non-fungible tokens (NFTs) such as ERC-721, on the other hand, are each unique and cannot participate in coin mixing, so the traceability of the fund flow itself cannot be broken. However, using a provably burned address can still hide the actual owner until the holder performs a withdrawal.
deposit and withdraw
deposit has the caller transfer the original token (or ETH) to the contract and then mints ZWToken to the specified address; the minted amount may be reduced by fees, and a Deposited event must be emitted on success. withdraw does the reverse, burning ZWToken and returning the original token while emitting a Withdrawn event. For tokens without an id, such as ERC-20, the id value must always be set to 0.
remint and nullifiers
remint takes a RemintData struct (commitment, nullifiers, proverData, relayerData, redeem, proof) and uses a zero-knowledge proof to verify ownership of the burn address and the correctness of public inputs such as to, id, and amount. The provided commitment must exist, and the nullifiers must not have been used before; the transaction must revert if they are reused. Multiple nullifiers can be included in a single proof to enable batch remints. If redeem is false, ZWToken is minted; if true, the original token is withdrawn directly; in both cases a Reminted event is emitted.
Two commitment schemes
Contract-level commitments have the contract directly manage the Merkle root and similar data, which simplifies the proof circuit and makes proof generation possible even in a browser or on mobile, but costs more gas per transfer. Protocol-level commitments use Ethereum's native MPT state root or block hash directly, which carries no on-chain maintenance cost, but makes off-chain proof generation more complex.
Reissuance via relayer
remint supports a structure in which a third-party relayer submits the transaction on the user's behalf and receives a fee. This is designed to mitigate the privacy leak that occurs when paying gas directly, which exposes the original sender's address. The fee structure and the encoding of proverData and relayerData are both implementation-dependent and are not defined directly by this standard.
Proposal status
This ERC is currently in Draft status, not yet finalized, and its contents may change or the proposal may be discontinued.
Things to watch out for
- Preventing double reissuance: Each remint must include at least one unique nullifier, reusing an already-used nullifier must revert the transaction, and on success all provided nullifiers must be marked as used.
- Over-issuance protection: ZWToken's total supply may temporarily exceed the original token's supply, but the excess is provably and permanently burned, removed from circulation, and cannot be withdrawn.
- Local proof generation: The circuit should be made as small and efficient as possible so that users can generate zero-knowledge proofs directly on a browser or mobile device, reducing reliance on third-party provers that carry privacy leak risk.
- Separating burn and reissuance timing: Burn amounts must not be distinguishable from ordinary transfers, burn and reissuance events must be separated in time to reduce linkage inference, and each burn operation must use a unique, single-use burn address.
- Commitment data privacy: When generating a proof, users should fetch as much commitment data as possible. Relying only on limited or selective data sources can allow the specific path being proven to be inferred, weakening privacy guarantees.