Post-quantum 2-of-3 smart wallet on EIP-8141 that blocks hash-based signature reuse on-chain
Leafguard (PQ-Vault) is a 2-of-3 guardian smart wallet where every approval is a post-quantum, hash-based signature. There is no ECDSA anywhere in the wallet and no seed phrase. It runs on EIP-8141 frame transactions submitted through the ERC-8421 alternative mempool. Each payment is one transaction with three frames: VERIFY (guardian A's signature), VERIFY (guardian B's signature, which also approves payment) and SENDER (the transfer). Both post-quantum signatures are checked before the account pays any fee, so a missing, corrupted, stale or duplicate approval makes the transaction invalid and costs the wallet nothing. Fast, compact hash-based signatures are one-time ("stateful"): a guardian key has a slot of 128 one-time leaves, and signing twice with the same leaf leaks the key. That is the classic failure mode, and it happens in real life through crashes, restored backups, cloned devices and rolled-back storage. Leafguard records each slot's high-water mark on-chain in a LeafLedger. The mark is checked in VERIFY and consumed in SENDER, so a leaf can never be accepted twice, even if the device holding the key forgets it used it. Anyone can submit an equivocation proof (two messages signed with one leaf) to revoke that slot. Keys renew automatically: a slot with 8 or fewer leaves left is rotated first, approved by the other two guardians. A key that runs out falls back to a larger, stateless SPHINCS-style signature, so the wallet never gets stuck. Two guardians can replace a lost one. We measured it. In simulation, under stale restores, rollbacks and lost state, a baseline vault reached γ = 9 uses of a single leaf (forgery cost down to 35.6 bits) and hundreds of double-accepted signatures. Leafguard kept γ = 1 with zero double acceptances. We also ran the attack live on a local devnet: a vault without on-chain leaf state accepted two transactions signed with the same leaf after a stale backup restore. Leafguard rejected the same restored signer with StaleLeaf. For the demo there are personal wallets (Alice, Bob, Carol) with send and receive, the fee explained, key health and shared 2-of-3 multisig vaults. There is also a block explorer that decodes frame transactions frame by frame, and a React Native phone app. The phone is a paired remote: the keys and signing stay on the wallet computer.
Contracts are Solidity with Foundry (26 tests). PQVault holds the three guardians and does validate() for both VERIFY frames and execute() for SENDER. PQVaultFactory deploys accounts with CREATE2. LeafLedger stores the per-slot high-water marks and accepts equivocation reports. PQVaultFrameOps is a Yul helper for the EIP-8141 opcodes (TXPARAM, SIGPARAM, SIGDATACOPY, FRAMEPARAM, APPROVE). Signatures go in ARBITRARY signature entries and are checked against the protocol's canonical signature hash. We wrote no cryptography of our own: verification is upstream JARDIN's FORS and SPX verifiers, unmodified, and signing is JARDIN's Python reference signers, pinned as a git submodule. Partner tech: we built on the ETHGlobal Mumbai alt-mempool workshop stack, namely forshtat's ethrex fork with EIP-8141 and a tracer, the hegota-support helpers and the skandha-based mempool sidecar. Two signature verifications cost more validation gas than EIP-8141's combined 100k cap: about 84k per VERIFY frame for a compact signature, about 292k for a stateless one. Reading the shared LeafLedger is also "storage not owned by the sender", which the canonical mempool refuses. So we implemented ERC-8421 [BUDGET-010] (a separate 1M-gas validation budget per staked entity) as a patch to the workshop sidecar: 7 new tests, all 393 executor tests passing, and a Docker image. The vault stakes itself when it is created. We measured that the canonical mempool and the stock sidecar reject the transaction, and the patched sidecar admits the staked vault while rejecting an unstaked copy. On a local Kurtosis network (ethrex + Lighthouse + the patched sidecar), a payment uses VERIFY frames of 83,842 and 75,875 gas and a SENDER frame of 59,809. It is billed 379,513 gas, because frame transactions are charged by calldata size and post-quantum signatures are large. The first use of a key costs 97,920 more to create its ledger entry. The wallet's fee estimate reproduces 25 of the 26 frame-transaction receipts on the chain exactly (the one exception is a recovery transaction the wallet never sends).
The off-chain toolkit is Python with no pip dependencies:
Hacky but notable:

