KEVM: A Complete Formal Semantics of the Ethereum Virtual Machine

A developing field of interest for the distributed systems and applied cryptography communities is that of smart contracts: self-executing financial instruments that synchronize their state, often through a blockchain. One such smart contract system that has seen widespread practical adoption is Ethereum, which has grown to a market capacity of 100 billion USD and clears an excess of 500,000 daily transactions. Unfortunately, the rise of these technologies has been marred by a series of costly bugs and exploits. Increasingly, the Ethereum community has turned to formal methods and rigorous program analysis tools. This trend holds great promise due to the relative simplicity of smart contracts and bounded-time deterministic execution inherent to the Ethereum Virtual Machine (EVM). Here we present KEVM, an executable formal specification of the EVM's bytecode stack-based language built with the K Framework, designed to serve as a solid foundation for further formal analyses. We empirically evaluate the correctness and performance of KEVM using the official Ethereum test suite. To demonstrate the usability, several extensions of the semantics are presented. and two different-language implementations of the ERC20 Standard Token are verified against the ERC20 specification. These results are encouraging for the executable semantics approach to language prototyping and specification.

[1]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[2]  Satoshi Nakamoto Bitcoin : A Peer-to-Peer Electronic Cash System , 2009 .

[3]  Grigore Rosu,et al.  An overview of the K semantic framework , 2010, J. Log. Algebraic Methods Program..

[4]  Chucky Ellison,et al.  An executable formal semantics of C with applications , 2011, POPL '12.

[5]  Jean-Christophe Filliâtre,et al.  Why3 - Where Programs Meet Provers , 2013, ESOP.

[6]  Eli Ben-Sasson,et al.  Zerocash: Decentralized Anonymous Payments from Bitcoin , 2014, 2014 IEEE Symposium on Security and Privacy.

[7]  Tom Ridge,et al.  Lem: reusable engineering of real-world semantics , 2014, ICFP.

[8]  Shawn Wilkinson,et al.  Storj A Peer-to-Peer Cloud Storage Network , 2014 .

[9]  Daniel Davis Wood,et al.  ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER , 2014 .

[10]  Gareth W. Peters,et al.  Understanding Modern Banking Ledgers Through Blockchain Technologies: Future of Transaction Processing and Smart Contracts on the Internet of Money , 2015, ArXiv.

[11]  Grigore Rosu,et al.  K-Java , 2015, POPL.

[12]  Chucky Ellison,et al.  Defining the undefinedness of C , 2015, PLDI.

[13]  Guo Li,et al.  Evaluating the Potential of Alternative Cryptocurrencies , 2015 .

[14]  Daejun Park,et al.  KJS: a complete formal semantics of JavaScript , 2015, PLDI.

[15]  C. Peirce An unpublished manuscript) , 2016 .

[16]  Grigore Rosu,et al.  RV-Match: Practical Semantics-Based Program Analysis , 2016, CAV.

[17]  Nikhil Swamy,et al.  Formal Verification of Smart Contracts: Short Paper , 2016, PLAS@CCS.

[18]  Grigore Rosu,et al.  Runtime Verification at Work: A Tutorial , 2016, RV.

[19]  Prateek Saxena,et al.  Making Smart Contracts Smarter , 2016, IACR Cryptol. ePrint Arch..

[20]  Grigore Rosu,et al.  Semantics-based program verifiers for all languages , 2016, OOPSLA.

[21]  Bryan Ford,et al.  Enhancing Bitcoin Security and Performance with Strong Consistency via Collective Signing , 2016, USENIX Security Symposium.

[22]  Grigore Rosu,et al.  Matching μ-Logic , 2017, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[23]  Thomas Heinz Meitinger,et al.  Smart Contracts , 2017, Informatik-Spektrum.

[24]  Massimo Bartoletti,et al.  A Survey of Attacks on Ethereum Smart Contracts (SoK) , 2017, POST.

[25]  Yoichi Hirai,et al.  Defining the Ethereum Virtual Machine for Interactive Theorem Provers , 2017, Financial Cryptography Workshops.

[26]  W. Bolt Bitcoin and Cryptocurrency Technologies : A Comprehensive Introduction , 2017 .

[27]  Matteo Maffei,et al.  A Semantic Framework for the Security Analysis of Ethereum smart contracts , 2018, POST.