EIP-7503 Zero-knowledge wormhole (Zero-Knowledge Wormholes)

No call decision · Security & privacy · EIP status Stagnant · created 2023-08-14

A native privacy feature that burns ETH by sending it to an address no one can open, then lets it be spent again from a new address by proving that fact solely with a zero-knowledge proof.

Why it is needed

Mixers like Tornado Cash protect privacy, but the record of having interacted with the mixer contract itself remains on-chain, letting governments or exchanges easily flag and block senders and receivers. Eliminating the trail completely requires going through a trusted third party or a centralized exchange, which reduces decentralization. This EIP uses no smart contract calls at all; it 'burns' funds through nothing more than an ordinary EOA-to-EOA transfer of ETH to an address whose private key no one knows. Later, only someone who knows the secret value can prove with a zero-knowledge proof that the funds were actually at the burn address, and withdraw them from a new address, providing plausible deniability since participation itself cannot be proven externally.

What changes

Today

After EIP-7503

Who is affected

In depth

How the deposit address is generated

An Ethereum address can only be used if it equals keccak(s×G) for some secret key s, or if it is a smart contract whose parameter hash matches. Funds sent to any other random address are, in principle, permanently unusable. This EIP defines a deposit address as the lower 20 bytes of sha256(MAGIC_ADDRESS + secret). Only someone who knows the secret can tell that address was deliberately burned; to anyone else it looks like an ordinary random receiving address.

Withdrawal (minting) transaction and proof conditions

The payload of a new EIP-2718 transaction type (WormholeTxType) includes root_beacon_block_number and a zero-knowledge proof. The proof takes private inputs (secret, main_index, main_branch, privacy_pool_index, privacy_pool_branch, deposit_value, deposit_sender, change_value_salt, change_value) and public inputs (beacon_block_root, nullifier, privacy_pool_root, withdraw_value, change_value_hash) to verify that the deposit receipt lies on a Merkle path under the beacon block root, that nullifier==sha256(MAGIC_NULLIFIER+secret), and that change_value+withdraw_value==deposit_value. The transaction hash (excluding the proof) is included in the proof's randomness, so the proof also acts as a signature.

Preventing double withdrawal (nullifier)

To prevent the same deposit from being withdrawn twice, the nullifier is recorded in WORMHOLE_NULLIFIER_ADDRESS storage. Verification checks that SLOAD(WORMHOLE_NULLIFIER_ADDRESS, proof.nullifier)==0, and once processing finishes, SSTORE writes 1. Since the nullifier is derived from the secret, only the depositing party can produce it, while the secret itself is never revealed.

Partial withdrawal and change deposits

A deposit does not need to be withdrawn in full at once. If 20 ETH is deposited and only 12 ETH is withdrawn, the remaining 8 ETH is automatically registered as a new deposit whose amount is hidden behind change_value_hash==sha256(change_value_salt, change_value). From the outside, there is no way to sum the change deposit and the withdrawn amount to reverse-engineer the original deposit amount.

Preventing collision attacks via PoW and a 32 ETH cap

If an attacker finds a collision (x1, x2) such that create2_address(..., x1)==sha256(MAGIC_ADDRESS+x2), they could withdraw the same ether twice. This attack requires roughly 2^80 hashes, so the EIP adds a PoW condition, sha256(MAGIC_POW+secret) % 2^POW_LOG_DIFFICULTY(=24)==0, raising the difficulty to 2^92. Since Bitcoin block mining operates at around 2^79, the reasoning is that an attacker with that much hashing power would find mining Bitcoin more profitable. MAX_DEPOSIT (32 ETH) also caps the potential reward from the attack.

Dependency on EIP-7708 and SSZ receipts

This EIP requires EIP-7708 and an EIP that converts receipts to SSZ format to be applied first. make_receipt_hash is the SSZ hash of either EIP-7708's ETH transfer log or this EIP's own change log, and the proof only needs to verify that this log lies on a plain SHA256 Merkle path under the beacon block root. There is no need to embed complex verification logic like RLP or Berkeley trees inside the proof.

Privacy pool (optional)

The proof can also include privacy_pool_root, privacy_pool_index, and privacy_pool_branch to add a second Merkle proof showing that one's own deposit is within a designated list of deposits (a privacy pool). Because this check is integrated into the proof, it can be used at no extra cost, and the pool's value grows the more legitimate users adopt it together.

Implementation status and remaining risk

In the specification, WormholeTxType, WORMHOLE_NULLIFIER_ADDRESS, and RECEIPT_PREFIX are all TBD, and the reference implementation and ZK-SNARK implementation are also TBD. The source warns that an implementation bug could allow infinite minting of ether and collapse its price. The status is Stagnant, inclusion in a fork has not been decided, and there is no related call record.

Original EIP · ← EIPs