系统仿真学报 ›› 2022, Vol. 34 ›› Issue (7): 1629-1638.doi: 10.16182/j.issn1004731x.joss.21-0208

• 仿真模型/系统置信度评估技术 • 上一篇    下一篇

基于CPN的智能合约交易顺序依赖漏洞的验证

郑红(), 刘泽润, 黄建华, 钱诗慧   

  1. 华东理工大学 信息科学与工程学院,上海 200237
  • 收稿日期:2021-03-15 修回日期:2021-04-26 出版日期:2022-07-30 发布日期:2022-07-20
  • 作者简介:郑红(1973-),女,博士,副教授,研究方向为形式化建模、服务计算。E-mail:zhenghong@ecust.edu.cn
  • 基金资助:
    国家自然科学基金(61472139);产学研项目:区块链关键技术研究(H300-41819)

Verification of Transaction Ordering Dependence Vulnerability of Smart Contract Based on CPN

Hong Zheng(), Zerun Liu, Jianhua Huang, Shihui Qian   

  1. School of Information Science and Engineering, East China University of Science and Technology, Shanghai 200237, China
  • Received:2021-03-15 Revised:2021-04-26 Online:2022-07-30 Published:2022-07-20

摘要:

智能合约的形式化验证工作主要集中在编程语言层面的漏洞研究,而交易顺序依赖作为区块链层面的漏洞更不易被检测。基于着色Petri网对智能合约中潜在的交易顺序依赖漏洞进行形式化验证。以Decode悬赏合约为对象,分析合约中潜在的漏洞,自顶向下地对合约本身及其执行环境建立着色Petri网模型,并引入攻击者模型来考虑合约遭受攻击的情况。通过运行模型以验证合约存在交易顺序依赖漏洞,最后基于Remix平台在以太坊网络中证实结论的正确性。

关键词: 区块链, 智能合约, 着色Petri网, 形式化验证, 交易顺序依赖漏洞

Abstract:

The formal verification of smart contracts researches mainly focus on programming language-level vulnerabilities, and the transaction ordering dependence is more difficult to be detected as a blockchain-level vulnerability.The latent transaction ordering dependence vulnerability in smart contracts is formally verified based on colored Petri nets.The latent vulnerability in the Decode reward contractis analyzed, anda colored Petri net model of the contract itself and its execution environment is established from top to bottom.The attacker model is introduced to consider the situation that the contract is attacked. By running the model to verify the existence of transaction ordering dependence vulnerability in the contract,thecorrectness of the conclusion is finally verified in the Ethereum network based on Remix platform.

Key words: blockchain, smart contract, colored Petri nets, formal verification, transaction ordering dependence vulnerability

中图分类号: