针对已部署字节码与可执行EVM语义的验证,采用精确gas且无额外公理
Verifying deployed bytecode against executable EVM semantics, with exact gas and no added axioms
AI总结:
该研究提出Blanc验证栈,结合可执行EVM语义Jaune,直接验证以太坊已部署字节码,完成EIP-7002、Uniswap V2等合约的精确gas相关定理证明,AI辅助15天完成证明。
摘要:
以太坊大部分关键代码是不可变字节码:来自未经验证编译器的旧输出,以及作为合约代码运行的协议逻辑。我们证明这类字节码可直接验证,无需信任其生成过程,无需简化其运行的机器,且仅使用Lean自身的公理。Blanc是一个Lean 4验证栈,通过内核检查的证书读取固定运行时字节,并针对Jaune声明所有定理;Jaune是EVM及区块处理的可执行语义,通过了以太坊fixture版本v20.0.2中所有仅涉及2025年5月以来治理主网分叉的34205个区块链测试用例。8个从2017年到2026年部署的工件,来自7个编译器版本和1个汇编器。对于EIP-7002合约,我们证明其区块结束时的调用(若失败将使区块无效)无论存储内容如何都会成功,且每个区块的提款请求恰好是最旧的待提交请求;当Prague升级启动时,主网满足这些定理的起始前提。对于Uniswap V2交易对,我们证明在任何哈希槽保持分离的有效历史后,从代表其Solidity模型状态的任意检查点,存储表示该模型在恰好提交的调用上重放后的状态,平衡流动性账本保持平衡,且在代币应答的前提下,每股的几何平均储备仅因协议费用而下降。精确gas使活性可证:一个无代码的受跟踪WETH9持有者可通过一笔gas具有闭式形式的交易进行提款,该交易与30000个区块中其类型的所有3748个可比主网收据匹配。对于2023年被利用锁漏洞编译的Curve池字节,Jaune从部署时就执行此类重入;对于固定编译器生成的字节,我们证明该锁会排除重入。AI代理在一位作者指导下,基于现有栈用15天完成了这些证明。
英文摘要:
Much of Ethereum's most consequential code is immutable bytecode: old output of unverified compilers, and protocol logic run as contract code. We show that such bytecode can be verified as it is, without trusting what produced it, without simplifying the machine it runs on, and with no axioms beyond Lean's own. Blanc, a Lean 4 verification stack, reads fixed runtime bytes via kernel-checked certificates and states every theorem against Jaune, an executable semantics of the EVM and block processing that passes all 34,205 blockchain-test cases of Ethereum's fixture release v20.0.2 that involve only forks that have governed mainnet since May 2025. Eight artifacts, deployed from 2017 to 2026, come from seven compiler versions and an assembler. For the EIP-7002 contract, we prove that the end-of-block call to it, whose failure would invalidate the block, succeeds whatever its storage holds, and that each block's withdrawal requests are exactly the oldest pending submissions; mainnet met these theorems' starting premises when Prague began. For a Uniswap V2 pair, we prove that after any valid history whose hashed slots stay apart, from any checkpoint representing its Solidity model's state, the storage represents that model replayed over exactly the committed calls, a balanced liquidity ledger stays balanced, and, under a premise on token answers, geometric-mean reserves per share fall only through the protocol fee. Exact gas makes liveness provable: a tracked WETH9 holder without code can withdraw by a transaction whose gas has a closed form, matching all 3,748 comparable mainnet receipts of its shape in 30,000 blocks. On Curve pool bytes compiled with the lock bug exploited in 2023, Jaune executes such a reentrancy from deployment; for bytes from a fixed compiler, we prove the lock excludes it. AI agents wrote the proofs in fifteen days under one author's direction, atop an existing stack.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。