My initial inquiry was whether AI agents could create a novel smart contract language from the ground up. To explore this, I tasked my agents with developing one for the EVM, complete with its own compiler and standard library.
After just twelve days, the first version was operational. Its bytecode was approximately 30% smaller than that of the optimized solc. Since smaller code results in reduced deployment costs, we persisted with further optimizations.
The outcome is Lithe, an EVM language that incorporates formal verification. This makes it particularly suitable for agents: the compiler imposes rules that models often overlook, its diagnostics offer suggested corrections, and lithe prove validates the bytecode against a specification, eliminating the need to rely solely on the agent's assurances.
Why a New Language
With agents now capable of both writing and attacking smart contracts, Anthropic's SCONE-bench evaluated ten models against 405 contracts that had previously been exploited, and they successfully compromised approximately half of them.
The costly bugs primarily stem from common issues. Problems related to access control, such as an absent caller check, accounted for around two-thirds of the $1.42 billion in losses recorded in 2024, as reviewed by OWASP. Solidity largely leaves these matters to convention, which models can forget just like humans. Lithe transforms much of this into compiler rules and simplifies the auditing process.
Meanwhile, the majority of lost value continues to occur offchain, due to stolen keys and compromised infrastructure—an issue no language can address.
Secure by Construction
In Solidity, when one function calls another contract, the latter can execute any operation before the initial function completes, including making recursive calls. Lithe, on the other hand, treats every entrypoint as a distinct state transition, ensuring that state-altering calls wait until the transition is fully executed.

Below is a snippet from a small vault. In lines 46 and 47, the withdrawal operation includes the transfer before the balance update.

This issue in Solidity was responsible for the 2016 Ethereum DAO hack. In Lithe, the defer function postpones the transfer until the new balance is confirmed.
The owner verification on line 31 encompasses the entire group. Any OwnerAction added in this manner is automatically verified. Furthermore, if an external function can generate an error but fails to declare it in raises, the compilation will fail.
Easier to Audit
While an incorrect check can still compile, Lithe facilitates the identification of such errors. The lithe abi-tree illustrates the pathway to each function and the corresponding security measures in place. Additionally, lithe footprint displays what each function writes, defers, and raises.

Formal Verification
A developer formulates a specification detailing the contract's intended actions, and lithe prove assesses it against every possible input and sequence of calls. It verifies the deployed bytecode as well, meaning that any compiler bugs that violate the specification will be detected. Moreover, lithe prove --code can evaluate contracts that are already deployed on-chain.

Benchmarks
We conducted a comparison of Lithe with solc and Solar, Paradigm's latest Solidity compiler, across 51 benchmark contracts. Lithe's optimizer introduces numerous innovative concepts while also borrowing from Solar.

In our analysis of all 51 contracts, Lithe outperformed in every category we assessed:
- Bytecode: approximately 40% smaller than the most efficient solc build, and 7% smaller than Solar's size build.
- Deployment: requires 34% less gas than solc for OpenZeppelin's ERC-20, and 41% less for the ERC-721.
- Transactions: consumes roughly 2.5% less gas than solc, and is comparable to Solar.
- Compile time: takes about 0.6 seconds for all 51 contracts, contrasted with 0.7 seconds for Solar and 3.2 seconds for solc at its optimal speed.
Built by Agents, for Agents
Lithe was created by agents utilizing Recur, an agent workflow tool I also developed. Recur assigns each task to a team of agents, who collaborate to plan, code, and review each other's contributions until completion. They produced around 140,000 lines of Rust and approximately 20,000 lines of Lithe, a language none of them had encountered previously.
The design is intended for agents as well. The compiler offers guidance: if an agent neglects to declare a deposit as payable, it prompts them to create an external payable function, allowing for corrections. The lithe analysis feature outputs what each function reads, writes, and raises in JSON format, enabling an agent to review a contract without delving into the code. Documentation is provided in plain text for models, and the accompanying code examples are verified against the compiler.
A critical takeaway was the necessity of implementing checks that agents cannot manipulate. One agent claimed that a compiler adjustment had no impact on the ABI output. However, many of the contracts it compared failed to compile, so it was essentially comparing error messages. The benchmarks eliminate any ambiguity: each transaction is replayed against the Solidity builds, and the return data and logs must either match or differ clearly.
Try Lithe
With Voyager, we're creating payment infrastructure for an internet where agents pay for data and services, all safeguarded by code. Lithe prompts the next question: can agents establish these safeguards themselves, with outputs that any human can verify?
While Lithe remains in the experimental stage, it is already operational on the Ethereum mainnet. I utilized it to transition Modularium's NFT contracts, replacing their Solidity counterparts. The most impressive outcome was the art generated on-chain: several contracts produce byte-identical outputs to their Solidity versions, with rendering consuming between 65% and 79% less gas. Additionally, these contracts are accompanied by 40 specification files, all formally verified using lithe prove.
We are actively engaged in developing AI tools to expedite the creation of more secure blockchain infrastructure and applications.
If you are working on an EVM project and seek contracts that are simpler to audit and verify, explore Lithe in the playground, review the documentation, or check out the repository.