Lithe: A Formally Verifiable EVM Language Built for Agents
I started with a question: could AI agents design and build a new smart contract language from scratch? I put it to the test and asked agents to build one for the EVM, with its own compiler and standard library.
Twelve days later, the first version worked. Its bytecode was already about 30% smaller than optimised solc. Smaller code is cheaper to deploy, so we kept optimising.
The result is Lithe, an EVM language with formal verification built in. That makes it a good fit for agents: the compiler enforces rules that models tend to forget, its diagnostics suggest fixes, and lithe prove checks the bytecode against a spec, so no one has to take the agent's word for it.
Why a New Language
Agents now write smart contracts, and attack them too. Anthropic's SCONE-bench tested 10 models on 405 contracts that had been exploited in the real world, and together they exploited about half of them.
The expensive bugs are mostly ordinary. Access-control flaws, like a missing caller check, made up about two thirds of the $1.42B in 2024 losses that OWASP reviewed. Solidity mostly leaves this to convention, and models forget conventions just like people do. Lithe turns much of that into compiler rules and makes the rest easy to audit.
Most stolen value overall is still lost offchain, through stolen keys and compromised infrastructure, which no language can fix.
Secure by Construction
When a Solidity function calls another contract, that contract can run whatever it wants before the function finishes, including calling back into it. In Lithe, every entrypoint is one state transition, and calls that change state wait until it's done.

Here's a small vault. On lines 46 and 47, withdraw has the transfer written before the balance update.

In Solidity, that's the bug that caused the 2016 Ethereum DAO hack. In Lithe, defer holds the transfer until the new balance is saved.
The owner check on line 31 covers the whole group. Any OwnerAction added there is checked automatically. And if an external function can raise an error but doesn't declare it in raises, it won't compile.
Easier to Audit
A wrong check still compiles, but Lithe makes it easy to spot. lithe abi-tree shows the path to each function and the guards on it. lithe footprint shows what each function writes, defers, and raises.

setFee went missing, its guards list would say none.Formal Verification
A developer writes a spec for what the contract should do, and lithe prove checks it for every input and every order of calls. It checks the bytecode that gets deployed, so a compiler bug that breaks the spec shows up too. lithe prove --code can also check contracts already deployed onchain.

setFee is four lines.Benchmarks
We compared Lithe with solc and Solar, Paradigm's new Solidity compiler, across 51 benchmark contracts. Lithe's optimiser brings plenty of new ideas and borrows some from Solar.

Across all 51, Lithe came out ahead on everything we measured:
- Bytecode: about 40% smaller than the best
solcbuild, 7% smaller than Solar's size build - Deployment: 34% less gas than
solcfor OpenZeppelin's ERC-20, 41% less for the ERC-721 - Transactions: about 2.5% less gas than
solc, roughly even with Solar - Compile time: about 0.6 seconds for all 51 contracts, vs 0.7 for Solar and 3.2 for
solcat its fastest
Built by Agents, for Agents
Agents built Lithe in Recur, an agent workflow tool we also released. Recur hands each task to a team of agents that plan, code, and review each other's work until it's done. They wrote about 140,000 lines of Rust and about 20,000 lines of Lithe, a language none of them had ever seen before.
It's built for agents to use too. The compiler gives hints: if an agent forgets to make deposit payable, it says to write external payable function, so the agent can fix it. lithe analysis prints what each function reads, writes, and raises as JSON, so an agent can check a contract without parsing the code. The docs come as plain text for models, and their code examples are checked against the compiler.
The biggest lesson was to give agents checks they can't fake. One agent reported that a compiler change didn't affect the ABI output. Most of the contracts it compared didn't compile, so it was really comparing error messages. The benchmarks leave no room for that: every transaction is replayed against the Solidity builds, and return data and logs either match or they don't.
Try Lithe
With Voyager, we're building payment rails for an internet where agents pay for data and services, with safeguards enforced in code. Lithe asks the next question: can agents write those safeguards themselves, with results any human can check?
Lithe is still experimental, but it's already running on Ethereum mainnet. We used it to migrate Modularium's NFT contracts, replacing the Solidity versions. The coolest result was the art that's drawn onchain: several contracts return byte-identical output to their Solidity versions, with rendering consuming 65–79% less gas. The contracts also have 40 spec files, formally verified with lithe prove.
At Celestia Labs, we're actively developing AI tools to help us build faster and more secure blockchain infrastructure and applications.
If you're building an EVM project and want contracts that are easier to audit and verify, try Lithe in the playground, read the docs, or explore the repo.