Sequent has completed a machine-checked proof for the Vyper smart contract compiler, marking a milestone in formal verification for decentralized finance software. This advancement could play a crucial role in enhancing the security of DeFi protocols, where previous compiler vulnerabilities have resulted in losses exceeding $70 million.
Formal verification with AI and theorem proving
The company utilized AI tools to create mathematical proofs for Vyper version 0.5.0b1, then verified these proofs using HOL4, a leading theorem-proving platform. Machine-checked proofs involve computers rigorously evaluating every logical step, ensuring that the software operates according to strict mathematical rules.
Unlike previous projects such as CompCert and CakeML, which were built with verification in mind, Sequent constructed and formally verified a mathematical model of Vyper’s existing compiler. Their work covers 2.92 million lines of HOL4 code spanning over 10,000 theories, resulting in 88,078 validated theorems with no unproven assumptions.
Among these, four key theorems guarantee safe contract deployment, runtime calls, gas adequacy, and transaction sequences. These assurances mean that certain safety properties observed in Vyper source code can also be expected in the Ethereum Virtual Machine (EVM) bytecode, provided specific conditions are met.
Mini dictionary: HOL4, a widely used interactive theorem prover, supports formal verification by rigorously checking logical proofs to ensure correctness in critical software such as compilers and cryptographic systems.
Sequent also verified that compiler optimizations, like Vyper’s Venom pipeline designed to improve efficiency, do not alter the intended behavior of smart contracts. In testing their model against 465 compiled cases, Sequent uncovered over a dozen compiler bugs before they could reach production.
DeFi losses highlight urgency for better verification
The significance of Sequent’s machine-checked proof is underscored by a major DeFi security incident traced back to a Vyper compiler flaw. In 2021, Sequent CEO and Vyper lead developer Charles Cooper inadvertently introduced a vulnerability. Although subsequently patched, the flaw left some already deployed contracts exposed.
On July 30, 2023, attackers exploited this vulnerability—a reentrancy-lock bug—enabling them to drain funds from smart contracts before completing previous executions. According to Sequent, the total loss from this incident exceeded $70 million, while other security researchers estimated the figure at $52 million after accounting for partial recoveries.
Beyond individual losses, the exploit caused Curve’s total value locked to drop by half to $1.24 billion, exposing broader lending markets to heightened liquidation risks.
Smart contracts taught us that anything that can be exploited will be.
Lowering the cost of formal verification
To make formal verification accessible industry-wide, affordability is key. On November 25, Sequent secured $2.2 million in pre-seed funding, co-led by Frachtis and Metaplanet, the latter founded by Jaan Tallinn, a notable tech investor and Skype co-founder. The funding will underpin Sequent’s AI-powered verification platform Alan, which offers subscription plans starting at $99 a month for individuals, $200 for auditors, and $500 for teams.
Curve, a leading DeFi protocol, has become Alan’s first commercial client, applying the platform to determine potential depositor losses under specified conditions in its pools. Curve CEO Michael Egorov commented:
Now, whenever we change a pool’s code, we can prove depositors’ money stays protected by the same limit.
Other initiatives, such as Anthropic’s use of its Claude AI for verifying security properties across open-source libraries and Theorem’s machine code verification research, signal growing industry investment in automated formal verification. The Ethereum DAO Security Fund has also designated $600,000 to support end-to-end Vyper compiler verification.
Limitations and the road ahead
Despite the breakthrough, Sequent’s proofs currently cover a mathematical model of the Vyper compiler, not its actual Python codebase. Key components, such as the parser and type checker, remain outside the verified scope.
A recent security advisory, CVE-2026-114116, showed that unverified parts can enable overlooked flaws. In this case, eight different line-separator characters could cause Vyper source code values or types to change silently. However, a scan of over 45,000 files revealed no active exploitation of this particular issue.
Full DeFi security will continue to require audit and verification at the contract level, not just the compiler. Sequent aims to extend its verification coverage to multi-module contracts and additional optimization pipelines, and is planning to add support for Solidity and other mainstream programming languages in the future.
You Might Also Like
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Sign in to your account




