SCDBench: 基于大语言模型的智能合约反编译基准
SCDBench: A Benchmark for LLM-Based Smart Contract Decompilers
AI总结:
针对现有智能合约反编译评估缺乏统一基准的问题,提出SCDBench数据集与评估方法,通过四阶段累积评估(格式完整性、可编译性、ABI恢复、语义一致性)测试前沿LLM的反编译能力,发现语义一致性仍远未解决。
摘要:
智能合约反编译旨在从字节码恢复高级源代码,但评估反编译器仍然困难,因为现有研究使用狭窄的数据集、不一致的度量标准和有限的语义一致性检查。随着大语言模型(LLMs)开始生成类似源代码的Solidity代码,这些代码可能编译通过并看似合理,即使其语义与原始合约存在偏差,这一差距变得日益重要。我们引入了SCDBench,一个用于基于LLM的智能合约反编译的数据集和基准方法。该数据集包含600个真实世界的Solidity合约,配有配对的字节码输入、真实源代码和可重放的语义检查点。SCDBench通过四个累积阶段评估反编译器的输出:格式完整性、可编译性、应用程序二进制接口(ABI)恢复以及通过差分重放实现的语义一致性。我们在零样本反编译设置中评估了Claude Opus 4.7、GPT-5.3-Codex和GLM-5,包括具有和不具有扩展推理的GLM-5变体,以及零样本编译修复设置。结果表明,前沿LLM通常能够生成结构化和可编译的Solidity代码,但实现语义一致性仍远未解决:表现最好的前沿模型仅完美反编译了42/600个合约。我们进一步表明,引入同模型编译修复在适度增加成本的情况下显著提升了性能。SCDBench为严格、可重复的评估建立了共同基础,旨在加速开发用于区块链安全性和透明度的可靠智能合约反编译器。
英文摘要:
Smart contract decompilation aims to recover high-level source code from bytecode, but evaluating decompilers remains difficult because existing studies use narrow datasets, inconsistent metrics, and limited semantic consistency checks. This gap is increasingly important as large language models (LLMs) begin to generate source-like Solidity that may compile and appear plausible, even when its semantics diverge from the original contract. We introduce SCDBench, a dataset and benchmark methodology for LLM-based smart contract decompilation. The dataset contains 600 real-world Solidity contracts with paired bytecode inputs, ground-truth source code, and replayable semantic checkpoints. SCDBench evaluates decompiler outputs through four cumulative stages: format completeness, compilability, Application Binary Interface (ABI) recovery, and semantic consistency via differential replay. We evaluate Claude Opus 4.7, GPT-5.3-Codex, and GLM-5 in a zero-shot decompilation setting, including GLM-5 variants with and without extended reasoning and a zero-shot compilation-repair setting. The results show that frontier LLMs can often produce structured and compilable Solidity, but achieving semantic consistency remains far from solved: the best-performing frontier model perfectly decompiles only 42/600 contracts. We further show that introducing same-model compilation repair substantially improves performance at modest additional cost. SCDBench establishes a common ground for rigorous, reproducible evaluation and aims to accelerate the development of reliable smart contract decompilers for blockchain security and transparency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。