paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DeepInfer: Deep Type Inference from Smart Contract Bytecode

DeepInfer:从智能合约字节码中深度推断类型
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 3/10 · 该论文属于「机器学习与程序语言」交叉,用深度学习做字节码类型推断,与静态分析沾边;但其任务(智能合约函数签名/返回类型恢复)和领域(区块链字节码)与画像核心的 Agentic/LLM 程序分析、浮点程序分析、贝叶斯程序分析均无直接交集,方法也是传统深度学习而非当前 LLM/Agent。引用 25 inbox
Kunsong Zhao, Zihao Li, Jianfeng Li, He Ye, Xiapu Luo, Ting Chen
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 DeepInfer,用深度学习从智能合约字节码中自动推断函数签名与返回类型。

智能合约字节码缺乏类型信息,而函数签名对合约识别、模糊测试、漏洞检测等下游任务至关重要,因此从字节码恢复签名十分困难。现有方法严重依赖有限的签名数据库或硬编码启发式模式,难以适应不同合约语言与编译器版本带来的语义差异。本文提出 DeepInfer 框架:首先将字节码提升为中间表示(IR)以保留代码语义,然后从 IR 中抽取与类型相关的知识(关键数据流、常量值和控制流图),利用深度学习技术自动推断函数签名与返回类型。作者在 Solidity 与 Vyper 合约上进行实验,结果表明 DeepInfer 比现有工具更快、更准确,并且对语言变化与多种编译器版本具有免疫性。

问题
智能合约字节码缺失类型信息,使函数签名与返回类型难以推断,而签名是合约识别、模糊测试、漏洞检测等下游任务的关键输入。现有方法依赖有限的签名数据库或硬编码启发式模式,难以适应不同语言与编译器版本带来的语义差异。
方法
DeepInfer 先将字节码提升为中间表示(IR)以保留代码语义,再从 IR 中提取类型相关知识(关键数据流、常量值与控制流图),并用深度学习模型据此恢复函数签名与返回类型。
评估
在 Solidity 与 Vyper 智能合约上开展实验并与现有工具对比,结果显示 DeepInfer 推断更快、更准确,且不受合约语言与编译器版本变化的影响。
原文摘要(Abstract)

Smart contracts play an increasingly important role in Ethereum platform. It provides various functions implementing numerous services, whose bytecode runs on Ethereum Virtual Machine. To use services by invoking corresponding functions, the callers need to know the function signatures. Moreover, such signatures provide crucial information for many downstream applications, e.g., identifying smart contracts, fuzzing, detecting vulnerabilities, etc. However, it is challenging to infer function signatures from the bytecode due to a lack of type information. Existing work solving this problem depended heavily on limited databases or hard-coded heuristic patterns. However, these approaches are hard to be adapted to semantic differences in distinct languages and various compiler versions when developing smart contracts. In this paper, we propose a novel framework DeepInfer that first leverages deep learning techniques to automatically infer function signatures and returns. The novelties of DeepInfer are: 1) DeepInfer lifts the bytecode into the Intermediate Representation (IR) to preserve code semantics; 2) DeepInfer extracts the type-related knowledge (e.g., critical data flows, constant values, and control flow graphs) from the IR to recover function signatures and returns. We conduct experiments on Solidity and Vyper smart contracts and the results show that DeepInfer performs faster and more accurate than existing tools, while being immune to changes in different languages and various compiler versions.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{ZhaoLLYLC23,
  title = {DeepInfer: Deep Type Inference from Smart Contract Bytecode},
  author = {Kunsong Zhao and Zihao Li and Jianfeng Li and He Ye and Xiapu Luo and Ting Chen},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616343}
}