Skip to main content
QUICK REVIEW

[论文解读] Hunting the Ethereum Smart Contract: Color-inspired Inspection of Potential Attacks

TonTon Hsien-De Huang|arXiv (Cornell University)|Jul 5, 2018
Blockchain Technology Applications and Security参考文献 3被引用 55
一句话总结

本文将 Solidity 字节码转换为 RGB 彩色图像,并使用 CNN(结合用于多标签的迁移学习)自动检测以太坊智能合约中的编译器漏洞,从而降低专家劳动成本。

ABSTRACT

Blockchain and Cryptocurrencies are gaining unprecedented popularity and understanding. Meanwhile, Ethereum is gaining a significant popularity in the blockchain community, mainly due to the fact that it is designed in a way that enables developers to write smart contract and decentralized applications (Dapps). This new paradigm of applications opens the door to many possibilities and opportunities. However, the security of Ethereum smart contracts has not received much attention; several Ethereum smart contracts malfunctioning have recently been reported. Unlike many previous works that have applied static and dynamic analyses to find bugs in smart contracts, we do not attempt to define and extract any features; instead we focus on reducing the expert's labor costs. We first present a new in-depth analysis of potential attacks methodology and then translate the bytecode of solidity into RGB color code. After that, we transform them to a fixed-sized encoded image. Finally, the encoded image is fed to convolutional neural network (CNN) for automatic feature extraction and learning, detecting compiler bugs of Ethereum smart contract.

研究动机与目标

  • 激励对以太坊智能合约在部署后不可变性背景下的自动化安全审查。
  • 引入对 Solidity 字节码进行颜色编码的图像表示,以实现基于图像的学习。
  • 开发并评估基于 CNN 的模型(包括迁移学习)用于检测合约编译漏洞。
  • 通过从字节码图像实现端到端学习,减少手动特征提取。
  • 提供公共 RESTful API 和可视化工具用于自动化合约分析。

提出的方法

  • 通过将字节值映射到颜色通道,将 Solidity 字节码转换为 RGB 彩色图像。
  • 将字节码图像转换为固定大小的输入,以便 CNN 学习特征,而无需对源代码进行特征工程。
  • 评估 CNN 架构(AlexNet、GoogleNet、Inception-v3)用于单标签漏洞检测。
  • 应用迁移学习,以实现对基于多漏洞特征的 Solidity 漏洞的多标签分类。
  • 在 Etherscan 的经过验证的合约上进行训练,并在更新样本上进行测试,以评估准确性和精确性。
  • 提供 RESTful API 和用户界面,以对字节码图像进行在线分析。

实验结果

研究问题

  • RQ1将颜色编码的字节码图像输入到 CNN,是否能够在无需手动特征提取的情况下有效检测以太坊智能合约的编译器漏洞?
  • RQ2与单标签、基于图像的方法相比,迁移学习用于多标签分类是否提高了对多种 Solidity 漏洞的检测?
  • RQ3在以太坊合约字节码图像上,CNN 架构能够达到的准确性、精确率和召回率是多少?
  • RQ4使用轻量级在线工具和公开 API,对智能合约进行端到端的自动化安全分析有哪些可行性?

主要发现

  • AlexNet 在 250 个 epoch 后达到 86% 的准确率(学习率 0.01)。
  • GoogleNet 在 250 个 epoch 后达到 90% 的准确率(学习率 0.01)。
  • Inception-v3 在 100 个 epoch 后达到 97.10% 的准确率(学习率 0.001)。
  • Inception-v3 在 500 个 epoch 后达到 97.39% 的准确率(学习率 0.001)。
  • 用于多标签分类的迁移学习进一步提升了对多种 Solidity 漏洞的实际检测效果。
  • 系统在 2018 年 5–6 月的测试数据中显示出高准确性和召回率(如某些配置下召回率高达 99.04%)。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。