一种高级智能合约转化方法及竞买合约设计与实现  被引量:11

An Advanced Smart Contract Conversion and Its Design and Implementation for Auction Contract

在线阅读下载全文

作  者:朱岩[1] 秦博涵 陈娥 刘国伟 ZHU Yan;QIN Bo-Han;CHEN E;LIU Guo-Wei(Department of Computer and Communication Engineering,University of Science and Technology Beijing,Beijing 100083;Beijing Municipal Bureau of Economy and Information Technology,Beijing 100744)

机构地区:[1]北京科技大学计算机与通信工程学院,北京100083 [2]北京市经济和信息化局,北京100744

出  处:《计算机学报》2021年第3期652-668,共17页Chinese Journal of Computers

基  金:国家科技部重点研发计划(2018YFB1402702);国家自然科学基金(61972032)。

摘  要:智能合约是运行在区块链上的数字协议,智能合约的开发涉及计算机、金融、法律等多个领域,近年来高级智能合约语言已被提出用于解决不同领域人员阅读、交流与协同开发难的问题,然而上述语言与可执行智能合约语言之间仍缺少有效的转化方法.针对这一问题,本文设计了一种SPESC到目标程序语言(Solidity)的转化规则,并提出了一种包括高级智能合约层、智能合约层和机器代码执行层的三层智能合约系统框架.首先,转化规则给出了根据SPESC合约当事人定义生成目标语言当事人子合约、以及SPESC其余部分生成目标语言主体子合约之间的对应关系;其次,除程序框架与存储结构外,目标语言程序还包含当事人人员管理、程序时序控制、异常检测等机制,这些机制能辅助编程人员半自动化地编写智能合约程序;进而,通过两个实验验证了上述高级智能合约框架的易读性以及转换的正确性,第一个实验邀请了计算机与非计算机人员分组阅读Solidity和SPESC的智能合约并回答问卷,结果表明阅读SPESC的速度约为阅读Solidity两倍,准确率也更高.然后以竞买合约为实例,给出了根据上述转化规则从SPESC合约转化到可执行Solidity合约语言程序,并通过以太坊私链部署运行来验证转化过程的正确性.实例表明上述转化规则和系统框架可简化智能合约的编写、规范智能合约的程序结构、辅助编程人员验证代码的正确性.As second-generation blockchain technology,smart contracts have greatly enriched the functional expression of blockchain to make application development more convenient.Smart contracts are a set of digitally executable protocols which concern business,finance,contract law,and information technology.In recent years,advanced smart contract languages(ASCLs)have been proposed to solve the problem of difficult reading,comprehension,and collaboration when writing a smart contract among people in different fields.However,this kind of languages are still hard to put into practice due to the lack of an effective conversion method from the ASCLs to executable smart contract programs.Aiming at this problem,we propose a three-layer smart contract framework,including advanced smart-contract layer,basic smart-contract layer,and executable machine-code layer.After comparing and analyzing the pros and cons of several ASCLs,we take SPESC as an example to explore how to design conversion rules from its contract to target language contract in Solidity.We specify the conversion rules from two aspects.One is program architecture of the target language,which consists of main-contract and party-contracts.The corresponding rules provide an approach to convert the definition of SPESC-based contracting parties into party sub-contracts on target language,as well as to produce the rest of SPESC contract into main sub-contract on target language.The other is the approach to specify not only program architecture and storage structure on basic smart-contract layer,but also important mechanisms,including personnel management,timing control,anomaly detection,etc.These mechanisms can assist programmers to semi-automatically write smart contract programs.Moreover,by introducing the notation of group,the SPESC-based smart contract can support the operation of dynamically adding participants into the contract.We also verify the legibility of SPESC and the correctness of the conversion processes through two case studies.First,we invite some students

关 键 词:智能合约 面向领域语言 代码生成 SPESC 

分 类 号:TP319[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象