Compiler correctness is an old problem, but with the emergence of smart contracts on blockchains that problem presents itself in a new light. Smart contracts are self-contained pieces of software that control assets, which are often of high financial value, in an adversarial environment and, once committed to the blockchain, they cannot be changed anymore. Smart contracts are typically developed in a high-level contract language and compiled to low-level virtual machine code before being committed to the blockchain. For a smart contract user to trust a given piece of low-level code on the blockchain, they must convince themselves that (a) they are in possession of the matching source code and (b) that the compiler faithfully translated the source code's semantics. Classic approaches to compiler correctness tackle the second point. We argue that translation certification also addresses the first. We describe the proof architecture of a novel translation certification framework, implemented in Coq, for a functional smart contract language. We demonstrate that we can model the compilation pipeline as a sequence of translation relations that facilitate a modular proof approach and are robust in the face of an evolving compiler implementation.
翻译:汇编者正确性是一个老问题,但随着在链条上出现问题的新光线中出现的智能合同的出现,智能合同是控制资产的自成一体的软件,这些资产往往在对抗性环境下具有高财务价值,一旦投入到链条中,这些资产就不能再改变。智能合同通常是用高层次合同语言开发的,在投入到链条之前编成低层次的虚拟机器代码。智能合同用户要信任在链条上的某个低层次代码,就必须说服自己:(a) 它们拥有匹配源码,(b) 编译者忠实翻译源码的语义。典型的编译者校正方法解决了第二点问题。我们说,翻译认证也针对第一点。我们描述了在科克实施的新型翻译认证框架的证明结构,用于功能智能合同语言。我们证明,我们可以将编译管道建模成一种翻译关系序列,以便利模块化的验证方法,在编译者实施过程中保持稳健。