Opaque

The post-quantum security layer for Ethereum: hash-based keys for accounts, ENS, Uniswap and admins

Opaque

Created At

ETHGlobal Mumbai

Winner of

Uniswap

Uniswap Foundation - Build with Uniswap 4th place

Project Description

Opaque is the post-quantum security layer for Ethereum. It moves what ECDSA guards today (accounts, payments, ENS names, Uniswap liquidity and protocol admin keys) to hash-based keys, and keeps payments private with cryptography a quantum computer has nothing to attack. It is more than a wallet: Opaque is one way in, and MetaMask users, liquidity providers and protocol teams plug in without switching anything. All of it is live on Sepolia and on Ethereum's EIP-8141 devnet.

THE PROBLEM

Every Ethereum account that has ever sent a transaction has published its public key. A large enough quantum computer running Shor's algorithm turns that public key back into the private key. On that day, "Q-Day", whoever runs it can sign as you: drain the account, take over any protocol whose owner or admin role the key holds, transfer ENS names and pull Uniswap positions. Privacy breaks too. Stealth addresses and SNARK privacy pools built on elliptic curves and pairings can be unmasked or forged, and anything encrypted with elliptic-curve key exchange today can be recorded now and decrypted later. Nobody knows the date, but moving Ethereum's users and protocols takes years, and every key that moves has to be moved by the vulnerable key itself, before an attacker gets there.

WHAT OPAQUE DOES,TODAY

  1. Accounts signed by FORS+C. Every signature that moves value is FORS+C, a few-time hash-based signature over keccak; FORS is the few-time layer inside SLH-DSA (FIPS 205). On Sepolia a key is 32 Merkle trees of height 8, and a signature is 9,251 bytes that the browser makes in about 140 ms. Because it is few-time, PQKeyRegistry counts every use on chain: at most 8 signatures per key, which keeps forgery below 2^-160. Each key commits to its successor in advance, so the wallet rotates before the budget runs out, at the same address. One 12-word phrase derives every key on every chain. On Sepolia the account is an ERC-4337 smart account whose operations are signed by FORS+C. On the EIP-8141 devnet the transaction itself is signed by FORS+C alone: the account's VERIFY frame checks the signature in 76,430 gas, under the public mempool's 100,000-gas cap, and the account pays its own gas, with no bundler and no paymaster. A factory creates accounts with no signature at all.

  2. Private payments. A payment is a note leaving a pool. The wallet builds a ZKBoo ring proof in the browser (MPC-in-the-head over AES-128: hashes and a block cipher only, no trusted setup, 2^-128 soundness) showing that the note is one of a ring of 8 deposits, without saying which. The 1 MB proof crosses three relays chosen from six, each layer sealed with ML-KEM-768 and AES-256-GCM, and arrives still sealed at the exit. An attester verifies it and signs with its own FORS+C key, and the pool pays the recipient. The sender's account never appears on chain: on Etherscan, the sender is the pool's settler. Pools hold test USDC and ETH.

  3. Leaving without Opaque. Every pool is exitable. With every Opaque server switched off, the wallet still finds its notes on chain through the Ethereum Foundation's anon-rpc (the Nox mixnet), announces an exit, waits the pool's 300-second delay and withdraws through a public bundler, while the pool recomputes the note with AES-128 on chain. Nobody's permission is needed, ours included. anon-rpc also carries every ENS lookup, and a Privacy switch sends all of the wallet's reads and operations through it, so no RPC provider learns who is asking.

  4. ENSv2 names held by FORS+C. opaque.eth on ENSv2 is held by PQNameController, the only holder of every role on the name and the only admin of its resolver. It acts only on a FORS+C signature that PQKeyRegistry checks, so the ECDSA key that registered the name can no longer change it. Anyone can claim yourname.opaque.eth from the wallet with one FORS+C signature, and the wallet then shows the account by its name.

  5. Post-quantum stealth payments. The same claim publishes the wallet's ML-KEM-768 key in the ERC-6538 registry, under a scheme of its own. Paying a name then pays a fresh one-time address, announced on ERC-5564's Announcer, that only the payee can find with its ML-KEM key. The one-time address is itself a FORS+C account; the wallet finds the payment and sweeps it into its notes, and the payee's own address never receives anything.

  6. Uniswap v4 hooks. On Uniswap's own v4 PoolManager on Sepolia, PQAccountPoolHook makes a pool that admits only post-quantum accounts: an ordinary wallet's swap reverts with NotPostQuantum. PQGuardHook adds a FORS+C second factor to any liquidity position: removing liquidity needs a signature from the LP's guard key, and the hook pays the signed recipient itself, so a recovered ECDSA key cannot pull the position. On the devnet we deployed v4 ourselves, and the wallet swaps through the Universal Router with FORS+C signatures only.

  7. Keep MetaMask: the Q-Day vault. MetaMask users don't have to switch wallets. They deposit into PQVault from MetaMask and register a FORS+C guard key from 12 words; from then on, only that key can take the funds out, even after the MetaMask key is recovered.

  8. Any protocol: PQAdmin. Paste a contract address and the page finds its admin keys from what the chain shows: an Ownable owner, an EIP-1967 proxy admin or beacon, every AccessControl role and an AccessManager's admin role. One flow hands each of them to a PQAdmin contract that executes calls only with a FORS+C signature from the team's guard key, in an order that never locks the team out: roles first, DEFAULT_ADMIN_ROLE last. Upgrades, pauses and fee changes then need the hash-based key, and the guard key rotates without the admin address changing.

  9. The Q-Day simulator. A page that plays the quantum computer on live Sepolia. It sets up a victim with money, a protocol, a vault and stealth payments, then hands an attacker the victim's ECDSA private key. On chain, the attacker takes the plain wallet, the protocol it owned and an elliptic-curve stealth payment. The chain refuses it the Q-Day vault, the protocol behind PQAdmin and opaque.eth, each with the contract's own error (BadSignature, OwnableUnauthorizedAccount), and it cannot link the ML-KEM stealth payment. Then the owner moves everything with the FORS+C key alone.

  10. Connect with Opaque. The Opaque extension announces itself as an EIP-6963 wallet, so any dapp can use Opaque beside MetaMask.

PROOF

Every number above comes from the live chains. 154 Foundry tests cover the contracts and 396 tests cover the backend. Eight Playwright suites drive the real pages against Sepolia and the devnet: deposits, private sends, swaps, name claims, stealth sweeps, the exit with every Opaque server blocked, the Q-Day simulator and the PQAdmin handover. The code is open source under Apache-2.0.

WHAT WE CAN'T DO YET

Opaque protects what users and protocols hold. It cannot make Ethereum itself post-quantum, and we would rather say exactly where the edges are:

  • Consensus. Validators sign with BLS12-381, which Shor's algorithm also breaks, so a quantum attacker could forge validator signatures. Only a protocol upgrade fixes that, with hash-based consensus signatures like those in Ethereum's lean consensus research.
  • Data availability and SNARKs. Blob commitments use KZG over BLS12-381, and most rollups, bridges and privacy pools verify Groth16 or PLONK proofs over pairing-friendly curves. Our own proofs are hash-based; the ecosystem around us isn't yet.
  • The outer transaction on Sepolia. An ERC-4337 bundler, and our settler for private payments, sign the transaction that carries a FORS+C-signed operation, with ECDSA. A recovered courier key can delay or censor an operation, not forge one. Only EIP-8141 removes the courier, and EIP-8141 is a draft that runs on a devnet, not on mainnet.
  • Keys that haven't moved. Funds left in an ordinary account stay exposed until they move. PQAdmin can only take admin powers that a contract stores as a transferable address: an immutable or hardcoded admin, power granted by an ECDSA signature (EIP-712 permits, signed mints, oracle and bridge signers) and Safe owners stay on ECDSA. Every handover has to be signed before Q-Day.
  • Trust. The attester is trusted to judge whether a spend is valid. One operator runs every relay today, so the relays are not yet an anonymity set of their own, and a payment's anonymity set is its ring of 8.
  • Few-time keys. Each key signs 8 times, then rotates. Grover's algorithm halves the bits, so the forgery bound against a quantum attacker is about 2^-80 rather than 2^-160. Lose the 12 words and the keys are gone: there is no recovery path.
  • Stealth payments. Until the payee sweeps a payment, the payer can also derive the one-time account's key, because hash-based keys can't be tweaked the way elliptic-curve keys can.
  • Cost. A FORS+C signature is 9,251 bytes and about 260k gas to verify on Sepolia, plus calldata. It suits payments, swaps and admin actions, not keepers that act every block.
  • Readiness. Opaque runs on Sepolia and the EIP-8141 devnet only. Nothing is audited yet; mainnet comes after an audit and independent operators.

How it's Made

Opaque began as a private-payment wallet on Arc and the XRP Ledger: FORS+C accounts, ring-proof pools, a relay mesh and an attester. Everything on Ethereum was built at ETHGlobal Mumbai, from November 5. The existing contracts deploy unchanged; the new ones live in contracts/src/ethereum.

LEANFORS: A HASH-BASED SIGNATURE THAT FITS A PUBLIC MEMPOOL

The hardest problem was EIP-8141. A frame transaction gets 100,000 gas to validate (MAX_VERIFY_GAS), VERIFY frames and signature together, and the devnet's mempool enforces it for staked and unstaked senders alike. Our audited FORS+C verifier, ForsVerifier, needs 167k gas at k=13, a=13. By its own measurement, only about 41k of that is keccak; the rest is bounds-checked calldata slices and checked arithmetic around the hashes. So we wrote LeanFors: the same function, with the same wire format, the same domain-separated preimages and the same commitment, but its whole hot loop in assembly, reading the signature from memory, where EIP-8141's SIGDATACOPY puts it. It costs 53.6k gas at k=13, a=13 (83k at k=32, a=8, against 260k). A whole VERIFY frame of our FramePQAccount uses 76,430 gas, under the public limit with room to spare, so there's no private mempool, no whitelisting, no bundler and no paymaster: the transaction is signed by a hash-based key alone and the account pays its own gas. Because LeanFors is a second implementation of an audited function, it is held to the first: its Foundry test checks the same commitment on both fixtures, the same verdict on 1,024 fuzzed tamperings and the same reverts on malformed input. The devnet's parameters are k=13, a=13: a 5.9 KB signature with 130 bits of security at 8 signatures per key. A factory creates each frame account with no signature at all, and the wallet tips frame transactions 0.1 gwei and re-broadcasts the same bytes until they are mined.

KEYS AND ACCOUNTS

FORS+C is a few time hash based signature over keccak; FORS is the few time layer inside SLH-DSA (FIPS 205). A key is k Merkle trees of height a, and a signature reveals one leaf and its path in each tree. Because every use leaks a little, PQKeyRegistry counts uses on chain: at most 8 per key, keeping forgery below 2^-160 on Sepolia (k=32, a=8, a 9,251-byte signature the browser makes in about 140 ms). Each key commits to its successor before it is used up, so an account rotates to a fresh key at the same address. One 12-word phrase derives every key on every chain, each per chain and per purpose, so a few-time key never signs on two chains. On Sepolia the account is an ERC-4337 smart account built as EIP-1167 clones of one PQAccount implementation, and its operations go through Pimlico's bundler. In the browser, a password wraps a random AES-256-GCM data key with PBKDF2 (600,000 iterations), which seals the phrase, note secrets and history, and the wallet locks after 15 idle minutes.

A PRIVATE PAYMENT, END TO END

  1. Proof. In a Web Worker, the wallet builds a ZKBoo ring proof: MPC-in-the-head over an AES-128 circuit, made non-interactive with Fiat-Shamir. It shows that the note is one of a ring of 8 deposits without saying which: 219 repetitions for 2^-128 soundness, 39,264 AND gates each, 1.08 MiB, 2.2 s to prove and 2.0 s to verify. We chose AES-128 over keccak as the one-way function because it costs about 5,760 AND gates against keccak's 38,400, the same reasoning as Picnic. It uses hashes and a block cipher only, with no trusted setup.
  2. Transport. The proof leaves as about 35 chunks across three relays chosen from six. Each chunk is wrapped once per hop: ML-KEM-768 to that hop's key, HKDF-SHA-256, then AES-256-GCM with the routing header as associated data, padded to 4, 16 or 64 KiB classes. There is no X25519 anywhere in the path; ML-KEM-768 comes from @noble/post-quantum.
  3. Settlement. The exit reassembles the payment, still sealed. The attester verifies the proof and signs the spend with its own FORS+C key, and the settler sends pool.spend, so on Etherscan the sender is our settler, never the payer's account. The backend logs each step, which is how the video shows a payment crossing the system.
  4. Leaving. Every pool is an exitable ring pool. With every Opaque server switched off, the wallet reads its notes from the chain through EF's anon-rpc, announces an exit, waits the pool's 300-second delay and withdraws through a public bundler, while the pool recomputes the note with AES-128 on chain.

NAMES AND STEALTH PAYMENTS

opaque.eth on ENSv2 is held by PQNameController. ENSv2 moves a name's roles with its ERC-1155 token, so once the name was transferred to the controller, the controller was the only holder of every role. It is the only admin of a new resolver and executes calls only with a FORS+C signature checked by PQKeyRegistry; writes from the ECDSA key that registered the name revert. Claiming "xyz".opaque.eth also publishes the wallet's 1,184-byte ML-KEM-768 key in the ERC-6538 registry, under the scheme id keccak("opaque/v1/stealth/ml-kem-768/fors-c"), in the same signature. Paying a name encapsulates to that key: the 1,088-byte ciphertext goes into an ERC-5564 announcement, and the shared secret seeds a fresh FORS+C account that receives the payment. The payee's wallet scans the announcements, finds the payment with its ML-KEM key, and sweeps it into its notes, with sweep gas from the exit. Every lookup is made through UniversalResolverV2 over anon-rpc.

UNISWAP V4

On Sepolia, on Uniswap's own PoolManager, PQAccountPoolHook admits only post-quantum accounts: it recognises them by the code hash every PQAccount clone shares, so there is nothing to register, and an ordinary wallet's swap reverts with NotPostQuantum. PQGuardHook adds a FORS+C second factor to any liquidity position: removing liquidity needs a signature from the LP's guard key, consumed by PQKeyRegistry, and the hook pays the signed recipient itself. On the devnet we deployed v4 and PQPoolHook ourselves, and the wallet swaps through the Universal Router with FORS+C signatures only. Each hook's address is mined with CREATE2 so that it carries its permission flags.

ANY PROTOCOL, AND KEEPING METAMASK

PQAdmin's page reads a contract's admin keys from what the chain shows: owner(), the EIP-1967 admin, beacon and implementation slots, AccessManager's admin role, and every AccessControl role from RoleGranted logs, read in 49,000-block windows because public RPCs cap a query at 50,000. It hands them to the team's PQAdmin, roles first and DEFAULT_ADMIN_ROLE last, so the team is never locked out. PQVault does the same for a MetaMask user's funds: MetaMask deposits, and only a FORS+C guard key withdraws.

THE STACK

Contracts: Solidity, Foundry, OpenZeppelin, 154 tests. Backend: TypeScript on Node with viem, 396 tests: the relay mesh, the exit, the attester, the settler, the stealth announcer and a faucet, run as two Railway services, one for Sepolia and one for the devnet. Today the attester runs inside the stack's process, as a stand-in for a confidential-compute workflow. Frontend: plain TypeScript built with Vite, hosted on Vercel, plus a browser extension that announces Opaque as an EIP-6963 wallet. Cryptography: @noble/post-quantum, @noble/hashes, @noble/ciphers and @noble/curves. Diagrams: Excalidraw. Tests: eight Playwright suites drive the real pages against the live chains.

HACKY BITS

  • LeanFors computes its keccak preimages in place, in scratch memory, with offsets derived from each domain string's length, so no bytes are copied per hash.
  • FORS+C signing is deterministic, so a frame transaction the devnet drops is re-broadcast byte for byte, at no cost to the key's 8 signatures.
  • Sepolia's nodes suggest a 2-wei tip, which left our stealth announcements unmined past the relay's 30-second limit, so every write we send tips at least 0.01 gwei.
  • A Uniswap hook sees the router, not the account behind it, so ours read the real actor through the router's and PositionManager's msgSender(), then check its code hash.
  • A ~1 MB proof upload that a relay drops is re-sent as the same sealed intent on a fresh path; its idempotency key means the exit never pays twice.
  • The Q-Day simulator plays the quantum computer by handing the attacker the victim's real private key, then reads each refusal's custom error back out of the revert, so the page names BadSignature or OwnableUnauthorizedAccount instead of "reverted".
background image mobile

Join the mailing list

Get the latest news and updates