EIP-7503 · Stagnant · Core · 2023-08-14
EIP-7503: Zero-Knowledge Wormholes
A stagnant proposal for native ETH privacy: send ETH to a provably unspendable address derived from a secret, then later re-mint it to a fresh address with a zero-knowledge proof, so the deposit looks like an ordinary transfer.
What problem does it solve?
Mixers such as Tornado Cash hide the link between sender and receiver, but anyone who interacts with the mixer contract is visibly marked as having used it. That makes them easy to blacklist and gives senders no deniability.
EIP-7503 ("Zero-Knowledge Wormholes", also called private proof-of-burn) moves the privacy into the protocol. Depositing is just a plain EOA-to-EOA ETH transfer to an address that nobody can spend from. Later, a zero-knowledge proof shows that such a burn happened, without saying which one, and the protocol mints the same amount of ETH to a new address. Because every address with no outgoing transactions could be a burn address, the anonymity set is large by default.
How it works
- Deposit. Pick a random
secretand send ETH tosha256(0xfe ‖ secret)[12:]. An address that is the output of a hash, rather than of a public key or contract parameters, has no known private key, so the ETH is effectively burned. On-chain it looks like sending ETH to a friend. - Withdraw. Submit a new EIP-2718 transaction type carrying a ZK proof. The proof shows, privately, that a matching ETH transfer log exists under a recent beacon block root, that
deposit_value ≤ 32 ETH, and thatwithdraw_value + change_value == deposit_value. - Nullifier. The proof reveals
sha256(0x01 ‖ secret). The protocol stores it at a system address and rejects any second withdrawal with the same nullifier. - Change. You can withdraw part of a deposit. The remainder becomes a "change deposit" whose value is hidden behind a salted hash, so observers cannot subtract amounts to link deposits.
- Privacy pools. The proof also includes membership in a chosen list of deposits (a privacy-pool root), so honest users can show their funds come from an acceptable set.
- Anti-collision PoW.
sha256(0x02 ‖ secret)must end in 24 zero bits. Together with the 32 ETH cap this raises the cost of a hash-collision attack (an address that is both a burn address and a real contract) from about 2^80 to about 2^92 hashes.
If valid, the protocol creates withdraw_value ETH and makes a normal call with it, so minted ETH is indistinguishable from any other ETH and can pay gas.
Sample code
Deriving a burn address and checking the PoW condition (TypeScript, ethers v6):
import { sha256, concat, getAddress, dataSlice, randomBytes, hexlify } from "ethers";
const POW_LOG_DIFFICULTY = 24n;
function burnAddress(secret: Uint8Array): string {
const h = sha256(concat(["0xfe", secret])); // MAGIC_ADDRESS
return getAddress(dataSlice(h, 12)); // last 20 bytes
}
function powOk(secret: Uint8Array): boolean {
const h = BigInt(sha256(concat(["0x02", secret]))); // MAGIC_POW
return h % (1n << POW_LOG_DIFFICULTY) === 0n;
}
let secret: Uint8Array;
do { secret = randomBytes(32); } while (!powOk(secret)); // ~16M tries on average
console.log("secret :", hexlify(secret));
console.log("deposit :", burnAddress(secret));
console.log("nullifier:", sha256(concat(["0x01", secret])));
Things to know
- Status: Stagnant. It has not been scheduled for any upgrade, and several parameters (transaction type number, nullifier address, receipt prefix) are still
TBD, as are the reference implementation and circuit. - It depends on EIP-7708 (ETH transfers emit logs) and on receipts moving to SSZ, so the proof only needs SHA-256 Merkle branches. The circuit is expected to reuse a transparent setup such as the EIP-4844 KZG ceremony.
- The spec's own security note: a buggy implementation could let people mint unlimited ETH.
- ETH sent to a burn address is lost if the secret is lost; there is no recovery.