Skip to main content
QUICK REVIEW

[论文解读] Formal Verification of Solidity contracts in Event-B

Zhu Jian, Kai Hu|arXiv (Cornell University)|May 4, 2020
Blockchain Technology Applications and Security参考文献 9被引用 7
一句话总结

本文提出一种使用 Event-B 对 Solidity 智能合约进行形式化验证的方法,将 Solidity 的受限子集翻译为 Event-B 模型,以实现对安全与安全属性的严格验证。该方法支持分层细化和证明义务生成,通过 Rodin 平台处理这些证明义务,从而实现对以太坊智能合约中安全与安全属性的认证。

ABSTRACT

Smart contracts are the artifact of the blockchain that provide immutable and verifiable specifications of physical transactions. Solidity is a domain-specific programming language with the purpose of defining smart contracts. It aims at reducing the transaction costs occasioned by the execution of contracts on the distributed ledgers such as the Ethereum. However, Solidity contracts need to adhere safety and security requirements that require formal verification and certification. This paper proposes a method to meet such requirements by translating Solidity contracts to Event-B models, supporting certification. To that purpose, we define a restrained Solidity subset and a transfer function which translates Solidity contracts to Event-B models. Then we take advantage of Event-B method capabilities to refine models at different levels of abstraction to verify Solidity contracts' properties. And we can verify the generated proof obligations of the Event-B model with the help of the Rodin platform.

研究动机与目标

  • 为应对智能合约中因安全漏洞和高价值交易风险而产生的对 Solidity 智能合约形式化验证的迫切需求。
  • 定义一个受限的 Solidity 子集,使其适合进行形式化建模与验证。
  • 建立从 Solidity 合约到 Event-B 模型的系统性翻译机制,以支持形式化分析。
  • 利用 Event-B 的细化能力,在多个抽象层次上验证合约属性。
  • 通过 Rodin 平台自动处理证明义务,实现对智能合约属性的认证。

提出的方法

  • 定义一个受限的 Solidity 子集,排除继承和复杂控制流等复杂特性,以确保与形式化建模的兼容性。
  • 设计一个正式的翻译函数,将 Solidity 合约构造映射到相应的 Event-B 构造,同时保持语义等价性。
  • 构建 Event-B 模型以表示 Solidity 合约的状态与行为,包括变量、不变式和基于事件的转换。
  • 该方法在 Event-B 中采用分层细化,以在不断增加的抽象层次上建模合约,支持模块化验证。
  • 在模型构建过程中自动生成证明义务,并使用 Rodin 平台的定理证明器进行处理。
  • 通过确保所有验证条件均被形式化证明,该方法支持认证,从而保证正确性属性。

实验结果

研究问题

  • RQ1能否在保持语义正确性的前提下,将 Solidity 的受限子集正式翻译为 Event-B 模型?
  • RQ2如何利用 Event-B 的分层细化能力,逐步验证复杂智能合约的属性?
  • RQ3Rodin 平台在多大程度上能够自动化处理从 Solidity 到 Event-B 翻译所产生的证明义务?
  • RQ4该方法能否有效验证现实世界智能合约的安全与安全属性?
  • RQ5该翻译过程在稳健性与可扩展性方面是否足够强,以支持实际智能合约的验证?

主要发现

  • 所提出的从 Solidity 到 Event-B 的翻译方法成功地以形式语义建模了关键合约构造,如状态变量、函数和不变式。
  • 利用 Event-B 的细化机制,实现了合约属性的逐步验证,提高了证明的模块化与可维护性。
  • 从 Event-B 模型生成的证明义务已成功通过 Rodin 平台处理,证实了所验证属性的正确性。
  • 该方法支持通过形式化证明对安全与安全属性(如无重入攻击和状态一致性)进行认证。
  • 该方法在代表性智能合约示例上展示了可行性,表明即使对于复杂合约逻辑,形式化验证也是可实现的。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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