arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1804.06398cs.CR
收藏

在Agda中建模比特币

Modelling Bitcoin in Agda

Anton Setzer

摘要:

我们在交互式定理证明程序Agda中提出了两种比特币区块链模型。第一种是基于一个简单的银行账户模型,同时有多个输入和输出的交易。第二个模型对交易进行建模,直接引用未使用的交易输出,而不是用户帐户。由此产生的区块链产生了一棵交易树。该模型是正式使用归纳递归的扩展形式,Agda的独特功能之一。事务树和事务的集合被归纳地定义,同时递归地定义未使用的事务输出的列表。这两种结构都对标准交易、Coinbase交易、交易费用、在交易中花钱的人要签署的确切消息、区块奖励、区块和区块链进行建模,第二种结构对Coinbase交易和Merkle树的成熟时间进行建模。通过假设相应的运算,抽象地讨论了散列运算和密码运算及其正确性。一个迹象表明,这个模型的正确性可以指定和证明在Agda。

英文摘要:

We present two models of the block chain of Bitcoin in the interactive theorem prover Agda. The first one is based on a simple model of bank accounts, while having transactions with multiple inputs and outputs. The second model models transactions, which refer directly to unspent transaction outputs, rather than user accounts. The resulting blockchain gives rise to a transaction tree. That model is formalised using an extended form of induction-recursion, one of the unique features of Agda. The set of transaction trees and transactions is defined inductively, while simultaneously recursively defining the list of unspent transaction outputs. Both structures model standard transactions, coinbase transactions, transaction fees, the exact message to be signed by those spending money in a transaction, block rewards, blocks, and the blockchain, and the second structure models as well maturation time for coinbase transactions and Merkle trees. Hashing and cryptographic operations and their correctness are dealt with abstractly by postulating corresponding operations. An indication is given how the correctness of this model could be specified and proven in Agda.

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

↑