docs

Each part, one level deeper.

Lean Client is open-source software for Solana, built around Lean 4. It began as a validator client, and the name stayed. Today it is five parts in three repositories. This page gives each part a few paragraphs: what it is, what is proven, what is only tested, where it stands, how to start, and where the code is.

the map

Five parts, in three repositories.

Every part of Lean Client: what it is, its status, its repository, where to open it, and its licence
partwhat it isstatusrepositoryopen itlicence
The validator a Solana validator client written in Lean 4 early lean-Solana-client the public node MIT
The compiler our own compiler, from a subset of Lean 4 to a Linux program; it builds the validator usable today lean-Solana-client, leanc/ Compile your own MIT
Lean Solana Kit for writing Solana programs in Lean usable today lean-solana-kit Getting started Apache-2.0
Lean AMM a token exchange and launchpad live lean-amm amm.leanclient.app · its stake view Apache-2.0
Lean Verify verified builds for programs written in Lean usable today lean-Solana-client, verify/ leanclient.app/verify MIT

This site's source is in lean-Solana-client, web/; the executor profile is at /programs, and the node's open data is below.

Built on the work of others: Lean 4, and lean-svm, Anatoly Yakovenko's compiler from Lean to Solana programs, which the kit and Lean AMM build on.

words

Words used on this page

Lean 4 is a programming language in which code can carry mathematical proofs. Lean's kernel is the part of Lean that checks them.

Proven means a statement whose proof Lean has checked by machine. It holds for every case the statement covers, and for nothing the statement leaves out.

Tested means compared with a reference: Agave, the official Lean toolchain, or mainnet itself. That is evidence, not proof.

Verified build means an independent service rebuilt a program from its public source and got exactly the bytes on chain. It says the source is the program, not that the program is right.

None of the three is an audit. No security audit of any part has been published.

Live: deployed on mainnet, and anyone can use it now. Usable today: you can get it and use it now. Early: it runs and you can use it, but it is young, with known stops.

01 · validator

The validator

Early. A public node runs it on mainnet; the front page shows what it is doing right now.

A validator client is the software a machine runs to take part in Solana: receive blocks, check them, run their transactions, and vote on the result. Ours is an independent implementation, written from scratch in Lean 4, in one program, leansol. It joins the gossip network and checks every signature it hears. It receives each block in pieces and verifies it. It loads Solana's state from a snapshot, executes every transaction of every block, and compares its result with the one the block's leader signed. It can vote under Alpenglow, Solana's consensus rules, and has the code to build blocks as a leader.

What is proven. Every array access in its source is proven in bounds: the build refuses one written without a proof, and Lean's kernel checks the proofs in CI. The voting rules carry theorems: no two votes that contradict each other, also after a restart, and a decision for every slot by its deadline.

What is tested, not proven. Everything else: execution, cryptography, networking, block production. Execution agreed with Agave, the reference client, on all 47,071 shared instruction fixtures (run of 5 December 2026), and it is checked against mainnet block after block: if a result differs, it stops.

Where it stands. It has voted on mainnet. Block production is written and tested on mainnet blocks; the public node has not yet had a leader slot. When mainnet does something the validator does not model, it stops instead of going on wrong. That has happened several times, sometimes for hours, and each fix needed a person. It can also fall behind the chain without stopping. While stopped or behind, it does not vote usefully.

start

1. Build it and watch the network. Needs Linux x86‑64, git and make. No C compiler and no Lean installation.

git clone https://github.com/MidTermDev/lean-Solana-clientcd lean-Solana-clientmake && make test./build/leansol

It joins mainnet's gossip and shows a dashboard. Nothing has to be opened inbound.

2. Or download the release.

curl -LO https://github.com/MidTermDev/lean-Solana-client/releases/latest/download/leansol-x86_64-linuxchmod +x leansol-x86_64-linux && ./leansol-x86_64-linux

The release binary joins gossip and verifies blocks. To execute and vote, build from source (step 1).

3. Execute the chain and vote. This needs a build from source, a large server, and someone to look after it: someone who can read a log and rebuild from source when it stops. The README has the commands.

02 · compiler

The compiler

Usable today. It builds the validator.

leanc is our own compiler. (Lean itself ships an unrelated tool of the same name.) It turns a small, deliberately simple subset of Lean 4 into a single Linux program for x86‑64. It writes the machine code itself: no C is generated, and no assembler or linker is run. It builds the validator. It does not build on-chain programs: the kit and Lean AMM use lean-svm for those. A copy of the compiler is checked into the repository, so building the validator needs only git and make.

What is proven. Nothing about the compiler itself. Its part in the validator's proofs: the build refuses an array access written without a proof that it stays in bounds, and leaves out the check that the proof makes unnecessary, so a proven check costs nothing when the program runs. Lean's kernel checks those proofs in CI, with the official Lean toolchain. Number overflow is ruled out by the compiler's own prover, which is tested, not proven.

What is tested, not proven. That the compiler translates Lean faithfully. Its output on its test programs, except four that use raw system calls, is compared with the official Lean toolchain's in CI.

Where it stands. The compiler is written in C today. We are rewriting it in Lean, so that it can compile itself: that rewrite is in progress. Until it is done, the C compiler is the one in use.

start
git clone https://github.com/MidTermDev/lean-Solana-client && cd lean-Solana-client && make./build/leanc -I rt -o hello hello.lean && ./hello

The first line builds the validator with the checked-in compiler. The second compiles a program of your own, a hello.lean that you write (the README has one to copy). The compiler accepts a subset of Lean 4 and makes programs for Linux x86‑64 only; the README lists what you can write.

03 · developer kit

Lean Solana Kit

Usable today. Tested on Linux x86‑64.

Lean Solana Kit is for writing your own Solana programs in Lean, where you can also state what a program must do and have the computer check it. It has three pieces. Kit is a library of the small building blocks every program needs: signer, owner and key checks, overflow-checked math, lamport moves, token calls. Some of them are lean-svm's own functions; for those, Kit supplies the theorems. lsk is a command with six steps: new, build, test, prove, deploy, verify. The last two print the commands for you to run; they touch no wallet. The prover holds a description, in Lean, of Solana's bytecode (the compiled form its programs run in). With no proof written by hand, it tries to prove that your compiled program matches your source.

What is proven. Each building block comes with a theorem that says what it does; the blocks that call other programs are proven under stated assumptions about those programs. And, for the starter program and small programs like it: whenever the compiled program finishes, the Lean source gives the same result and leaves the same account bytes. That proof does not rest on the compiler being right. Since v0.2.0 this includes small programs that pay through the System or Token program, under two stated assumptions: inputs laid out as Solana lays them out, and a call answered from what it contains (argued from Agave's code, not proven).

What is tested, not proven. Every other program. The prover does not yet handle larger programs that call other programs, most loops, or every Kit block. Then lsk prove says NOT PROVEN, and the program is tested in LiteSVM, a local test runtime built from Agave's code.

Where it stands. New: first released in December 2026. It builds on lean-svm, Anatoly Yakovenko's compiler from Lean to Solana programs; that compiler is his work, not ours. Proofs are not an audit.

start
curl -sSfL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y --default-toolchain nonegit clone --branch v0.2.0 https://github.com/MidTermDev/lean-solana-kitexport PATH="$HOME/.elan/bin:$PWD/lean-solana-kit/bin:$PATH"lsk new hello && cd hello && lsk test && lsk prove

Needs Linux x86‑64, git, curl, Node.js and Rust. About five minutes the first time; it ends with bytecode: PROVEN. The starter is a counter, with a proof of what a successful add does. You install the kit by cloning the tag. There is no package: the packages named lsk on npm and crates.io are not ours.

04 · exchange

Lean AMM

Live on Solana mainnet. Not audited by a security firm. Its deployer can upgrade the program.

Lean AMM is an on-chain program where anyone can open a pool for two tokens, trade against it, or launch a new token on a curve. The program is written in Lean 4. It takes no platform fee and has no admin instruction. A launch curve has no liquidity to add or remove, and no later migration. The app at amm.leanclient.app builds each transaction and your own wallet signs it.

What is proven. Two things. The arithmetic: a swap never lowers the product of the pool's reserves, a deposit pays for its shares, and a withdrawal is paid no more than its shares are worth. And the compiled bytes, by a proof written by hand with the kit's description of Solana's bytecode: for the build on mainnet, on the instruction shapes the theorem lists, a run that finishes returns the same result and leaves the same account bytes as the Lean source. It assumes three stated properties of how Solana handles calls to other programs, argued from Agave's code and not proven; a model runtime that answers the AMM's calls as the System and token programs do is proven to have all three. As first published, the first of those assumptions was too strong for any real runtime to meet, so the theorem covered no run that makes a call; a review found this and it was corrected on 6 December 2026 (kit v0.2.0), with no proof and no program changed. Not covered: inputs that repeat an account just before one holding more than 0.0105 SOL, runs that fail or run out of compute, and what each whole instruction does with funds.

What is tested, not proven. What each whole instruction does with accounts: covered by tests, not yet by a theorem that says it. The app and its backend are ordinary software.

Where it stands. The proof about the bytes is about one build. On 5 December 2026 that was the build on chain, and OtterSec's verifier reported it as matching the public source; the Verify page shows its answer now. After an upgrade, the proof says nothing about the new build until that build is proven.

The stake pool. The app's Stake view uses a standard SPL stake pool whose token is lSOL. It is not Lean code and no proof covers it. It delegates to the validator's vote account; the public node's panel shows whether that validator is voting.

start

Open the app and connect a wallet: amm.leanclient.app . Or check the chain yourself, from a clone of the repository:

make onchain PROGRAM=AMXwyCL9aEBrbEWdMEi1ro89VCwPhNrQPdeRkGCf9n8Elake build AmmProofs.Deployed

Two separate checks. The first builds the program and compares it with the program on mainnet, byte for byte. The second checks the proofs. Both need Lean (through elan); the first also needs the Solana CLI.

05 · verified builds

Lean Verify

Usable today. One image, for one Lean version, on linux/amd64.

When you deploy a program on Solana, people can see only its compiled bytes. A public verifier, run by OtterSec, rebuilds a program from its public repository and reports whether the result is exactly the bytes on chain. That verifier rebuilds programs inside a Docker image and expects a Rust build. Lean Verify is an image in which that build step runs your Lean build instead, with the official Lean release (4.36.0, the only version offered today).

What is proven. Nothing: Lean Verify is not a proof tool. A verified build says one thing: the public source builds to the bytes on chain. It is not an audit. If your build runs lake build, the theorems in the modules it builds are checked before anything is compiled.

What is tested, not proven. The method. Lean AMM is verified by the same method, with its own earlier image.

Where it stands. New: no program is on record as verified through this image yet.

start

From your program's repository:

alias lean-verify='docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/build" ghcr.io/midtermdev/lean-verify:4.36.0'lean-verify init <name> '<your build command>'lean-verify check <PROGRAM ADDRESS>

init records how your program builds. check builds it, compares it with the program on chain, and prints the two commands that publish the result. Needs Docker. Publishing also needs the solana-verify tool and the program's upgrade authority. In a kit project, lsk verify <PROGRAM> prints these steps; you run them.

06 · node and data

Node and data

The public node. The front page shows what the public node is doing right now: what it sees in gossip, the blocks it has verified, where its executor is, and what mainnet's RPC says about its vote account.

Executor profile. /programs lists the 300 on-chain programs that took the most of the executor's time since it last started: time per compute unit, calls, share. It is one machine's profile, not a benchmark.

Open data. The pages' data is open: /api/summary.json, /api/programs.json, /api/nodes.json (a large file) and /metrics. They are conveniences behind the pages, with no promise that they stay as they are. The site's source is in web/.