Page 275 - 《软件学报》2021年第6期
P. 275

软件学报 ISSN 1000-9825, CODEN RUXUEW                                        E-mail: jos@iscas.ac.cn
         Journal of Software,2021,32(6):1849−1866 [doi: 10.13328/j.cnki.jos.006253]   http://www.jos.org.cn
         ©中国科学院软件研究所版权所有.                                                          Tel: +86-10-62562563


                                                     ∗
         面向 MSVL 的智能合约形式化验证

               1
                       1
                              2
         王小兵 ,   杨潇钰 ,   舒新峰 ,   赵   亮  1
         1
          (西安电子科技大学  计算机科学与技术学院,陕西  西安  710071)
         2 (西安邮电大学  计算机学院,陕西  西安  710121)
         通讯作者:  赵亮, E-mail: lzhao@xidian.edu.cn

         摘   要:  智能合约是运行在区块链上的计算机协议,被广泛应用在各个领域中,但是其安全问题层出不穷,因此在
         智能合约部署到区块链上之前,需要对其进行安全审计.然而,传统的测试方法无法保证智能合约所需的高可靠性和
         正确性.说明了如何使用建模、仿真与验证语言(MSVL)和命题投影时序逻辑(PPTL)对智能合约进行建模和验证:
         首先介绍了 MSVL 与 PPTL 的理论基础;之后,通过分析和对比 Solidity 与 MSVL 语言的特性,开发了能够将 Solidity
         程序转换为 MSVL 程序的 SOL2M 转换器,并详细介绍了 SOL2M 转换器的设计思路;最终,通过投票智能合约和银
         行转账智能合约两个实例,给出了 SOL2M 转换器的执行结果.使用 PPTL 从功能一致性、逻辑正确性以及合约完备
         性这 3 个方面描述了合约的性质,给出了使用统一模型检测器(UMC4M)对合约进行验证的过程.
         关键词:  区块链;智能合约;形式化方法;MSVL
         中图法分类号: TP311

         中文引用格式:  王小兵,杨潇钰,舒新峰,赵亮.面向 MSVL 的智能合约形式化验证.软件学报,2021,32(6):1849−1866.  http://
         www.jos.org.cn/1000-9825/6253.htm
         英文引用格式: Wang XB, Yang XY, Shu XF, Zhao L. Formal verification of smart contract based on MSVL. Ruan Jian Xue
         Bao/Journal of Software, 2021,32(6):1849−1866 (in Chinese). http://www.jos.org.cn/1000-9825/6253.htm

         Formal Verification of Smart Contract Based on MSVL
                       1
                                                    2
                                      1
         WANG Xiao-Bing ,   YANG Xiao-Yu ,   SHU Xin-Feng ,   ZHAO Liang 1
         1 (School of Computer Science and Technology, Xidian University, Xi’an 710071, China)
         2 (School of Computer Science and Technology, Xi’an University of Posts and Telecommunications, Xi’an 710121, China)
         Abstract:    Smart contract is a computer protocol running on the blockchain, which is widely used in various fields. However, its security
         problems continue to emerge. Therefore, it is necessary to audit the security of a smart contract before it is deployed on the blockchain.
         Traditional testing methods cannot guarantee the high reliability and correctness required by smart contracts. This study shows how to use
         modeling, simulation, and verification language (MSVL) and propositional projection temporal logic (PPTL) to model and verify smart
         contracts. First, the theoretical basis of MSVL and PPTL is introduced. Then, by analyzing and comparing the characteristics of solidity
         and  MSVL, an  SOL2M converter which can convert a  solidity  program to an MSVL  program is  developed and  its  design idea  is
         introduced in detail. Finally, the execution results of SOL2M converter are given by two examples of a vote smart contract and a bank
         transfer smart contract. The properties of contracts are described by PPTL on three aspects: function consistency, logic correctness, and
         contract completeness. And the process of using UMC4M (Unified Model Checker for MSVL) to verify the contract is also given.
         Key words:    blockchain; smart contract; formal methods; MSVL



            ∗  基金项目:  国家自然科学基金(61672403, 61972301);  陕西省重点研发计划(2020GY-043, 2020GY-210)
              Foundation item: National Natural Science Foundation of China (61672403, 61972301); Key Research and Development Projects of
         Shaanxi Province (2020GY-043, 2020GY-210)
              本文由“形式化方法与应用”专题特约编辑姜宇副教授推荐.
              收稿时间: 2020-08-30;  修改时间: 2020-10-26;  采用时间: 2020-12-19; jos 在线出版时间: 2021-02-07
   270   271   272   273   274   275   276   277   278   279   280