Ethlabs
Funding Thesis Writings

← All writings

Demystifying leanVM -- Part 1: Motivations

November 30, 2026 · published as an article on X

(Thanks to Kev, Vitalik, Emile, and Thomas for reviewing this article. Any takes/errors are mine.)

leanVM is the centerpiece technology underpinning Ethereum's new vision of being a "cryptographic world computer," but it's also one of the least understood topics even among core devs.

Within the next few Ethereum upgrades, leanVM will begin securing post-quantum (PQ) signatures for validators and users, making it the single most security-critical component of the Ethereum stack. It's therefore all the more important that the broader ecosystem shares at least a high-level understanding of leanVM.

Furthermore, leanVM will unlock a new programming paradigm that complements smart contracts -- a paradigm that Vitalik has called “the proof singularity” (EIP-8288). For any "pure computation" that's too expensive to run on-chain (e.g. unconventional signatures, FHE computation, and even AI inference), one can prove the computation off-chain, submit the proof to the protocol, and cheaply verify the results on-chain. In other words, leanVM will enable developers to "cheat" expensive computations on-chain, not unlike what ZK rollups do today but for a much wider range of use cases.

Diagram: Alice, Bob, Carol and Dave’s computations (PQ sigs, AI inference, FHE result) are proven in leanVM as Proof A and Proof B, which are aggregated by leanVM into one aggregated proof included on-chain in a block

Because leanVM is so essential to the future of Ethereum, I'm writing a series of articles to demystify leanVM. In this first article, we will explain what motivated the creation of leanVM in the first place.

#The weaknesses of PQ signatures

To understand leanVM, we need to first talk about post-quantum (PQ) signatures.

Recall that both BLS and ECDSA -- the signature schemes used by Ethereum validators and users respectively -- are vulnerable to quantum computers. Therefore, we've known for a long time that Ethereum must switch to PQ signatures.

However, all known PQ signatures suffer from a great weakness: they cannot be easily aggregated. Aggregation is key to how Ethereum consensus works today, because Ethereum has the largest validator set of any blockchain -- 770k+ validators across 8k+ physical nodes as of today. Without aggregation, the network and computational overhead of the consensus protocol explodes. Thanks to BLS signatures, tens of thousands of validator signatures can be "merged" into just a few signatures, allowing validators to easily verify the validity of blocks.

But as we said, PQ signatures can't be easily aggregated. The reason why this is true is profound: the specific algebraic structure that gives BLS native aggregation -- so-called "pairing-friendly elliptic curves" -- is the very structure that quantum algorithms such as Shor's break. In other words, PQ signature schemes are PQ in large part because they avoid the aggregation-friendly algebraic structures that quantum algorithms (and increasingly powerful AI) attack.

What makes matters worse is the fact that PQ signatures are MUCH larger than EC signatures. leanXMSS (Ethereum’s replacement for BLS) for example is 2.4KB large, versus just 96 bytes for BLS. That's 25x larger! Therefore, it's all the more important that we aggregate PQ signatures so they don't overwhelm the network's bandwidth.

#Aggregating PQ signatures via STARKs

Thankfully, there's a known trick for aggregating PQ signatures -- STARKs. Recall that a STARK is a proof of a (presumably expensive) computation, such that the proof is much cheaper to verify than re-running the original computation. For example, if you want to convince someone that 1,000 PQ signatures are valid, you can generate a STARK from verifying the 1,000 PQ signatures yourself, then others just have to check that one STARK to know that the 1,000 PQ signatures are indeed valid.

If this doesn't make sense, here's a simple analogy: imagine you work at a bank and you want to check that 1,000 checks are valid. You check the 1,000 checks yourself, then you sign a piece of paper saying "these 1,000 checks are valid." Now, your colleagues just have to look at your paper to know that the 1,000 checks are valid. They don't have to re-check the 1,000 checks themselves. Your signed paper is the STARK in this scenario.

(Of course, this analogy breaks down if your colleagues don’t trust you, but the beauty of STARKs is that you are only trusting math).

But how exactly do you generate STARKs? Most people use zkVMs. Recall that a zkVM is a virtual computer that generates proofs (STARKs) for any program that runs on it. So in practice, a developer can write a program in a normal programming language, say Rust, and the zkVM can execute that program and generate a STARK proof for the execution. It's a powerful paradigm that's already being used for ZK rollups, privacy protocols, and other applications.

#Why not use existing zkVMs?

OK, so problem solved, right? We replace BLS and ECDSA with PQ signatures, then we aggregate them by verifying the signatures inside a zkVM and generating a STARK. So why do we need leanVM again?

The issue is that we skipped over a critical part -- generating the STARK is a very computationally expensive job. Recall that Ethereum produces a block every 12 seconds, and there are proposals such as Quick Slots (EIP-8198) to further lower the slot time. Therefore, whoever aggregates PQ signatures into STARKs must do so within 12 seconds, for tens of thousands of PQ signatures!

(In reality, due to the way Ethereum consensus works, an aggregator has far less than 12 seconds to aggregate, because some of the time must be spent on other duties such as voting.)

So that leads us to answering the first question: why does Ethereum need to build its own zkVM? It's because existing zkVMs are designed to be general-purpose in order to support proving arbitrary programs, so they are not optimized for the specific purpose of proving PQ signatures at scale -- something that Ethereum, with its large validator set, needs to do. In practice, using an existing zkVM would mean that you'd need exceedingly expensive hardware to prove Ethereum's signatures at scale, forcing validators to heavily centralize.

However, if we want to squeeze out as much performance as possible from proving a program, there’s a different path we can take -- custom circuits. Instead of using a zkVM which can generate STARKs from any program targeting the VM, a custom circuit generates STARKs for just a specific program. Skipping over the VM abstraction allows us to achieve maximal performance. Given that Ethereum has very specific workloads, why not just build a custom circuit for each of those workloads?

#Why build a zkVM at all?

Indeed, the leanVM team had previously experimented with building custom circuits and confirmed that it could be 2x faster or more than a custom VM. However, there were three factors that ultimately pushed the team towards the VM approach:

#Recursion

Recursion is the idea that you can aggregate aggregations. Recall again the image from the beginning of the article:

Diagram: Alice, Bob, Carol and Dave’s computations (PQ sigs, AI inference, FHE result) are proven in leanVM as Proof A and Proof B, which are aggregated by leanVM into one aggregated proof included on-chain in a block

Here, Proof A aggregates Alice’s and Bob’s computations, while Proof B aggregates Carol’s and Dave’s. Proof A and Proof B are then further aggregated into a recursive proof -- that’s what I meant by recursion, and the recursion tree can in practice go much deeper.

Why’s recursion important? Because it enables parallel aggregation. Say you have 1,000 signatures. Instead of aggregating them all in one go, what you could do instead is to divide them into 10 batches of 100 signatures, so that 10 nodes can aggregate them in parallel and output 10 aggregated proofs. Then finally, you aggregate the 10 aggregated proofs to produce 1 final proof that covers all 1,000 signatures. Ethereum benefits greatly from this type of parallel aggregation because it has a very large set of validators and mempool nodes.

However, custom circuits would not be able to handle recursion elegantly, because recursion in practice has to handle inputs of many different shapes. For example, these are all valid inputs to aggregation:

To support all these different "shapes" with custom circuits, we'd in practice need to build multiple versions of effectively the same circuit, just to be able to take different inputs. This would be error-prone and difficult to maintain.

On the other hand, having a zkVM allows us to aggregate a large variety of input shapes with a single guest program, because a high-level program can easily use loops and arrays to handle variable-sized inputs.

#Crypto Agility

As a more general point to the above, custom circuits are just more difficult to iterate on. It takes long periods of research to settle on the exact PQ schemes that Ethereum wants to support -- in fact, the research is still ongoing as of right now! If every time a researcher tries a new signature scheme or simply adjusts some parameters, they have to modify the ZK circuit, that'd dramatically slow down research iterations.

(One reviewer noted that over the past year, editing circuits has become significantly easier thanks to advances in AI, so this point may matter less now than when leanVM was created.)

Using a zkVM therefore enables crypto agility -- we can implement new signature schemes faster because we can develop them in high-level languages, and they will be much easier to audit and secure.

#Formal Verification

Recall that leanVM is the single most security-critical component of the whole Ethereum stack. If leanVM has a bug, attackers may be able to compromise Ethereum's consensus and steal users’ funds. Therefore, leanVM must, in a real sense, be bug-free.

As engineers know, the simpler a program is, the easier it is to secure. Custom ZK circuits are the opposite of simple -- they are hard to formally verify and hard to audit. On the other hand, leanVM is a tiny VM with only 5 opcodes and 1 precompile (KECCAK) as of today. And since all the aggregation logic is implemented with a single guest program, we just have to secure a single guest program and the zkVM itself, as opposed to securing a large number of circuits.

Last month, leanVM achieved the important milestone of being end-to-end formally verified, becoming the first zkVM to do so. The formal verification still has major gaps -- only the Lean spec is proven but not the Rust implementation -- but it speaks to how leanVM's simple architecture enables a much higher degree of security assurance than traditional software.

(Incidentally, I confirmed with the leanVM authors that the “lean” in leanVM has nothing to do with Lean the programming language -- it was just a naming coincidence. That said, leanVM now uses Lean extensively for formal verification.)

#Conclusion

To recap:

In this article, we talked about the why of leanVM. In the next article, we will discuss the what -- what does leanVM actually "look like" from a developer's perspective? How do you actually use it? We will get to that soon!

Read the original on X →