Resources: A Safe Language Abstraction for Money

Smart contracts are programs that implement potentially sophisticated transactions on modern blockchain platforms. In the rapidly evolving blockchain environment, smart contract programming languages must allow users to write expressive programs that manage and transfer assets, yet provide strong protection against sophisticated attacks. Addressing this need, we present flexible and reliable abstractions for programming with digital currency in the Move language [Blackshear et al. 2019]. Move uses novel linear [Girard 1987] resource types with semantics drawing on C++11 [Stroustrup 2013] and Rust [Matsakis and Klock 2014]: when a resource value is assigned to a new memory location, the location previously holding it must be invalidated. In addition, a resource type can only be created or destroyed by procedures inside its declaring module. We present an executable bytecode language with resources and prove that it enjoys resource safety, a conservation property for program values that is analogous to conservation of mass in the physical world.

[1]  Mark S. Miller,et al.  Capability Myths Demolished , 2003 .

[2]  Brad A. Myers,et al.  Obsidian: Typestate and Assets for Safer Blockchain Programming , 2019, ACM Trans. Program. Lang. Syst..

[3]  Derek Dreyer,et al.  Robust and compositional verification of object capability patterns , 2017, Proc. ACM Program. Lang..

[4]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[5]  Dave Clarke,et al.  Ownership Types: A Survey , 2013, Aliasing in Object-Oriented Programming.

[6]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[7]  Grigore Rosu,et al.  IELE: A Rigorously Designed Language and Tool Ecosystem for the Blockchain , 2019, FM.

[8]  Sophia Drossopoulou,et al.  Deny capabilities for safe, fast actors , 2015, AGERE!@SPLASH.

[9]  Michael J. Coblenz Obsidian: A Safer Blockchain Programming Language , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering Companion (ICSE-C).

[10]  Sophia Drossopoulou,et al.  Flint for Safer Smart Contracts , 2019, ArXiv.

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

[12]  Russell O'Connor,et al.  Simplicity: A New Language for Blockchains , 2017, PLAS@CCS.

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

[14]  Sam Blackshear,et al.  The Move Prover , 2020, CAV.

[15]  Ilya Sergey,et al.  Safer smart contract programming with Scilla , 2019, Proc. ACM Program. Lang..

[16]  Riccardo Pucella,et al.  Practical affine types , 2011, POPL '11.

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

[18]  Norman Hardy,et al.  The Confused Deputy: (or why capabilities might have been invented) , 1988, OPSR.

[19]  Leslie Lamport,et al.  Using Time Instead of Timeout for Fault-Tolerant Distributed Systems. , 1984, TOPL.

[20]  Timothy A. K. Zakian,et al.  The Libra Blockchain , 2019 .

[21]  John Gough,et al.  Technical Overview of the Common Language Runtime , 2001 .

[22]  Marko C. J. D. van Eekelen,et al.  Guaranteeing Safe Destructive Updates Through a Type System with Uniqueness Information for Graphs , 1993, Dagstuhl Seminar on Graph Transformations in Computer Science.

[23]  Nicholas D. Matsakis,et al.  The rust language , 2014, HILT '14.

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

[25]  Frank Pfenning,et al.  Resource-Aware Session Types for Digital Contracts , 2019, 2021 IEEE 34th Computer Security Foundations Symposium (CSF).

[26]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.