Towards Interpreting Smart Contract against Contract Fraud: A Practical and Automatic Realization

Contract fraud is a big nuisance in our society. People are scammed largely because of vague language used in contracts, which can cause misunderstandings. Therefore, people will seek professional help to review over ambiguous terms, especially, when signing a big contract, for example, leasing or buying property. With the advent of Ethereum blockchain, a new type of contract, named smart contract, is emerging nowadays, enabling people to describe a complicated logic as an automatically executable computer program. However, due to the lack of the computer background and software development experience, many people have difficulty in understanding blockchain-based smart contracts, which is adverse to the popularization of Ethereum. It has resulted in a new wave of contract fraud caused by smart contracts, which are self-executing and self-enforcing but also hard to understand by people. To fill this huge gap, we propose an approach to enable people without computer background to understand and operate Ethereum smart contracts. In doing so, smart contract fraud can be deterred if people have a better understanding of contract terms. Particularly, we investigate the general rules of the smart contract code, and build a novel tool named SMTranslator to automatically generate readable document. SMTranslator first translates smart contracts into standard structured files and identifies the core statement of each function in smart contracts. By exploiting the custom natural language generation, we generate the documents for smart contracts that can provide correct and understandable descriptions. We collect numerous contracts in Ethereum and select a number of typical contracts to conduct the experiments. Extensive experimental results demonstrate the feasibility and effectiveness of our approach.

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

[2]  Hinrich Schütze,et al.  Book Reviews: Foundations of Statistical Natural Language Processing , 1999, CL.

[3]  Ehud Reiter,et al.  Book Reviews: Building Natural Language Generation Systems , 2000, CL.

[4]  Elmar Jürgens,et al.  Quality analysis of source code comments , 2013, 2013 21st International Conference on Program Comprehension (ICPC).

[5]  Yaojin Yang,et al.  Generation of architectural documentation using XML , 2002, Ninth Working Conference on Reverse Engineering, 2002. Proceedings..

[6]  Arvind Narayanan,et al.  An Empirical Study of Namecoin and Lessons for Decentralized Namespace Design , 2015, WEIS.

[7]  Andrew Lippman,et al.  MedRec: Using Blockchain for Medical Data Access and Permission Management , 2016, 2016 2nd International Conference on Open and Big Data (OBD).

[8]  Emily Hill,et al.  Towards automatically generating descriptive names for unit tests , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).

[9]  Mihai Surdeanu,et al.  The Stanford CoreNLP Natural Language Processing Toolkit , 2014, ACL.

[10]  Collin McMillan,et al.  Automatic Source Code Summarization of Context for Java Methods , 2016, IEEE Transactions on Software Engineering.

[11]  Xiaodong Lin,et al.  Blockchain-Based Secure Data Provenance for Cloud Storage , 2018, ICICS.

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

[13]  Shinji Kusumoto,et al.  Component rank: relative significance rank for software component search , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

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

[15]  Emily Hill,et al.  Automatically capturing source code context of NL-queries for software maintenance and reuse , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[16]  Sergei Tikhomirov,et al.  SmartCheck: Static Analysis of Ethereum Smart Contracts , 2018, 2018 IEEE/ACM 1st International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB).

[17]  Jason Weston,et al.  Natural Language Processing (Almost) from Scratch , 2011, J. Mach. Learn. Res..

[18]  Nick Szabo,et al.  Formalizing and Securing Relationships on Public Networks , 1997, First Monday.

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

[20]  Emily Hill,et al.  Towards automatically generating summary comments for Java methods , 2010, ASE.

[21]  Robert H. Deng,et al.  CrowdBC: A Blockchain-Based Decentralized Framework for Crowdsourcing , 2019, IEEE Transactions on Parallel and Distributed Systems.

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

[23]  Muneeb Ali,et al.  Blockstack: A Global Naming and Storage System Secured by Blockchains , 2016, USENIX Annual Technical Conference.

[24]  Henrik Theiling,et al.  Extracting safe and precise control flow from binaries , 2000, Proceedings Seventh International Conference on Real-Time Computing Systems and Applications.