Halo2 Privacy Frames

Private withdrawals that pay their own gas, with Halo2 proofs in EIP-8141 frame transactions

Halo2 Privacy Frames

Created At

ETHGlobal Mumbai

Project Description

Private withdrawals that pay their own gas.

Halo2 Privacy Frames is a privacy pool for ETH, running on the Ethereum Foundation's EIP-8141 frame-transaction devnet. You deposit 0.1 ETH, then later withdraw it to any address, even a brand-new one that has never held ETH. There is no relayer, no gas top-up, and nothing on chain linking the two addresses.

The problem Every privacy pool (Tornado Cash, Privacy Pools, Railgun) breaks at the last step: gas. To withdraw to a fresh address, that address needs ETH to pay for the transaction. So you either fund it first, which links it to you on chain, or you hand the withdrawal to a relayer: a third party that can censor you, takes a fee, and sees your IP address and timing. On top of that, the RPC calls a wallet makes while looking for its deposits tell the RPC provider who you are.

What we built EIP-8141 lets a contract be a transaction's sender, as long as a VERIFY frame approves it. We use that to make the pool contract the sender and gas payer of its own withdrawals. Instead of a signature, the VERIFY frame checks a Halo2 zero-knowledge proof that you know the secret of a deposit in the pool, made for this exact recipient and fee, and that the deposit has not been spent. A second frame then marks the deposit spent and pays 0.1 ETH minus the fee to the recipient. The pool keeps the fee, which covers the gas it just paid. The proof is generated in your browser, and Halo2 needs no circuit-specific trusted setup: it uses the public Perpetual Powers of Tau parameters. Every request the page makes goes through Anon-RPC (the Nox mixnet by default), so RPC providers and the mempool don't see your IP.

What using it looks like

  1. Deposit: the page keeps a throwaway devnet wallet, fills it from the faucet and deposits 0.1 ETH. You get a note: a secret string that is the only key to the deposit and never leaves your browser.
  2. Withdraw: paste the note, click New address for a recipient with zero balance and zero history, and click Withdraw privately. A timeline shows each step. The tab rebuilds the pool's deposit tree from chain events, rebuilds the Halo2 proving key and checks it against the on-chain verifier, sizes the fee, proves in about 12 seconds, and dry-runs the transaction. It then shows the canonical mempool refusing it and sends it to the ERC-8421 alternative mempool, which admits it. The fresh address receives 0.1 ETH minus a fee of about 0.00035 ETH.
  3. Every request the page made is listed at the bottom, with the network path it took.

Why it needs the alternative mempool Checking the proof costs about 292k gas inside the validation frame. Nodes simulate validation for free before a transaction pays anything, so the canonical mempool caps validation at 100k gas and refuses the withdrawal. The ERC-8421 alternative mempool raises that cap for staked senders, and the pool stakes itself. This is the use case the alternative mempool exists for: validation that is expensive but bounded, priced through stake and reputation instead of banned outright.

What keeps it safe

  • The proof binds the recipient and the fee, so anyone who copies a pending withdrawal can only deliver the same payout to the same address.
  • The VERIFY frame pins the exact transaction shape, so nobody can make the pool call anything else or move value.
  • The transaction's maximum gas cost must be at most the fee, so a withdrawal can never cost the pool money.
  • Nullifiers block double spends, and the payout cannot fail after approval: a recipient that refuses ETH is credited instead.
  • There is no relayer and no backend. The app is a static page anyone can host.

Status Live on the EIP-8141 devnet (chain 1337), pool 0x0a7d37e6f58d3e83a5a0655fc5aeec3372e781b6. Withdrawals have executed on chain to never-funded addresses, with the proof made in the browser. The latest landed in block 5245 (0x349dc26d99cbfd3176616f3b4a95b0db3975875be5e42df8044f7977a5626748). The alternative mempool admits withdrawals with every admission rule passing, after we reported that its validation blocked the verifier's precompiles and EF enabled them. During the hackathon the devnet's mempool node stopped forwarding admitted transactions to the block builder. So the app waits 30 seconds, then includes the same transaction through ethrex's privileged submission, a devnet shortcut, and says so on screen.

Limits and next steps Devnet only and unaudited. One fixed denomination (0.1 ETH). The anonymity set is every deposit in the pool, still small on a devnet, and deposit and withdrawal timing is up to the user. Next: association sets (Privacy Pools-style proofs that a withdrawal isn't linked to flagged deposits), partial withdrawals, and faster multi-threaded proving in the browser.

How it's Made

Halo2 Privacy Frames is a shielded pool whose withdrawals pay their own gas. Each withdrawal is an EIP-8141 frame transaction in which the pool contract is both the sender and the gas payer, and a Halo2 proof replaces the signature.

Circuit and prover (Rust): halo2-base (Axiom's halo2-lib), KZG on BN254. A circomlib-compatible Poseidon gadget and a depth-20 Merkle tree prove that a deposit is in the pool and derive its nullifier, binding the recipient and fee as public inputs (2^15 rows, ~82k cells). Poseidon exists three times (Rust, TypeScript, Solidity), all checked against circomlib's test vectors. snark-verifier generates a SHPLONK/Keccak Solidity verifier: a 1,984-byte proof verifies for 292k gas on the devnet. The setup is Axiom's Perpetual Powers of Tau file, so there is no circuit-specific ceremony. The same prover compiles to WASM and runs in a Web Worker: the browser rebuilds the proving key from public parameters in ~5 s, checks that its verifying key matches the on-chain verifier, and proves in ~12 s.

Contracts (Solidity): the pool's VERIFY frame uses the new introspection opcodes (TXPARAM, FRAMEPARAM, FRAMEDATALOAD, via EF's hegota-support) to read the nullifier hash, recipient and fee straight out of the transaction's own payout frame. It pins the exact two-frame shape and requires MAX_COST <= fee, so the pool never pays more gas than it is reimbursed. It then checks the root and the nullifier, calls the verifier, and APPROVEs execution and payment. The payout never reverts: a recipient that refuses ETH is credited instead.

Partner tech (Ethereum Foundation):

  • EIP-8141 removes the relayer and the gas top-up, the two things that usually link a withdrawal to its owner.
  • The ERC-8421 alternative mempool is the only one that will carry it. The canonical mempool caps validation at 100k gas and refuses it, while the pool stakes itself in ERC-8421's registry to get a validation budget big enough for the proof.
  • Anon-RPC routes every request through the Nox mixnet (Tor and Nym selectable), with a separate isolation key per deposit and per withdrawal, and fails closed instead of going direct. The frontend is a static Vite + React app on viem, with no backend.

Hacky bits:

  • We vendored halo2-base to make its multicore dependency optional, so Halo2 compiles to wasm32 with the same verifying key.
  • ethrex has no eth_call state overrides, so we tested the verifier and every frame opcode the pool reads with initcode probes, without mining anything.
  • Those probes caught a real bug: ethrex charges state gas only while as much execution gas is still left, so our first gas floors would have let a withdrawal pass validation and then fail in the payout. The floors are now 400k.
  • The devnet's mempool node refused the verifier's precompile calls because its allowlist was empty. We reported it, EF enabled the precompiles, and the alternative mempool now admits the withdrawal with every rule passing.
  • When that node stopped forwarding admitted transactions, we added a fallback: the app waits 30 s, then hands the same transaction to ethrex's privileged submission and resubmits each block until it is mined. It keeps the same hash and nonce, so it can land only once.
background image mobile

Join the mailing list

Get the latest news and updates

Halo2 Privacy Frames | ETHGlobal