← Articles
Lean Client: a Solana validator client written in Lean 4, with proofs in the build logo
solana

Lean Client: a Solana validator client written in Lean 4, with proofs in the build

· DEC 4, 2026 ·
Read
Share

A fifth Solana client codebase appeared on 26 November 2026, written in Lean 4 and built by its own compiler, and the build refuses to finish unless every array access carries a proof. We built it from source, matched a release binary byte for byte, and set out what the proofs do and do not cover.

devrels.xyz/a/411

Solana has Agave and Firedancer in production, and Sig and Mithril in progress. On 26 November 2026 a fifth codebase appeared on GitHub: Lean Client, a validator client written in Lean 4. It is days old, has one committer and has not been audited. It is also an unusual experiment: the build refuses to finish unless every array access in the client carries a proof.

We read the repository, built it from source and ran parts of it. This article says what we checked, what we did not, and what the claims do and do not mean.

What it is

Lean Client is an MIT-licensed project by a developer who goes by MidTermDev. Its project page is on devrels.xyz. The repository, MidTermDev/lean-Solana-client, had its first commit on 26 November, and by 30 November it had 107 commits, 21 tagged releases and 11 stars. It contains two things, plus a site:

  • leansol, the client. About 26,000 lines of Lean 4 according to the site. We counted about 31,000 lines across all .lean files, tests included.
  • leanc, its own compiler. It turns a subset of Lean 4 into a static x86-64 Linux executable, with no LLVM, no libc and no C backend. The compiler itself is about 8,000 lines of C. It is not self-hosting yet.

The README says the idea came from a remark by toly that a Lean client would be easy with a dependency-free Lean compiler and a raw futex for inter-process messages. It also runs programs built by lean-svm, which the README attributes to toly.

How the proofs work

Lean can attach a proof to code. Here is the pattern the site shows. It reads a little-endian u16 from untrusted bytes:

text
def u16At (b : ByteArray) (o : Nat) : UInt16 :=
  if h : o + 2 ≤ b.size then
    b[o].toUInt16 ||| b[o + 1].toUInt16 <<< 8
  else
    0

The if h : test gives Lean a fact, o + 2 ≤ b.size. Lean needs a proof that b[o] and b[o + 1] are in bounds, and it finds one from that fact. If you remove the test, the file does not compile. We ran this snippet on official Lean 4.36.0 and it works. The site labels it Wire.lean, but no function by that name exists in the repository. The same pattern appears in real code, for example byteAt in lib/Net/Quic.lean.

Three layers are involved:

  1. Lean's kernel checks the array-index proofs. This happens in the official toolchain (lake build, which CI runs on every commit), not in leanc. We ran it on the main branch: 170 build jobs finished with no warnings, and we found no sorry, axiom or native_decide in the sources.
  2. leanc's own prover handles most Nat overflow checks. The README's sample output reads "Nat operations proven never to fail: 2560 of 2560 (by Lean's kernel: 298)". So most are proven by leanc's own prover, about 1,400 lines of C. That prover is trusted code. leanc itself does not check proofs.
  3. Differential tests compare leanc output with official Lean and, for the sBPF VM and built-in programs, with Agave's runtime.

Checking the numbers

We built the client two ways.

  • At tag v0.19.0, we built leanc from its C source with gcc, then compiled the client with it. The result is byte-identical to the published release binary, SHA-256 e7555412c5e9b8c78414be79181c7f0e8fa2eae8c0ed3bab5125e8b43631d157. That confirms the reproducible-build claim for that release. The build reported 1,921 array accesses proven.
  • At the main branch (30 November), the compiler printed "array accesses proven never to fail: 2096 of 2096", the figure on the site. The release tag and the site were 15 commits apart, which is why the counts differ.

We also ran a sample counter program from the repository through leansol run, with no network access because the binary is unaudited. It used 50 compute units and moved the counter from 999 to 1000.

The proofs show memory safety: no out-of-bounds read, no integer overflow, no missed match case. They do not show that the client is correct. The roadmap lists "proofs beyond memory safety" as a later idea. Running out of memory or stack is outside the proofs, and a few dozen lines of raw loads and stores in rt/Rt.lean are trusted, along with leanc itself.

When we read it, the README's FAQ still answered "Are there proofs?" with "Not yet", so trust the site and the build output over the README.

What it does today

The site and README list the following. Apart from running a sample program in the VM, we did not reproduce any of it. It rests on the project's own tests.

  • Gossip on mainnet, testnet and devnet, with Ed25519 checks on every record.
  • Fetching and verifying a block down to its transaction signatures.
  • An sBPF virtual machine for versions 0 to 3, with SPL token programs, Anchor programs and cross-program calls.
  • Turbine shred receipt, repair, snapshot loading, and block execution to mainnet bank hashes. The README says it arrived at the bank hashes of tens of thousands of blocks in a row.
  • Alpenglow certificate checks and a vote service, which runs in shadow until the vote account has stake.

What it does not do

  • No voting with stake, no block production. Both are on the roadmap. The README calls it "not a voting validator yet".
  • Feature activations are not followed. When mainnet uses something its tests do not hold, the executor stops rather than guess. The README says a dozen such cases stopped it in its first 47,000 blocks.
  • x86-64 Linux only, and a subset of Lean: no type classes or lambdas.
  • Not independently checked. One committer, no audit, and outside users have only just started opening issues. One of them, from a fuzzing run against Anza's solana-sbpf, reports a one-line log difference at the compute budget boundary. So "compute-unit for compute-unit with Agave" is the project's claim, and it has an open exception.
  • Young code. The README says its Ed25519 is variable-time: fine for verifying public data, not for long-lived secret keys.

Where it sits

lean-svm compiles Lean to sBPF programs, and Lean Client's VM runs them. qedsvm models sBPF in Lean to prove properties of compiled programs. Lean Client's VM is an executable tested against Agave, not a formal model. We cover the proof side in our Lean article.

For client diversity, the numbers are lopsided. On 29 November, Agave-based clients ran about 81% of voting stake and Firedancer-based clients about 19% (data from solpilled.com, read from getVoteAccounts). Sig, written in Zig, says in its README that v2 is not yet a complete validator: it has no repair yet and needs Agave to produce a leader schedule. Mithril, written in Go, runs as a full node and produced blocks on the Alpenglow community test cluster in June. Its README now lists experimental Alpenglow voting and block production, says it still needs RPC for catch-up, and says it is not yet production-ready. See our pieces on the client landscape and Alpenglow.

Diversity only helps when the code is independent and carries stake. Lean Client's README names Agave's gossip code as its reference for wire formats, and it carries no stake yet. It is a different way to build a client, not yet a diversity gain on mainnet.

Funding

The site and README say development and the live node's hardware are paid for by a token on Solana, called $LEAN. The client is free and MIT-licensed. We take no view on the token and do not cover it here.

If you want to try it

  • Check the SHA-256 against SHA256SUMS on the release page, or build from source.
  • Run it on devnet or testnet, with no real keys and no stake.
  • Read leanc/prove.c before you rely on the proof counts.

Conclusion

Lean Client is the first attempt we know of to build a Solana validator client where memory-safety proofs are a condition of the build. It is days old, unaudited, and cannot yet vote with stake or produce blocks. The reproducible build checks out. The idea is worth watching, and the number to watch is not 2,096 but how many properties get proven beyond memory safety.

Sources

Keep reading

Get new articles in your inbox

Technical deep-dives on Solana tooling, infrastructure, and ecosystem. No noise.

solanaleanvalidatorclient-diversityformal-verificationsbpf

DevRels · December 4, 2026

Lean Client: a Solana validator client written in Lean 4, with proofs in the build | devrels.xyz