Skip to content
Lean Key
Reference

Glossary

The terms used across the Lean Key documentation, each in a sentence or two.

Vaults and keys

Vault. A 91-byte account owned by the Lean Key program, at a program-derived address of its owner and vault number. It holds SOL directly and tokens in token accounts it owns. See Program accounts.

Vault number (vault_id). A 64-bit number in the vault's address seeds. One owner can have vault #0, #1 and so on.

Owner. The Ed25519 public key stored in a vault at offset 2. It must sign every Lean Key transaction for that vault and can never change.

Owner key. The Ed25519 private key of the owner: a wallet's key, a keypair file, or the extension's hot account.

Post-quantum seed (PQ seed). 32 random bytes from which every one-time key of every vault is derived. Kept encrypted by the CLI or the extension and backed up as 24 words.

24 words. The PQ seed written with the BIP-39 English word list. Not a wallet recovery phrase. See Key derivation and backup.

One-time key. A WOTS+ key pair for one vault and one key index, derived from the seed. It may sign exactly one intent.

Key index. The number of the vault's current one-time key, stored in the vault. It starts at 0 and goes up by one with every withdrawal.

pk_hash. The SHA-256 hash of the current one-time public key, stored in the vault. The only part of the post-quantum key that is on chain.

Next key hash (next_pk_hash). The pk_hash of the following key index, named in every intent. The program stores it after the withdrawal succeeds.

Rotation. Replacing the vault's key index and pk_hash with the next ones after every withdrawal. A signature for an older key index is then refused.

Signing

Intent. The 193 bytes a WOTS+ signature covers: program, vault, key index, action, asset, amount, destination and next key hash. The program rebuilds it from the instruction. See Intent format.

Action. The kind of intent: 1 WithdrawSol, 2 WithdrawToken, 3 CloseTokenAccount, 4 CloseVault.

WOTS+. Winternitz one-time signature scheme, here with parameters n = 24 bytes, w = 256, 26 chains. Security rests on SHA-256. See WOTS+ parameters.

Chain. A sequence of 255 applications of the tweakable hash F, from a secret value to a public end. The one-time public key is 26 chain ends.

Digit. One of the 26 numbers from 0 to 255 derived from an intent: 24 from its message hash, 2 from the checksum. A signature reveals each chain at the position of its digit.

Checksum. The sum of 255 minus each message digit, written as two digits. It stops anyone from turning one signature into another by hashing forward.

Tweakable hash F. SHA-256 over a tag, the program id, the vault, the key index, the chain number, the step number and the value, cut to 24 bytes.

Verify steps. The number of hash steps the program walks to check a signature: 255 × (⌊checksum / 256⌋ + 2), from 510 to 6,375. It sets the compute cost.

Hash assumption. That nobody can invert SHA-256 or find a second input with the same output. WOTS+ security depends on it; no proof does.

Clients

Journal. A client's record of every intent it signed, one per vault and key index, written before the signature is released. The CLI keeps it next to the seed file; the extension in its local storage.

Journal rule. A key index signs one intent, ever. A client asked to sign a different intent for a key index that already signed refuses.

Pending intent. An intent that the vault's current key has signed but that has not landed. Only it can be sent for that key.

Retry. Sending a pending intent again in a new transaction. Safe because signing the same intent gives the same signature.

Placeholder preflight. A simulation with an all-zero signature before any key is used. It must stop at exactly BadSignature (6005), which proves every earlier check passes.

Safe send order. Placeholder preflight, local checks, signing under the journal rule, simulation with the real signature, sending. Implemented once in packages/core and used by the CLI and the extension.

External owner mode. The extension holds only the PQ seed; your own wallet is the owner and signs transactions.

Built-in owner mode. The extension also holds the owner key, as its hot account, and signs both halves itself.

Hot account. The Ed25519 account the extension holds in built-in owner mode, created by it or imported.

Clear signing. Showing each request decoded in the extension's own window before anything is signed: the intent's fields, or a transaction's instructions with a simulation.

Wallet Standard. The interface through which web pages find wallets. The extension exposes Solana's standard features and five twokey: features.

Auto-lock. Dropping the decrypted seed from the extension's session storage after 5, 15 or 60 minutes without use.

Solana

Program-derived address (PDA). An address computed from seeds and a program id that has no private key. Only that program can sign for it.

Bump. The byte added to a PDA's seeds to move the address off the Ed25519 curve. The vault stores its bump.

Rent-exempt minimum. The balance an account must keep to stay on chain, set by the network for its size. A vault always keeps it.

Tombstone. A closed vault: still 91 bytes, still owned by the program, holding the rent-exempt minimum, with the closed flag set. Its address can never be opened again.

Associated token account (ATA). The default token account of a wallet or vault for one mint, at a derived address.

Token-2022. The newer SPL token program, with optional extensions on mints and accounts.

Transfer hook. A Token-2022 extension that calls another program on every transfer. Lean Key v1 refuses mints with one.

Compute units (CU). Solana's measure of execution cost. A transaction sets a limit; Lean Key withdrawals need several hundred thousand.

Upgrade authority. The key that may replace a program deployed with the upgradeable loader. The devnet Lean Key program has one.

sBPF v3. The bytecode version the program is compiled to. It needs Agave 4.x or newer.

Tools and proofs

Lean. The programming language and proof assistant the program, its specification and its proofs are written in. Its kernel checks the proofs.

lean-svm. The compiler from Lean to Solana sBPF bytecode, used at a pinned revision.

Model. program/Twokey/Spec/Machine.lean: the program written as an abstract state machine, about which most theorems are proven.

Test vectors. Inputs and outputs computed by the Lean specification (program/release/vectors.json) that the program and packages/core must reproduce.

LiteSVM. An in-process Solana runtime used to test the compiled program and measure compute units.

Release build. The twokey.so whose sha256 is in program/release/program.json: 14,688 bytes, 4e174b5a9bdd90ca5092b8db8bb4b0b158b722902a75d863ffc47ae684e69b1d.

Open Key Challenge. A funded devnet vault whose owner private key is published, to show that the owner key alone moves nothing. See /challenge.

Unaudited beta. Lean Key's status. Nobody has audited the program or the clients.

Recommended limit. 10 SOL per vault on mainnet, while the program is an unaudited beta.

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.