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.
curl -fsSL https://leankey.tech/install.sh | shThe 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-arm64sha256 a247496dd8b76b374c70e27ade978094da7aae85ba5d7d62d2fc10923355e58b
- leankey-macos-x6467.0 MB · bun-darwin-x64sha256 b050f410d0c058a9b36111783498042d77a771b4e2a8a2481cfc11365a5f3bf9
- leankey-linux-x64105.3 MB · bun-linux-x64sha256 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.
$ leankey localnet --detachlocalnet 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.seedWithdraws 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.seedCloses the vault's empty token account and returns its rent.
leankey close <VAULT> --to <ADDR> --owner <keypair.json> --pq pq.seedSweeps 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.
$ leankey localnet --detach --resetlocalnet ready http://127.0.0.1:8899 (solana-test-validator)program TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 (release build, upgradeable, authority CfpbRGhMXWHS29v61t521xr9Jeu9wc2FYkBDXRc2qnnQ)wallet DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX 100 SOL ~/.leankey/localnet/wallet.jsonleankey keygen --out pq.seedleankey open --owner ~/.leankey/localnet/wallet.json --pq pq.seed --network localnetleankey deposit <VAULT> 2 --from ~/.leankey/localnet/wallet.json --network localnetleankey send <VAULT> <TO> 0.5 --owner ~/.leankey/localnet/wallet.json --pq pq.seed --network localnetleankey verify TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 --network localnetrunning in the background (pid 18356); stop it with: leankey localnet --stop
$ leankey open --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/pq.seedopened 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif (slot 2, vault #0, key #0, 4,461 CU)
$ leankey deposit 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 2.5 --from ~/.leankey/localnet/wallet.jsondeposited 2.5 SOL (slot 5, vault balance 2.50152424 SOL)
$ leankey send 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j 1.0 --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/pq.seedsent 1 SOL to 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j (slot 7, key #0 → #1, 486,660 CU)
$ leankey status 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif --pq ~/.leankey/localnet/pq.seedvault 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif (localnet)owner DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmXid #0key #1 pk_hash 818b6fc4a93395b0…state openbalance 1.50152424 SOL (1.5 SOL withdrawable; 0.00152424 SOL rent-exempt minimum)history7 sent 1 SOL → 8h6x… key #0→#1, 486,660 CU5 deposit 2.5 SOL, 150 CU2 opened, 4,461 CU
$ leankey vaults DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmX#0 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif key #1 1.50152424 SOL
$ leankey verify 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mifvault 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mifprogram TwoKWxqD6kL6ow9bAEZ3Kir9hUFKbocX4LZR4j5R3W6 (Lean Key on localnet)address PDA of ["vault", owner, #0] with bump 252owner DBTRfcCAPX6p4BmDpNLFjEEhsawniMCJSnBG3yZ78bmXkey #1, 1 one-time keys usedstate open, created at slot 2balance 1.50152424 SOL, rent-exempt minimum 0.00152424 SOL
$ leankey send 4Cjv5DktBvhWvtvhxsNCuJuvP7ehUfXaLfPQSnRz4Mif 8h6xxyjezWioMCrhc2JRYH8PgnPZh485LyNQ1hnnFD8j 0.1 --owner ~/.leankey/localnet/wallet.json --pq ~/.leankey/localnet/other.seederror: 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.
$ 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}