Skip to content
Lean Key
Concepts

Threat model

Who Lean Key defends against, what each attacker can and cannot do, and the cases it does not cover.

This page lists attackers by what they have, and states what the program allows them to do. Statements marked "proven" are Lean theorems about the specification of the program; Trust boundaries explains what that does and does not cover. Statements marked "tested" are checked by the LiteSVM tests in program/tests and the local-validator run in scripts/localnet/e2e.ts.

What is protected

The lamports above the rent-exempt minimum and the tokens in token accounts owned by a vault, for a vault that you opened with your own seed. The goal is that nothing moves without both the owner's Ed25519 signature and a WOTS+ signature from the vault's post-quantum seed, and that nobody can lock the vault against its rightful owner.

Assumptions

  • SHA-256 behaves as a one-way function, also truncated to 24 bytes for chain values: nobody can find an input that hashes to a given chain value. WOTS+ security rests on this. It is an assumption, not a theorem.
  • The Solana runtime enforces signatures, account ownership and writability as documented, executes sol_sha256 correctly, and the System Program and SPL Token / Token-2022 programs behave as specified.
  • The deployed bytes are the release build, and the deployment is not upgraded underneath you. On devnet it has an upgrade authority; see Trust boundaries.
  • The device that holds the post-quantum seed is not compromised while the seed is unlocked.

Attackers and outcomes

Someone knows the owner's Ed25519 private key

This covers a wallet drainer, a leaked key file, a malicious dApp approval, and a future quantum computer that recovers Ed25519 keys from public keys. It is also the Open Key Challenge on devnet, where the owner key of a vault is published.

  • They can sign any Solana transaction as the owner, so the owner-signer check passes.
  • They cannot make a valid WOTS+ signature for the vault's current key without the seed. Every instruction that moves anything verifies one, so every such instruction fails with BadSignature (6005).
  • Proven: public_owner_key_cannot_move_funds. For any sequence of instructions, signed by anyone including the owner, if none carries a valid WOTS+ signature for the vault's key that is current when it runs, the state after the sequence is exactly the state before: no lamports, no tokens and no key move. So the vault is neither drained nor locked.
  • Tested: "no sequence of instructions moves funds or blocks the vault" (LiteSVM), and "the owner's wallet key without the PQ seed moves nothing" (local validator, refused with 6005).

What they can do with your owner key, and what the program does not prevent:

  • Open other vaults under your owner address. InitVault needs only the owner's signature. They can open vault #1, #2 and so on, or front-run your own InitVault, with a first key hash from their seed. Such a vault appears in leankey vaults OWNER like any other vault of yours, and they could withdraw from it. The clients compare each vault's stored key hash with your seed's key at the same index: the extension's Sync skips a vault that does not match, the site's app marks it "another seed's key: do not deposit" (through twokey:checkVaults), and the CLI marks it with leankey vaults OWNER --pq and refuses it in leankey deposit --pq. A deposit from anywhere else (another wallet, an exchange) is not checked: deposit only into a vault one of these checks marked as yours.
  • Spend from your ordinary wallet. The key is still your wallet's key. Lean Key protects only what is inside vaults.

Someone has the 24 words (or the decrypted seed) but not the owner key

They can compute every one-time key of every vault of that seed and sign any intent. They cannot get a transaction accepted: every instruction requires the owner stored in the vault to sign (withdraw_requires_owner_signer, proven), and a different signer is refused with NotOwner (6001) before any signature is checked (tested).

Someone sees a WOTS+ signature in flight

A withdrawal transaction is public once broadcast, including the 624-byte WOTS+ signature.

  • The signature verifies only for the intent it was made for. The intent fixes the amount, the asset, the destination, the vault, the key index and the next key hash, all of which the program rebuilds from the instruction itself. Any change gives a different intent and fails with 6005 (tested for amount, destination, next key and asset).
  • Putting the same signature in another transaction requires the owner's Ed25519 signature on that transaction. Even with it, the only thing that can happen is the intent you signed: the same amount to the same destination, and the key rotates to the key you named. This is harmless by construction (tested: "a signature seen in flight can only execute the user's own intent").
  • After the key rotates, the signature is for an old key index and is refused (tested: "an old one-time signature is dead after rotation").
  • One signature does not help sign anything else: for two intents with different digits, the second has a lower digit somewhere, which would need a hash preimage (wots_no_domination, proven).

Someone has both keys

They can do everything the owner can. Lean Key's protection comes from the two keys living in different places. In the extension's built-in owner mode both keys sit in the same browser profile, encrypted with the same password; whoever compromises that profile while it is unlocked, or learns the password and copies the storage, has both.

Someone sends lamports or tokens to your vault

Harmless. Deposits only add. A vault address that someone funded before you opened it still opens: InitVault tops up only the shortfall to the rent-exempt minimum (tested). Extra lamports cannot make a signed CloseVault fail, because its intent says "everything above rent" rather than an amount (tested).

Someone tries to create a fake vault at your address

A vault address is a program-derived address and only the program can create an account there, through InitVault, which checks the address against the seeds and needs the owner's signature. A keypair address passed as the vault is refused with BadAddress (6004) even when that keypair signs (tested). Once an address has been a vault it can never be opened again, also after CloseVault, because the account stays as a tombstone owned by the program (no_reopen, proven for the model; AlreadyOpen 6003, tested).

A malicious dApp or site

The extension only signs after you approve in its own window, which shows the requesting origin and the decoded request. For intents it shows the action, asset, amount, destination, vault, owner and the key index. Reading that screen is your defense: a site can ask for any intent, and if you approve an intent sending your SOL somewhere, that is a valid intent. See Extension guide.

A lying or failing RPC node

Clients read the key index, balances and simulation results from the RPC you configure. A lying RPC can show wrong balances, hide transactions, or make the client sign an intent that then cannot land (it stays pending). It cannot move funds without both signatures. Because the journal admits one intent per key index regardless of what the RPC says, it cannot make the client sign two different intents for one key.

What Lean Key does not do

  • It does not protect funds outside vaults, including the hot account in the extension.
  • It does not help if you lose either key. There is no recovery instruction, no admin and no owner change (no_admin_path, proven). See Recovery and safety.
  • It does not make a compromised computer safe when both keys are on it.
  • It does not verify that a vault was opened with your seed; see above.
  • It does not support Token-2022 mints with a transfer hook. They are refused (TransferHook, 6007), and the CLI refuses to deposit them because they could not be withdrawn.
  • It does not hide anything. Vault balances, owners, intents and signatures are public on chain.

Connect a wallet

Your wallet signs as the owner (Key A). Lean Key adds the post-quantum key (Key B).

Wallets

Any wallet that supports the Solana Wallet Standard appears under Installed. Lean Key never asks for your seed phrase on this site.