Recovery and safety
The one-device rule, what to back up, what happens when you lose each key, and how pending intents and retries work.
Lean Key has no recovery instruction, no admin key and no way to change a vault's owner or reset its key (no_admin_path in the proofs). Whatever you need to get your funds back, you have to keep yourself. This page lists what that is, and the one operational rule that the clients cannot fully enforce for you.
What to back up
| Secret | Where it comes from | Backup | Without it |
|---|---|---|---|
| The 24 words | leankey keygen or the extension's Create | Paper, written at creation. The extension checks three words before it continues. | Every vault of that seed is locked for good. |
| The owner key | Your wallet, or a keypair file | Your wallet's own recovery phrase, or a copy of the keypair file. | Every vault of that owner is locked for good. |
| The extension's hot account (built-in owner mode only) | Created by the extension, or imported | Settings → Built-in account key shows its secret key after your password. Back it up separately from the 24 words, which do not restore it. | Without a backup, the built-in vaults it owns are locked for good. |
The CLI journal (pq.seed.journal.json) | Written by the CLI next to the seed file | Keep it next to the seed file and move them together. | Nothing is lost, but the CLI no longer knows what the seed signed; see below. |
| The seed password | You | Your choice. | The 24 words still restore the seed. |
A vault's address, its number and its owner can always be found again: leankey vaults OWNER lists them from the chain, and the extension's Sync does the same for the hot account.
If you use the extension's built-in owner mode with a hot account it created, back up its key from Settings → Built-in account key, and keep that backup apart from the 24 words: one backup holding both would be both keys of your built-in vaults. For anything you cannot afford to lose, the external owner mode with a wallet you can restore is simpler.
The one-device rule
Use each seed on one device at a time: one browser profile, or one seed file with its journal.
The reason is the journal. A one-time key is safe as long as it signs a single intent. The clients enforce this with a journal of what each key has signed, but each copy of the seed keeps its own journal. If the same seed is active in two places, both can sign a different intent with the same key before either lands. One of them lands and the key rotates; the other fails. But both signatures were seen (by the RPC that simulated them, or on chain), and for that key index two signatures are public at once.
What that exposes is limited, and it is better to know exactly how:
- Two signatures of different intents with one key reveal, on each of the 26 chains, the lower of the two positions. Anyone can then compute a signature for an intent whose digits are all at or above those positions on every chain.
- That forged WOTS+ signature is useless without the owner's Ed25519 signature on the transaction.
- It is useless once the vault's key has rotated past that index, which happens when either intent lands.
So the risk is an attacker who also has the owner key and races the honest transaction during that window. That is exactly the attacker Lean Key exists to stop, which is why the clients refuse to sign a second intent for one key, and why you should not create the situation by running two copies.
The extension shows the rule next to the words in Settings → Backup. It does not stop you from restoring a seed that is active elsewhere, so the rule is yours to keep.
Moving to another device
- On the old device, make sure no intent is pending.
leankey status VAULT --pq pq.seedmust not print apendingline for any vault; in the extension, no vault may show Pending intent for key #k. If one is pending, send it first (leankey pending --send, or Retry), or let it fail for good. - Stop using the old copy. For the CLI, delete the seed file and its journal. For the extension, use Settings → Reset.
- Restore on the new device:
leankey keygen --import, or Restore from 24 words in the extension.
Between two CLI installs you may instead move the seed file and its journal file together; that carries the journal across. The extension has no journal import or export, so moving to or from the extension always goes through step 1.
Losing things
You lose the 24 words but still have the device
Nothing is lost yet. Show the words again (extension: Settings → Backup, with the password) and write them down. The CLI cannot show them again: move the funds to a vault of a new seed (leankey keygen, leankey open, then leankey send from the old vault to the new vault's address).
You lose the device and have the 24 words
Restore the seed elsewhere. The new install has an empty journal. If the old device had signed an intent that never landed, the new one does not know, and will sign a different intent for that key if asked. That is the two-signature situation described above. It is bounded in the same way: it matters only to someone who also has your owner key, and only until the key rotates. If you suspect the old device had a pending intent and your owner key may be exposed, make the first transaction from the restored seed promptly.
You lose the seed password
- CLI: the seed file cannot be decrypted. Rename the old file (for example to
pq.seed.old), leavepq.seed.journal.jsonwhere it is, and restore to the original path withleankey keygen --import --out pq.seed. The journal file is named after the seed path, so the restored seed keeps its journal. - Extension: Reset needs the password. Remove the extension from the browser, which deletes its storage including the journal, install it again and restore from the 24 words. A hot account created by the extension is gone with it unless you backed up its key.
You lose the owner key
The vaults of that owner can no longer be withdrawn from. No instruction changes an owner. For an external owner, restore your wallet from its recovery phrase; the same address is the same owner.
The owner key leaks
The vaults are still protected by the seed: without a valid WOTS+ signature nothing moves (public_owner_key_cannot_move_funds). Move the funds to vaults of a new owner soon anyway, because:
- the protection now rests on the seed alone;
- the attacker can open new vaults under your owner address with their own seed, which then show up in
leankey vaultsnext to yours. The clients check each vault's stored key hash against your seed: the extension's Sync skips vaults whose key is not yours, the site's app marks them "another seed's key: do not deposit", andleankey vaults --pqmarks them in the CLI. Deposit only into vaults marked as yours. See Threat model.
The 24 words leak
Nobody can move anything without the owner key. Move the funds to vaults of a new seed soon, for the same reason: the protection now rests on the owner key alone.
Pending intents and retries
A withdrawal can fail after the one-time key has signed: the simulation with the real signature fails, the transaction expires before it lands, or the connection drops. The intent is then pending: it is in the journal, and the vault's key has not moved. What happens next:
- Only that intent can be sent. A request to sign anything else with that key is refused: "Key #k of this vault already signed a different intent. Only that intent can be sent (Retry); signing another one with the same one-time key would weaken it."
- Sending it again is safe. Signing is deterministic: the same intent gives the same signature, so nothing new is revealed. A new transaction with a fresh blockhash carries it.
- It does not matter whether the first attempt landed. If it did, the key moved, the old intent is for an old key index, and the program refuses it; the client sees the new key index and no longer treats the intent as pending.
How to retry:
leankey status VAULT --pq pq.seed # shows the pending line, if any
leankey pending VAULT --owner wallet.json --pq pq.seed # shows the intent
leankey pending VAULT --owner wallet.json --pq pq.seed --send # sends exactly that intent again
In the extension, the vault screen shows the pending intent with Retry (built-in owner mode). With an external owner, the site asks the extension for the pending intent and sends it.
When a pending intent cannot land
Fix the cause, then retry. Typical causes:
- not enough SOL in the fee payer;
- a token account frozen by the mint's freeze authority, which needs the authority to thaw it;
- a recipient token account that was closed after you signed. The intent names that exact token account, and a retry does not create it. Anyone can create a wallet's associated token account again, paying its rent; any other token account has to be recreated at the same address by whoever controls that address;
- for a pending
CloseTokenAccount: tokens arrived in the vault's token account after you signed. Anyone can send tokens to it, and the token program refuses to close a non-empty account.
If the cause cannot be fixed, the clients offer no way around the journal: they keep refusing to sign another intent for that key, and the vault stays at that key in the clients. The CLI's journal is a plain JSON file, so it can be edited by hand, at the cost described under the one-device rule. Keep pending intents short-lived, and check a vault's token accounts before closing one.
Before you put real value in a vault
- Lean Key is an unaudited beta. On mainnet, the recommended limit is 10 SOL per vault.
- Test a withdrawal from the vault before you fill it, on the same device and with the same keys you will use later.
- Record the vault's address when you open it.
- Read Trust boundaries.