arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1911.04732cs.LOcs.PL
收藏

Coq中的智能合约交互

Smart Contract Interactions in Coq

Jakob Botsch Nielsen, Bas Spitters

摘要:

我们在Coq中提出了一个智能合约执行的模型/可执行规范。我们的形式化允许合约间通信,并通过允许深度优先执行区块链(如以太坊)和广度优先执行区块链(如Tezos)的建模来推广现有工作。我们用Coq的函数语言Gallina表示智能合约程序,比其他方法更容易推理具体合约的功能正确性。特别是,我们以这种风格制定了一份国会合同。这个合约--臭名昭著的DAO的简化版本--很有趣,因为它与其他合约的通信模式非常动态。我们给出了国会行为的高级部分规范,与可重入性相关,并证明国会满足所有可能的智能合约执行命令。

英文摘要:

We present a model/executable specification of smart contract execution in Coq. Our formalization allows for inter-contract communication and generalizes existing work by allowing modelling of both depth-first execution blockchains (like Ethereum) and breadth-first execution blockchains (like Tezos). We represent smart contracts programs in Coq's functional language Gallina, enabling easier reasoning about functional correctness of concrete contracts than other approaches. In particular we develop a Congress contract in this style. This contract -- a simplified version of the infamous DAO -- is interesting because of its very dynamic communication pattern with other contracts. We give a high-level partial specification of the Congress's behavior, related to reentrancy, and prove that the Congress satisfies it for all possible smart contract execution orders.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑