Skip to content
Lean Key
Command line

leankey

One binary. It keeps your post-quantum seed encrypted on disk, talks to any Solana RPC, and can run a local validator with the release build of the program.

Install
curl -fsSL https://leankey.tech/install.sh | sh

The script picks the binary for your system, checks its sha256 against the one below, and puts it in ~/.local/bin. Or download a binary directly:

  • leankey-macos-arm6460.9 MB · bun-darwin-arm64
    sha256 a247496dd8b76b374c70e27ade978094da7aae85ba5d7d62d2fc10923355e58b
  • leankey-macos-x6467.0 MB · bun-darwin-x64
    sha256 b050f410d0c058a9b36111783498042d77a771b4e2a8a2481cfc11365a5f3bf9
  • leankey-linux-x64105.3 MB · bun-linux-x64
    sha256 d4595c8f6fd527990c8ac1ed4b689887e0dbae88327898169ae87bded0218114

From source, with Bun: bun apps/cli/src/main.ts in the repository. The package is not published to npm, so there is no bunx yet.

first run · localnet
$ leankey localnet --detach
localnet ready http://127.0.0.1:8899 (solana-test-validator)
program TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 (release build, upgradeable, authority CfpbRGhMXWHS29v61t521xr9Jeu9wc2FYkBDXRc2qnnQ)
wallet DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX 100 SOL ~/.leankey/localnet/wallet.json

Version 0.1.0. Binaries are compiled with Bun for macOS (arm64, x64) and Linux x64, with the program, its proofs.json and the release hashes embedded. Windows: use WSL.

Commands

leankey keygen [--out pq.seed] [--import]

Creates the post-quantum seed: prints 24 words once and saves the seed encrypted (scrypt N=32768, AES-256-GCM, file mode 600). --import restores from your 24 words.

leankey open --owner <keypair.json|PUBKEY> --pq pq.seed [--id N]

Opens vault #N (default: the next free one) of the owner. The owner signs InitVault; the seed gives the first one-time key's hash.

leankey status <VAULT> [--pq pq.seed]

Balance, tokens, current key, pending intent and the history decoded from the chain.

leankey deposit <VAULT> <AMOUNT> [--mint MINT] --from <keypair.json> [--pq pq.seed]

Sends SOL, or tokens of a mint (SPL or Token-2022), into the vault. Anyone can deposit. With --pq it first checks that the vault's key comes from your seed.

leankey send <VAULT> <TO> <AMOUNT|max> [--mint MINT] --owner <keypair.json> --pq pq.seed

Withdraws with both signatures. Simulates with a placeholder signature first, signs one intent per key, retries only that intent.

leankey close-token <VAULT> --mint MINT --to <ADDR> --owner <keypair.json> --pq pq.seed

Closes the vault's empty token account and returns its rent.

leankey close <VAULT> --to <ADDR> --owner <keypair.json> --pq pq.seed

Sweeps everything above rent and closes the vault. The address stays as a tombstone and can never be opened again.

leankey pending <VAULT> --owner <keypair.json> --pq pq.seed [--send]

Shows the intent the current key already signed, if any; --send sends exactly that intent again.

leankey vaults <OWNER> [--pq pq.seed]

Every vault of an owner (getProgramAccounts on the owner field). With --pq it marks which hold a key of your seed: anyone with the owner key can open look-alikes with a seed of their own.

leankey verify <VAULT|PROGRAM_ID>

For a program: executable, upgrade authority, sha256 of the deployed bytes against the release. For a vault: PDA, program, state.

leankey proofs [--all]

The theorems and the axioms they rest on, from the proofs.json embedded in the binary.

leankey localnet [--detach] [--reset] [--stop]

A local validator (Agave 4 or later) with the embedded release build of the program and a funded wallet.

Global flags and environment

--network localnet|devnet|mainnet
Which cluster. Default: mainnet, or LEANKEY_NETWORK.
--rpc URL
Your own RPC endpoint.
--program ID
Another deployment of the program.
--payer <keypair.json>
Who pays fees, if not the owner.
--priority <micro-lamports per CU>
A priority fee.
--skip-preflight
Send even if the simulation fails (the program still checks everything).
--json
Machine-readable output on stdout.
LEANKEY_PASSWORD
The seed password for scripts; otherwise it is asked on the terminal, hidden.

What it prints

Recorded from a run on a fresh local validator (2026-12-03): nothing below is edited except the 24 words, which are not kept, and the data directory, shown as ~/.leankey/localnet.

localnet
$ leankey localnet --detach --reset
localnet ready http://127.0.0.1:8899 (solana-test-validator)
program TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 (release build, upgradeable, authority CfpbRGhMXWHS29v61t521xr9Jeu9wc2FYkBDXRc2qnnQ)
wallet DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX 100 SOL ~/.leankey/localnet/wallet.json
leankey keygen --out pq.seed
leankey open --owner ~/.leankey/localnet/wallet.json --pq pq.seed --network localnet
leankey deposit <VAULT> 2 --from ~/.leankey/localnet/wallet.json --network localnet
leankey send <VAULT> <TO> 0.5 --owner ~/.leankey/localnet/wallet.json --pq pq.seed --network localnet
leankey verify TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 --network localnet
running in the background (pid 18356); stop it with: leankey localnet --stop
open
$ leankey open --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/pq.seed
opened 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif (slot 2, vault #0, key #0, 4,461 CU)
deposit
$ leankey deposit 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 2.5 --from ~/.leankey/localnet/wallet.json
deposited 2.5 SOL (slot 5, vault balance 2.50152424 SOL)
send
$ leankey send 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j 1.0 --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/pq.seed
sent 1 SOL to 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j (slot 7, key #0 → #1, 486,660 CU)
status
$ leankey status 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif --pq ~/.leankey/localnet/pq.seed
vault 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif (localnet)
owner DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX
id #0
key #1 pk_hash 818b6fc4a93395b0…
state open
balance 1.50152424 SOL (1.5 SOL withdrawable; 0.00152424 SOL rent-exempt minimum)
history
7 sent 1 SOL → 8h6x… key #0→#1, 486,660 CU
5 deposit 2.5 SOL, 150 CU
2 opened, 4,461 CU
vaults
$ leankey vaults DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX
#0 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif key #1 1.50152424 SOL
verify-vault
$ leankey verify 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif
vault 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif
program TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 (Lean Key on localnet)
address PDA of ["vault", owner, #0] with bump 252
owner DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX
key #1, 1 one-time keys used
state open, created at slot 2
balance 1.50152424 SOL, rent-exempt minimum 0.00152424 SOL
a seed that is not the vault's: refused
$ leankey send 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j 0.1 --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/other.seed
error: Signed, but the simulation failed: BadSignature (6005): The hash signature does not match the vault's current one-time key. Retry the same intent once the cause is fixed.

JSON mode

Add --json to any command for one JSON object on stdout. An error is printed as {"error": "…"} and the exit code is 1.

--json
$ leankey send 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j 0.25 --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/pq.seed --json
{
"signature": "3B8mJL6UgyDcxzaFJfwWg72RgW2hY8Z8XRVcEsG8TynGfKmap9WeoGD8KcCQVtPaUCBoq79hKmGvw2PdXbiebdUP",
"slot": 10,
"amount": "250000000",
"destination": "8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j",
"keyFrom": "1",
"keyTo": "2",
"computeUnits": 607530
}

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.