Once you have invented digital money, you may need a ledger to track who owns what -- and an interface to that ledger so that users of your money can transact. On the Tezos blockchain this implies: a smart contract (distributed program), storing in its state a ledger to map owner addresses to token quantities, and standardised entrypoints to transact on accounts. A bank does a similar job -- it maps account numbers to account quantities and permits users to transact -- but in return the bank demands trust, it incurs expense to maintain a centralised server and staff, it uses a proprietary interface ... and it may speculate using your money and/or display rent-seeking behaviour. A blockchain ledger is by design decentralised, inexpensive, open, and it won't just bet your tokens on risky derivatives (unless you ask). The FA1.2 standard is an open standard for ledger-keeping smart contracts on the Tezos blockchain. Several FA1.2 implementations already exist. Or do they? Is the standard sensible and complete? Are the implementations correct? And what are they implementations \emph{of}? The FA1.2 standard is written in English, a specification language favoured by wet human brains but notorious for its incompleteness and ambiguity when rendered into dry and unforgiving code. In this paper we report on a formalisation of the FA1.2 standard as a Coq specification, and on a formal verification of three FA1.2-compliant smart contracts with respect to that specification. Errors were found and ambiguities were resolved; but also, there now exists a \emph{mathematically precise} and battle-tested specification of the FA1.2 ledger standard. We will describe FA1.2 itself, outline the structure of the Coq theories -- which in itself captures some non-trivial and novel design decisions of the development -- and review the detailed verification of the implementations.
翻译:一旦你发明了数字货币,你可能需要一个分类账来追踪谁拥有什么 -- -- 和该分类账的接口,以便你的货币用户能够交易。在Tezos 块链中,这意味着:智能合同(分配程序),在州内存储一个分类账,将所有者地址映射成象征性数量,以及标准化进入账户交易的切入点。一个银行做类似的工作 -- 它将账号映射成帐户数量,允许用户进行交易 -- -- 但是作为银行要求信任的回报,它需要花费一个成本来维持一个中央化的服务器和工作人员,它使用一个专有的界面.它可能利用你的货币进行投机和/或显示寻租行为。一个块链分类(分配程序)意味着:一个智能合同(分配程序),将所有者地址标定到象征性数量, FA1.2 标准是保存Tezos 块的智能合同。一些FA1.2 执行标准已经存在,或者它们是否存在?标准化和完成?它是否正确和完成? 执行?它们现在执行什么是执行? 它们正在执行什么执行?