Agile Wallet

This wallet uses crypto agility to keep your funds safe during the quantum / AI age

Agile Wallet

Created At

ETHGlobal Mumbai

Project Description

Agile Wallet is a Chrome extension wallet for an Ethereum smart account that can require any combination of signature schemes: ECDSA and the post-quantum schemes Falcon-512 and SPHINCS-. Users can update the schemes at any time without changing your address.

The wallet also lets you subscribe to public break signals: on-chain flags a cryptographer raises when a scheme has been broken, for example by a quantum computer. When a signal you're subscribed to is raised, your wallet automatically requires an extra signature scheme of your choice, such as "if ECDSA is broken, also require SPHINCS-". Your account stays secure even if you never act on it yourself.

The project needed a custom mempool for two reasons. First, verifying a post-quantum signature in the EVM costs far more than the canonical EIP-8141 mempool's 100,000-gas validation limit: about 600k gas for Falcon. Second, the canonical rules don't let validation read other contracts' storage, so a wallet can't check whether a break signal has been raised. The Crypto-Agility Mempool fixes both. Calls to listed signature verifiers are charged at a precompile price (3,000 gas for Falcon, as EIP-8052 proposes) instead of their EVM cost, and validation may read the single storage slot of listed break signals. Neither change is a security risk. Only pure signature verification functions get the extra credit, so it can't be spent on arbitrary computation. A break signal's slot can change only once, so it can never be used to repeatedly invalidate pending transactions, which is how mass invalidation attacks work.

How it's Made

This project consists of a Chrome extension, 5 Solidity contracts, and modified forks of the ERC-8421 Mempool Sidecar and ethrex.

EXTENSION A Chrome MV3 extension built with React, Vite and TypeScript.

  • Keys: one 24-word BIP-39 seed phrase (noble/scure), encrypted with PBKDF2 and AES-GCM. ECDSA keys are derived via BIP-32, Falcon and SPHINCS- keys via HMAC-SHA512 sub-seeds, so breaking one scheme only exposes that scheme's key.
  • Transactions: built with viem and forshtat's hegota-support as EIP-8141 frame transactions: a deploy frame on the first transaction, a VERIFY frame with one signature per required scheme, and SENDER frames for transfers, scheme changes and safeguard changes. Before signing, the extension reads the account's subscribed break signals from the chain and adds the backup scheme's signature for any raised signal.
  • Signing: Falcon uses ZKNOX's falcon.js. For SPHINCS-, I compiled the Rust signer to WASM. Signing runs in Web Workers, so the popup doesn't freeze during the roughly 5 seconds a SPHINCS- signature takes.

CONTRACTS Built with Foundry and forshtat's hegota-support library.

  • AgileWallet: the EIP-8141 smart account. Each transaction carries the wallet's scheme list and one signature per scheme. The wallet only stores the hash of the list. ECDSA uses the frame transaction's native signature. It also stores the hash of its break-signal subscriptions, and once a signal is raised, its VERIFY frame requires that subscription's backup scheme.
  • AgileWalletFactory: deploys wallets with CREATE2. The address depends only on the owner's ECDSA key.
  • FalconVerifier and SphincsVerifier: adapters behind a common IVerifier interface, around ZKNOX's ETHFALCON and nconsigny's SphincsC13Asm.
  • BreakSignal: a contract with one storage slot that can only be set once.

ETHREX To credit the exact gas a verifier uses, the mempool needs the gas of each call. ethrex's ERC-7562 tracer didn't report it, so I forked ethrex and added gasUsed to every call in the trace.

MEMPOOL I forked the ERC-8421 Mempool Sidecar from the EF alt-mempool workshop and made it implement the Crypto-Agility Mempool, a custom alt-mempool ruleset I specified in docs/CRYPTO_AGILITY.md. The ruleset adds two relaxations to the canonical rules. First, for each call into a listed verifier, the sidecar adds the call's gas minus a precompile price to the transaction's verification budget. Second, validation can read slot 0 of a listed break signal without staking. The mempool's ID and gossip topic is the IPFS hash of the spec. The devnet doesn't run my patched ethrex yet, so the sidecar has a hack to support unpatched ethrex. When the trace has no per-call gas, it credits a fixed amount, measured on the devnet, to every call into a listed verifier. This doesn't check that the call actually verified anything, so it's only safe on a trusted devnet.

I built it with Claude Code. AI_USAGE.md logs what was AI-assisted.

background image mobile

Join the mailing list

Get the latest news and updates

Agile Wallet | ETHGlobal