Winterlock Wallet

Post-quantum smart wallet where every one-time key is its own nonce, so payments can go in parallel

Winterlock Wallet

Created At

ETHGlobal Mumbai

Project Description

Winterlock is a post-quantum smart wallet for Ethereum. Every payment is signed with a hash-based one-time key (WOTS+ under a Merkle tree), and you can use it from MetaMask Snap (Flask).

The problem with one-time keys is simple. If you sign two different messages with the same key, anyone can forge a third one. So the wallet has to remember which keys are used. Most designs keep a bitmap or counter on chain, which means a storage write on every tx, and with a normal nonce you get only one pending tx per account.

My idea: the key number is the nonce key. With EIP-8250 keyed nonces, leaf i can sign only a tx whose nonce key is i, at sequence 0. When the tx is approved, the protocol marks that nonce as used, so the key is dead also. The account writes nothing during verification. No bitmap, no counter.

Since every payment has its own nonce key, one account can have many payments pending at the same time on the ERC-8421 alt mempool. On the devnet I sent 8 payments from one account. All 8 were pending together and landed in 2 blocks. Same burst on the public mempool: 1 accepted, 7 refused.

While testing these lanes I also found a DoS gap in the alt mempool sidecar and opened 2 PRs upstream: a cap of 64 pending txs per unstaked sender (#6), and rechecking only the txs a new block actually touched (#5).

Other things it does:

  • A stuck payment is never fee bumped, because that means signing the same key twice. It waits for its deadline, the key gets burned and the retry goes out with a fresh key.
  • Hot tickets for a phone or an AI agent. The device gets a few one-time keys and no seed. The account itself enforces a value cap, one allowed recipient, a fee cap and a kill switch, and rejects with the rule name (hot: value cap).
  • Verification fits under the devnet's 100k gas verify cap (88,373 gas used).

It is a hackathon prototype and not audited.

How it's Made

Winterlock is a smart account written in raw Yul, because solc can't emit the EIP-8141 opcodes yet, so I used verbatim for TXPARAM, FRAMEPARAM, SIGPARAM, SIGDATACOPY and APPROVE. Inside the VERIFY frame it copies a 2,594 byte signature entry, verifies 67 WOTS+ chains (keccak256, w=16) and a height-10 Merkle path, then calls APPROVE(3) for execution and payment. Verify takes 88,373 gas, so it fits the stock 100k cap with no stake, no budget raise and no sidecar patch.

The main trick is that leaf i can sign only under EIP-8250 nonce key (epoch << 32) | i, at sequence 0. APPROVE consumes that nonce, so the protocol retires the one-time key in the same step. No SSTORE, no used-key bitmap, and every payment gets its own lane: 8 hash-signed txs from one account were pending together on the ERC-8421 alt mempool.

Other pieces:

  • Bounded verify: WOTS+ cost depends on the digest (worst case 1,005 chain steps), so the signer grinds a tx field until the digest needs ≤510 steps, then signs once.
  • Hot tickets: a phone or agent gets a few leaves and no seed. VERIFY reads every later frame with FRAMEPARAM and enforces target, value cap, fee cap and a kill switch.
  • Signer safety: each leaf is reserved in a file-locked journal before signing. No fee bumps; a stuck payment expires and is re-signed on a fresh leaf. chainId is hashed into every leaf.
  • Cross-checked: Rust (CLI + WASM) and TypeScript signers, Yul and TS verifiers, vectors pass both ways, WOTS+ diff-tested against an audited Solidity implementation. 761 tests.
  • MetaMask: Account Snap for Flask. The signed frame tx rides in the userop signature field and a keyless bridge sends the raw EIP-8141 bytes. Nothing ERC-4337 on chain.

Upstream fixes: testing the lanes showed that a self-paying keyed sender had no per-sender cap in the sidecar, and the reconciler re-simulates every pending tx on every block. So one address could park unlimited lanes and make the node re-check all of them. I opened 2 PRs. #6 caps an unstaked sender at 64 pending txs (ERC-8421 LIFECYCLE-030) and closes a bypass through cancelled slots. #5 uses EIP-7928 block access lists to recheck only the txs a block touched: 4 simulations per block down to 0 on the devnet. https://github.com/forshtat/mempool-workshop-sidecar/pull/6 https://github.com/forshtat/mempool-workshop-sidecar/pull/5

Stack: Yul, Foundry, Rust, TypeScript, Bun, viem, React, MetaMask Snaps SDK.

background image mobile

Join the mailing list

Get the latest news and updates

Winterlock Wallet | ETHGlobal