Moving existing Starknet accounts to post-quantum signatures without changing address

Hi all, I’m Juno, based in Seoul.

StarkWare’s migration register says existing accounts “do not change automatically”, and that wallet support, signing, key management and recovery “remain separate work”.

I wanted to see how much of that separate work could be done for the accounts people already hold. So I built it and tested it on Sepolia.

demo

What works today, on testnet

  • An existing account switches to a hybrid ECDSA + Falcon-512 account in one transaction. Address and funds stay the same.
  • The migration goes through each wallet’s own upgrade function. For Argent and Xverse that is a single call.
  • I deployed one account of each of the eleven wallet classes I found in active mainnet use, and migrated all of them: Argent 0.3 to 0.5, Xverse, OKX, Braavos 1.0 to 1.2, and two OpenZeppelin classes.
  • After migration, a transfer signed with both keys goes through. An ECDSA-only one is rejected in __validate__.
  • The migration only finalizes after a signature from both new keys. A wrong key reverts the transaction instead of locking the account.
  • Users keep their seed phrase. The Falcon key comes from the same words, and for Argent X / Ready the ECDSA key follows Argent’s own derivation.

Mainnet, read-only check

  • 564 of the 621 BTC delegated in Starknet staking (91%) sits in accounts that could do this today, including the ten largest delegators.
  • Of 400 accounts that sent transactions in a 0.8-hour window, 362 could. That sample is short and skews toward bots.

Cost at mainnet prices

  • Migration: about $0.06 to $0.13, once
  • Hybrid transfer with the standard SHAKE-256 verifier: about $0.047 (an ECDSA transfer today is about $0.002)

Not covered

Bridges, Ethereum settlement, Argent guardians, Braavos hardware signers, multisig.
Nothing is audited and it is testnet only. It builds on OpenZeppelin’s cairo-pq-verifiers.

Try it

Where I would like input

  1. During the transition, would wallet teams rather ship hybrid (ECDSA and Falcon) or Falcon only? Hybrid costs more gas, but keeps the classical check if a lattice implementation turns out to have a bug. I lean hybrid, but I am not sure that is what wallets want.

  2. Is it worth standardising how a Falcon key is derived from the words users already have, so that any wallet restores the same key? There is a draft in the repo, and I could turn it into a SNIP.

  3. In OpenZeppelin’s benchmark, pure-Cairo keccak_f1600 takes about 63% of the standard verifier’s steps. Is the Keccak-f[1600] syscall proposed in SNIP-32 worth reopening?

Really nice work, and doing it for the accounts people already hold is the hard part. I read the migratable account at commit 1345ece. Two gaps and a view on your first question.

  1. _migrate makes sure the owner can sign with the new keys, but rotate_falcon_public_key and rotate_ecdsa_public_key write the new key without that check. If a wallet rotates to a key it can’t sign for (wrong account index, or the v0 vs v0.1 backup profiles, which give different Falcon keys from the same words), the rotation goes through, then no transaction validates again, including a rotation back, and the account is stuck. Asking for the same proof as migration, a hybrid signature by the new keys over a rotation hash, would close it: the same check every migration path has had since register_falcon_public_key was removed.

  2. set_verifier_class_hash accepts any non-zero class. The verifier reads the keys from this account’s storage by name, so a class that expects other names (say a future audited verifier laid out differently) reads empty keys, and the account is stuck the same way. A signature that passes under the new verifier, checked in the same call, avoids it. Related: the key proof in _migrate is checked by the verifier class the same call passes in, so it only proves something if that class is honest. One that returns VALIDATED for anything passes the proof and then validates every later transaction. I’d have wallets pin the verifier hashes they accept and show this call with the same warning as upgrade.

On hybrid or Falcon only, I’d ship hybrid. You already note Falcon signing is hard to make constant-time, and until a quantum attacker exists, a leak from the signer is the more likely failure. Hybrid keeps ECDSA as the floor while the Falcon side matures.

Thanks Carlos, both were real. Fixed in Check key rotation and verifier switches · 0xjuno/starknet-pq-account@5a1269f · GitHub (credited you there).

  1. Both rotations now take a proof, like migration does: a hybrid signature by the key pair the account will hold after the rotation, over a hash of that pair (domain starknet-pq-rotate-v1). The new key is written, the proof is checked against it, and a key the owner can’t sign with reverts the call.

  2. set_verifier_class_hash now checks the transaction’s own signature again under the new class after writing it, so a class that reads the keys differently, or isn’t a verifier at all, reverts the switch. That only works between verifiers of the same scheme, which seems right to me: a new scheme needs new keys, so it goes through upgrade anyway. On the honest-verifier point, agreed, the contract can’t fix that one. The kit now refuses verifier classes outside a pinned list, both for migration and for the switch.

I ran both on Sepolia too: a rotation to a key nobody holds and a switch to the Poseidon verifier both revert, and the account keeps working after. Transactions are in the README.

Agreed on hybrid. A leak from the signer is the risk that exists today, so ECDSA stays as the floor.

Accounts migrated to earlier classes keep the old behaviour until they upgrade.