What are smart contracts? What are the benefits of smart contracts? What are their weaknesses?
For Journal #2 you will record your thoughts and analysis on the weekly reading material found within the questions provided below based on Unit 4 required course materials (Blockchain and the Law De Filippi, et al and assigned articles and resources). PFA PDF’s Try to the answer fom the attached resources
You will provide a 2-3 section journal entry (minimum of 350-400 words) addressing the questions/topics below. This journal entry should be single spaced and Times New Roman 12-point font. The first line of each paragraph should be indented. APA citing and reference section are not required but sources utilized must be mentioned and any internet link to these sources should be provided in paratheses after first mention of the source.
1) Draft a first section adressing the following as provided within the Blockchain and the Law book and other reading provided:
a) What are smart contracts? What are the benefits of smart contracts? What are their weaknesses?
b) How are smart contracts similar to legal contracts? How are they different?
2) Draft a second section explaining the following as provided within the Blockchain and the Law book and other reading provided (Do not quote any of the source material, you must explain in your own words but properly mention the material utilized):
a) What are smart securities and smart derivatives? How will they enhance and/or disrupt the current financial system?
APA format
In text citations for all the paragraphs
No plagiarism
references
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 51 CONTRACTING IN THE AGE OF SMART CONTRACTS Farshad Ghodoosi* Abstract: Smart contracts lie at the heart of blockchain technology. There are two principal problems, however, with existing smart contracts: first, the enforceability of smart contracts remains ambiguous. Second, smart contracts are limited in scope and capability barring more complex contracts from being executed via blockchain technology. Drawing from the existing literature on contracts and smart contracting, this Article suggests new approaches to address these two problems. First, it proposes a framework based on reliance-based contracting to analyze smart contracts. Second, the Article analyzes the seismic shifts in contractual disputes, and offers new insights into its features including decentralized decision-making, network-based dispute resolution, and extrajudicial enforcement of decisions. The Article concludes that users’ reliance should be the basis for analysis of smart contracts and its associated dispute resolution mechanism. INTRODUCTION ………………………………………………………………………. 52 I. WHAT MAKES SMART CONTRACTS SMART? ……………… 57 A. Explaining Smart Contracts ………………………………………….. 58 B. Validation and Verification ………………………………………….. 61 II. LIMITS OF EXISTING LEGAL THEORIES OF SMART CONTRACTS ………………………………………………………………….. 64 A. No Contract ……………………………………………………………….. 67 B. Unilateral Contracts …………………………………………………….. 69 C. Agreement to Agree ……………………………………………………. 70 * Assistant Professor of Business Law at California State University, Northridge, The David Nazarian College of Business & Economics. JSD, LL.M, Yale Law School; LL.M in Business Law, U.C. Berkeley. I would like to thank Professors William Eskridge, Susan Rose-Ackerman, Ian Ayres, and Daniel Markovits at Yale Law School, Professor David Zaring at the Wharton School of the University of Pennsylvania, Professor Chris Brummer at Georgetown Law, Professor Larry DiMatteo at University of Florida College of Law, Professor Matthew A. Bruckner at Howard University School of Law, Professor Shauhin Talesh at University of California, Irvine School of Law, Professor William Moon at University of Maryland School of Law, Professor Shubha Ghosh at Syracuse Law, Dr. Ali Kadivar, Professor of Sociology at Boston College, Dr. Philipp Hacker at Humboldt-University of Berlin, Professor Alyssa King at Queen’s University Faculty of Law, and Mr. Trevor Kiviat at Davis Polk LLP for reviewing this article and graciously providing their helpful comments. I would also like to express my gratitude to participants of the 2019 American Business Law Journal Invited Scholars Colloquium, in particular, Professor Larry DiMatteo from University of Florida and participants of the 2020 AALS Robotics & AI Panel, in particular, Associate Dean Jeff Ward and Mr. Miguel Bordo from Duke Law School. This project received a research grant from the leading fintech company Ripple’s University Blockchain Research Initiative and the Center for Blockchain and Financial Technology at Morgan State University. In particular, I am grateful for the help and guidance of Dr. Ali Emdad, Dr. Sanjay Bapna from the Department of Information Science and Systems at Morgan State University and Mr. Ken Weber from Ripple. This project was also presented at Ripple’s UBRI 2019 at U.C. Berkeley’s Haas School of Business.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 52 WASHINGTON LAW REVIEW [Vol. 96:51 III. RELIANCE AS THE BASIS FOR SMART CONTRACTS …… 73 A. Reliance Theory Best Explains Smart Contracts ……………… 73 B. Reliance Theory Can Help to Protect Users’ Reliance……… 75 IV. TWO PROBLEMS OF SMART CONTRACTS……………………. 79 A. Smart Contracts Are Incomplete …………………………………… 79 B. Smart Contracts Do Not Allow Entry Points ………………….. 82 V. TOWARDS TRULY DECENTRALIZED USER-BASED DISPUTE RESOLUTION ………………………………………………….. 84 A. Dispute Resolution Should Be Truly Decentralized…………. 87 B. Network-Based Dispute Resolution Can Solve Some Arbitration Problems for Small Claims ………………………….. 88 C. Smart Dispute Resolution Awards Are Enforceable ………… 90 CONCLUSION ………………………………………………………………………….. 92 INTRODUCTION Contracts are the bedrock of societies and play a vital role in bringing us together. As the founder of sociology, Durkheim, stated roughly a century ago, contracts serve as a central source of organic solidarity. For him, “in a contract not everything is contractual.”1 Similarly, Hanna Arendt emphasized that promise making and promise keeping arise “directly out of the will to live together with others.”2 Contracting lies at the heart of modern societies and human interaction lies at the heart of contracting.3 Digital contracting, on the other hand, promises the opposite: less involvement of human agents and increased automation of obligation performance. What makes a contract “smart” is that it is self-executing and self-enforcing which expunges the need for human intervention.4 New technologies offer the vision that algorithms, codes, and artificial intelligence determine parties’ obligations while parties often remain 1.ÉMILE DURKHEIM, THE DIVISION OF LABOR IN SOCIETY 158 (W.D. Halls trans., The Free Press 1984) (1893). 2.HANNAH ARENDT, THE HUMAN CONDITION 245–46 (2d ed. 1998) (stating that morality, at least politically, does not need support itself other “than the good will to counter the enormous risks of action by readiness to forgive and to be forgiven, to make promises and to keep them”). 3.HENRY SUMNER MAINE, ANCIENT LAW: ITS CONNECTION WITH THE EARLY HISTORY OF SOCIETY AND ITS RELATION TO MODERN IDEAS 165 (Frederick Pollock ed., Henry Holt & Co. 1906) (1861) (“[T]he movement of the progressive societies has hitherto been a movement from Status to Contract.” (emphasis added)). 4.I prefer the term “digital contract” over “smart contract.” Smart contracts can only refer to self-executing codes that run on a particular platform or software (e.g., Ethereum smart contracts) similar to apps in smart phones. Digital contracts, however, refer to a broader phenomenon which is automation of obligations and self-execution of contracts through computers and machine thinking. Since the term smart contract has been widely adopted, I keep this term in this Article.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 53 uninvolved and anonymous.5 The automation has a seismic impact on contracting which traditionally relied on ex ante bargaining and negotiation at arm’s length along with ex post dispute resolution and enforcement.6 This impact requires further (and constant) reexamination and analysis. This Article is a step in this direction. Smart contracts, broadly defined, refer to transactions that machines form, validate, and enforce. For example, imagine Amazon’s Alexa (a virtual assistant) takes your order for pizza on a Sunday before football. Now, Alexa, knowing your past choices for pizza and your preferred time, automatically orders pizza on a Sunday before football. It can go even further by searching all local pizzerias for the best deal and ordering pizza on a Sunday before football. Moreover, if the pizza arrives late (which can be determined via a scanning device at the front door of your house), Alexa only releases half of the value of the pizza based on the pizzeria’s declared policies. Now imagine that all local pizzerias (sellers) and pizza lovers (buyers) are part of a network while each buyer and seller has a virtual assistant that a corporation like Amazon does not control.7 Additionally, no banks clear monetary transactions between sellers and buyers in this network. Here is how it can work: in this network, virtual assistants incorporate a smart contract (a code) whereby it looks for the best price and best terms, concludes the agreement, and transfers the amount. Once the transaction is concluded, other users (which again are virtual assistants that incorporate smart contracts) review the transaction, verify it, and store it on a shared electronic book (so-called ledger). These transactions are immutable, reviewable by all users, and the stored data can inform future transactions.8 Smart contracts have widespread applications in various sectors, particularly in in finance (e.g., Bitcoin, Ripple, Ethereum, Facebook, 5.See generally Lauren Henry Scholz, Algorithmic Contracts, 20 STAN. TECH. L. REV. 128 (2017) (discussing the interpretation of electronic contracts whose algorithms may not be understandable ex ante through the principles of agency common law). 6.See Daniel Markovits & Alan Schwartz, The Expectation Remedy and the Promissory Basis of Contract, 45 SUFFOLK U. L. REV. 799, 808 (2012) (“[A]rm’s length dealing remains the right model for private law, especially commercial law . . . .”). 7.As this example shows and as was previously stated by Richard Gendal Brown, the smart contracts are not just “a computer program.” They are “actor[s] in [their] own right.” They can respond to “the receipt of information, [they] can receive and store value – and [they] can send out information and send out value.” Richard Gendal Brown, A Simple Model for Smart Contracts, RICHARD GENDAL BROWN: THOUGHTS ON THE FUTURE OF FIN. (Feb. 10, 2015) (emphasis in original), https://gendal.me/2015/02/10/a-simple-model-for-smart-contracts/ [https://perma.cc/R93G-7J56]. 8.See id.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 54 WASHINGTON LAW REVIEW [Vol. 96:51 Libra) and production and supply chain9 (e.g., Walmart test pilot of blockchain following the widespread contamination of romaine lettuce).10 Additionally, there are ongoing efforts to use blockchain in other sectors including insurance (e.g., encoding rules for damages reimbursement), governmental functions (e.g., identity management by automating identity checks), healthcare (e.g., automating processes such as prior authorization for specific treatments), Internet of Things (IoT) (e.g., washing machine automatically ordering a broken part), and sharing economy (e.g., creating member-based autonomous organizations replicating services such as Airbnb and Uber).11 Such digitization of contracts is changing the act of contracting along with the socio-legal dynamics surrounding it. For one, this automated process does not allow for the reciprocal recognition found in traditional contracting.12 Orthodox contract law states that contractual obligations come into existence because they are “immediately chosen”13 and contracts are enforceable because “respect for [counterparties] as free and rational” requires taking their promises seriously.14 In smart contracts, however, interactions that occur through negotiations, an exchange of promises, and mutual assent at the time of contracting are largely absent. Smart contracting also directly affects the very notion of promise. Modern 9.Production refers to the process of creating goods for consumption. Supply chain refers to the process of storing and moving finished goods from the point of production to consumers. 10.Michael Corkery & Nathaniel Popper, From Farm to Blockchain: Walmart Tracks Its Lettuce, N.Y. TIMES (Sept. 24, 2018), https://www.nytimes.com/2018/09/24/business/walmart-blockchain-lettuce.html [https://perma.cc/452M-S2S3]. 11.Valentina Gatteschi, Fabrizio Lamberti & Claudio Demartini, Technology of Smart Contracts, in THE CAMBRIDGE HANDBOOK OF SMART CONTRACTS, BLOCKCHAIN TECHNOLOGY AND DIGITAL PLATFORMS 37, 45–53 (Larry A. DiMatteo et al. eds., 2019). 12.[T]he struggle for recognition is conceptually similar to contract formation in an essential respect. Both involve a confrontation between seemingly independent beings, each seeking to make the greatest possible use of the other while making the smallest possible contribution in return. Yet the process in which they both become engaged—bargaining in the context of contract, the dialectical process in that of the struggle for recognition—leads them to accept voluntarily a very different outcome than that originally hoped for. Michel Rosenfeld, Hegel and the Dialectics of Contract, 10 CARDOZO L. REV. 1199, 1229 (1989). 13.Daniel Markovits, Theories of the Common Law of Contracts, in STANFORD ENCYCLOPEDIA OF PHILOSOPHY (Edward N. Zalta ed., 2015), https://plato.stanford.edu/entries/contracts-theories/ [https://perma.cc/PS8D-AXPZ] (“[A] tort obligation might arise in connection with a choice—as the obligation not to be drunk arises in connection with the choice to operate a car; a contract obligation, by contrast, is itself immediately chosen—at the core of every offer and every acceptance lies . . . an intention to establish an obligation by communicating this intention.” (emphasis in original)). 14.CHARLES FRIED, CONTRACT AS PROMISE: A THEORY OF CONTRACTUAL OBLIGATION 20 (1981); see also Charles Fried, Contract as Promise Thirty Years on, 45 SUFFOLK U. L. REV. 961, 962 (2012) [hereinafter Fried, Thirty Years on] (arguing that contract as promise is based on “morality of autonomy, respect for persons and trust”).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 55 contracts—which Weber calls “purposive contract[s]”15—entail “projection of exchange into the future.”16 In the same vein, orthodox contract theory has emphasized the forward-looking feature of contracts as the basis for contractual liability.17 The promise of smart contracts, on the other hand, rests on the notion that exchanges occur synchronously without future obligations remaining. These essential differences necessitate revisiting the legal nature of smart contracts. The notion of consent-based forward-looking contracts does not squarely fit smart contracting. The current literature has not addressed the nature of smart contracts in light of contractual disputes. Existing legal literature on smart contracting can be classified into three categories: the first category primarily explains the difficult technology underlying smart contracting and providing resemblance to existing legal doctrines.18 The second category focuses on its limits and the hype around the technology.19 The third category 15. RICHARD SWEDBERG, MAX WEBER AND THE IDEA OF ECONOMIC SOCIOLOGY 101 (1998) (quoting MAX WEBER, ECONOMY AND SOCIETY: AN OUTLINE OF INTERPRETIVE SOCIOLOGY 673 (1978)). Weber distinguishes between “the status contract” and “the purposive contract.” Id. The former, which is typical for a primitive society, address a person’s total legal situation and result in a change of one status to another (e.g., one’s wife). Id. The latter “aim[s] solely . . . at some specific (especially economic) performance or result.” Id. 16.Ian R. Macneil, The Many Futures of Contracts, 47 S. CAL. L. REV. 691, 712–13 (1974). 17.Markovits & Schwartz, supra note 6, at 799 (“[G]rounding contract in promise highlights two of contract law’s most distinctive yet least understood features: that the law establishes liability strictly, rather than based on fault; and that it creates forward-looking rather than the usual backward-looking entitlements, entitlements to be made better off rather than to secure the status quo ante.”). 18.See generally Jonathan G. Rohr, Smart Contracts and Traditional Contract Law, or: The Law of the Vending Machine, 67 CLEV. ST. L. REV. 71 (2019) (arguing that the body of law surrounding vending machines can be applied to smart contracts); Scott A. McKinney, Rachel Landy & Rachel Wilka, Smart Contracts, Blockchain, and the Next Frontier of Transactional Law, 13 WASH. J.L. TECH. & ARTS 313 (2018) (discussing the legal nature of smart contracts and suggesting universal smart contracts standards and best practices); Kevin Werbach & Nicolas Cornell, Contracts Ex Machina, 67 DUKE L.J. 313 (2017) (arguing that smart contracts will not displace contract law); Stephen McJohn & Ian McJohn, The Commercial Law of Bitcoin and Blockchain Transactions, 47 UNIF. COM. CODE L.J. 187 (2017) (arguing that smart contracts may be functionally more like letters of credit); Max Raskin, The Law and Legality of Smart Contracts, 1 GEO. L. TECH. REV. 305, 305 (2017) (arguing that smart contract are simply a “new form of preemptive self-help”). 19.See generally James Grimmelmann, All Smart Contracts Are Ambiguous, 2 J.L. & INNOVATION 1 (2019) (showing that all smart contracts are incomplete and ambiguous); Eliza Mik, Smart Contracts: Terminology, Technical Limitations and Real World Complexity, 9 L. INNOVATION & TECH. 269, 299 (2017) (showing that smart contracts are not a “semi-mythical technology liberating the contracting parties from the shackles of traditional legal and financial institutions”); Carla L. Reyes, If Rockefeller Were a Coder, 87 GEO. WASH. L. REV. 373 (2019) (showing the practical and theoretical challenges arising out of blockchain-based business ventures under existing business organization laws); Jeffrey M. Lipshaw, The Persistence of “Dumb” Contracts, 2 STAN. J. BLOCKCHAIN L. & POL’Y 1 (2019) (arguing that traditional contracts will persist to exists since smart
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 56 WASHINGTON LAW REVIEW [Vol. 96:51 analyzes the regulatory challenges arising from smart contracts.20 The challenge in all the categories of the existing literature is three-fold: it often focuses too much on the existing technology; it does not provide a comprehensive view of smart contracting; and it mainly analyzes smart contracts from the formation phase and does not take into account the dispute phase.21 Moreover, the existing literature has largely concentrated on the trust architecture (disintermediation) of the blockchain technology.22 This Article, on the other hand, focuses more on the distributed feature of the blockchain technology, and in particular smart contracts.23 This Article makes two principal contributions. First, it contends that a reliance-based (tort-like) approach better fits and explains the nature of smart contracting. The Article argues the reliance theory best describes smart contract transactions that are concluded largely absent of any human contracts cannot replace human decision-making capability); Usha R. Rodrigues, Law and the Blockchain, 104 IOWA L. REV. 679, 717 (2019) (arguing that smart contracts do not allow for “legal intervention” points); Shaanan Cohney & David A. Hoffman, Transactional Scripts in Contract Stacks, 105 MINN. L. REV. 319 (2020) (arguing that smart contracts—or, as they call it, transactional script—can lower some transactional costs relative to other legally operative instruments). 20.See generally Reggie O’Shields, Smart Contracts: Legal Agreements for the Blockchain, 21 N.C. BANKING INST. 177 (2017) (discussing the legal and regulatory issues associated with the greater adoption of smart contracts); Shaanan Cohney, David Hoffman, Jeremy Sklaroff & David Wishnick, Coin-Operated Capitalism, 119 COLUM. L. REV. 591 (2019) (showing empirically that coin offering codes and initial coin offering disclosures often do not match); Adam J. Kolber, Not-So-Smart Blockchain Contracts and Artificial Responsibility, 21 STAN. TECH. L. REV. 198 (2018) (analyzing third-party harms arising from smart contracts and possible regulations); Carla L. Reyes, Nizan Geslevich Packin & Benjamin P. Edwards, Distributed Governance, 59 WM. & MARY L. REV. ONLINE 1 (2017) (discussing the new governance structure of organizations based on smart contracts and their regulatory risks); Kevin Werbach, Trust, but Verify: Why the Blockchain Needs the Law, 33 BERKELEY TECH. L.J. 487 (2018) (discussing the necessity of regulation of smart contracts). 21.A handful of articles have endeavored to address this deficiency in the literature. See generally Amy J. Schmitz & Colin Rule, Online Dispute Resolution for Smart Contracts, 2019 J. DISP. RESOL. 103 (arguing that parties use online dispute resolution to resolve contract disputes); AMY J. SCHMITZ, AM. ARB. ASS’N, MAKING SMART CONTRACTS “SMARTER” WITH ARBITRATION (2020), https://go.adr.org/rs/294-SFS-516/images/Making%20Smart%20Contracts%20Smarter%20 with%20Arbitration%20by%20Amy%20Schmitz.pdf [https://perma.cc/9D8H-M5XZ] (arguing that contracting parties should build arbitration into their smart contracts). For a general criticism from a psychological perspective, see Jean R. Sternlight, Pouring a Little Psychological Cold Water on Online Dispute Resolution, 2020 J. DISP. RESOL. 1. These articles generally center on the use of existing dispute resolution mechanism for smart contracts. My suggestion is based on the network potentials for dispute resolution. See infra Part IV for further discussion. 22.See KEVIN WERBACH, THE BLOCKCHAIN AND THE NEW ARCHITECTURE OF TRUST 17–32 (2018). 23.Although the blockchain technology achieves trust in part through the distributed feature, the distributed characteristic of the blockchain technology alone, and in particular smart contracts, has not received the requisite attention in the legal scholarship. Simply put, as this Article shows, the easy and wide access to a distributed network of users has a foundational impact on contracting and contractual disputes.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 57 involvement. Second, it shows that, in smart contracts, the human connection can only exist in ex post dispute resolution. This Article argues that ex post dispute resolution should utilize a large pool of users (proof-of-work model) and not a handful of select users (proof-of-stake model). With this structure, this Article argues, several of the existing problems such as repeat players and consumer arbitration could be minimized. There are a few caveats to state at the outset of this Article: first, the technology is still nascent and abstract but reachable. Second, to be absolutely precise, the automation of the formation phase is conducted by artificial intelligence (as it predicts future choices based on past choices), and contractual enforcement is based on the blockchain technology which automates enforcement while disintermediating institutions such as banks via verification by other users. Third, not all smart contracts are spot contracts.24 Some can be relational to a certain extent.25 The focus of this Article, however, is on fully automated machine-to-machine smart contracts that transact on the spot. This Article is structured as follows: Part I provides more background on smart contracts and the most relevant features to this discussion. Part II analyzes the limits of the existing theories on the legal nature of smart contracts. Part III provides a novel approach in analyzing smart contracts and argues for a reliance-based theory of smart contracts. Part IV investigates the problem of incompleteness in smart contracts and the lack of entry points for parties and courts to address the inherent incompleteness. Part IV focuses on contractual disputes in the age of smart contracts and proposes a truly decentralized user-based dispute resolution mechanism. I. WHAT MAKES SMART CONTRACTS SMART? In the first section below, the Article reviews and analyzes the key features of smart contracts. It explains automation, anonymity, and verification process offered by smart contracts. In the second section, the Article zeros in on the verification and validation process while explaining how it has the capability of creating a network-based enforcement mechanism without relying on a centralized authority. 24.Here I use the term spot contracts to refer to one-off agreements that occur on a specific date and are not durational. In finance, spot contracts refer to agreements of buying and selling on the spot date as opposed to future (forward) contracts where payments and delivery are stipulated for a later date. See, e.g., James Chen, Spot Trade, INVESTOPEDIA (Jan. 23, 2021), https://www.investopedia.com/terms/s/spottrade.asp [https://perma.cc/73GV-9YYW]. 25.Stefan Grundmann & Philipp Hacker, Digital Technology as a Challenge to European Contract Law: From the Existing to the Future Architecture, 13 EUR. REV. CONT. L. 255, 267–69 (2017).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 58 WASHINGTON LAW REVIEW [Vol. 96:51 A. Explaining Smart Contracts What is smart about smart contracts? The answer lies in the possibility of automatic execution using algorithm and codes.26 Smart contracts refer to obligations that are programmable and operate on a distributed network. The notion of smart contracts was first proposed by Nick Szabo who is also widely believed to be the Bitcoin founder, Satoshi Nakamoto, a fact he has repeatedly denied.27 According to Szabo, smart contracts consist of “a set of promises, specified in digital form, including protocols within which the parties perform on these promises.”28 Smart contracts are therefore protocols, or set of rules or procedures for transmitting data. In other words, smart contracts that are embedded in a blockchain can automatically “receive and send assets as well as information.”29 For Szabo, smart contracts “should be embedded in the world,” meaning “to embed contracts in all sorts of property that is valuable and controlled by digital means.”30 To simplify, given the existing technology, smart contracts are similar to apps.31 Just like apps—e.g., Google Maps—smart contracts run on a platform (in this case the blockchain with specific consensus mechanisms) and each has its own rules. In smart contracts, the obligations of the parties are pre-determined by computer programs. More importantly, this new technology enables two vending machines to transact, without direct human involvement, if a condition occurs. For example, if the temperature reaches ninety degrees, vending machine A is programmed to automatically transfer a dollar bill to vending machine B, which in turn delivers a can of cold soda. Another example is fintech companies’ algorithmic trading, by which computer programs determine the selling or buying of stocks.32 For instance, a computer program is set to “sell” an existing stock if its value drops more than 10% while another computer is 26.Raskin, supra note 18, at 306. 27.Nathan Reiff, Who Is Nick Szabo, and Is He Satoshi Nakamoto?, INVESTOPEDIA (Apr. 12, 2018), https://www.investopedia.com/news/who-nick-szabo-and-he-satoshi-nakamoto/ [https://perma.cc/99F7-QUHF]. 28.NICK SZABO, SMART CONTRACTS: BUILDING BLOCKS FOR DIGITAL MARKETS (rev. ed. 2018). 29.Philipp Hacker, Ioannis Lianos, Georgios Dimitropoulos & Stefan Eich, Regulating Blockchain, in REGULATING BLOCKCHAIN: TECHNO-SOCIAL AND LEGAL CHALLENGES 1, 4 (Philipp Hacker et al. eds., 2019). 30.SZABO, supra note 28 (emphasis in original). 31.Jeremy M. Sklaroff, Comment, Smart Contracts and the Cost of Inflexibility, 166 U. PA. L. REV. 263, 276 (2017). 32.Fintech refers to the use of technology and innovation in banking and financial services. See Julia Kagan, Financial Technology–Fintech, INVESTOPEDIA (Aug. 28, 2020), https://www.investo pedia.com/terms/f/fintech.asp [https://perma.cc/JZS2-7Y49].
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 59 programed to “buy” the same stock if its value drops more than 10%. If such automated transactions are built on a blockchain platform where other users verify the transaction, not an external body such as the Security and Exchange Commission, the contract is a smart contract. A key relevant feature of smart contracts in the formation phase of contracting is that computers do not exchange promises.33 Instead, each computer includes codes that unliterally determine the condition of a transfer (if the stock drops 10%, then buy). Only when other computer codes match the conditions of the first computer, the transaction occurs (if the stock drops 10%, then sell). Smart contracts therefore most resemble cross-offers.34 In a general sense, smart contracting refers to the take-over of contract formation and performance by machine thinking.35 Machine-made contracts by IoT devices such as Alexa or Google Home may be the future of contracting, in which machines take over not only a digital reality (e.g., Bitcoin) but a physical object (e.g., real property).36 This possibility is not just theoretical as the “perfect pair” of smart contracts (built on a blockchain-based platform) and IoT has led to several startups in food supply, medicine shipping, manufacturing, construction, energy, and transportation, to name a few.37 Relatedly, as many as fifty major companies, such as Amazon, Walmart, JP Morgan and BP, are adopting the blockchain technology.38 Walmart and Facebook also announced that 33.Raskin, supra note 18, at 323. 34.Anthony J. Bellia, Jr., Contracting with Electronic Agents, 50 EMORY L.J. 1047, 1058 (2001) (The author poses the example of crossing offers: “If I mail you an offer to buy soda for $1.00, and you simultaneously mail me an offer to sell soda for $1.00, no contract results.”). In these instances, the contract validity therefore relies on agency principles. See id. at 1059. 35.Lipshaw, supra note 19, at 5 (describing that smart contracting means to “delegate more and more of the creation, performance, and disposition of legally binding transactions to machine thinking”). 36.See SURABHI KEJRIWAL & SAURABH MAHAJAN, DELOITTE CTR. FOR FIN. SERVS., SMART BUILDINGS: HOW IOT TECHNOLOGY AIMS TO ADD VALUE FOR REAL ESTATE COMPANIES (2016), https://www2.deloitte.com/content/dam/Deloitte/nl/Documents/real-estate/deloitte-nl-fsi-real-estate-smart-buildings-how-iot-technology-aims-to-add-value-for-real-estate-companies.pdf [https://perma.cc/8AL3-YBFD]; see also IOTA, https://www.iota.org [https://perma.cc/8SR2-AAF3] (initiative by IOTA which uses a distributed ledger technology to record and execute transactions between machines and devices in IoT). 37.Rohan Pinto, Demystifying the Relationship Between IoT and Blockchain, FORBES TECH. COUNCIL (May 29, 2019, 7:45 AM), https://www.forbes.com/sites/forbestechcouncil/2019/ 05/29/demystifying-the-relationship-between-iot-and-blockchain/?sh=e78c05f605de [https://perma.cc/L4S7-BVK8]. For example, leasing a car can be done via blockchain technology. Using this technology, searching, negotiating, and concluding the lease contract can be completed on the blockchain platform. If, for example, the lessee fails to make payment, the smart key of the car automatically stops the car until payment is made. Sklaroff, supra note 31, at 273–74. 38.Michael del Castillo, Blockchain Goes to Work at Walmart, Amazon, JPMorgan, Cargill and 46 Other Enterprises, FORBES (Apr. 16, 2019, 6:00 AM), https://www.forbes.com/sites/
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 60 WASHINGTON LAW REVIEW [Vol. 96:51 they will launch their own currencies based on blockchain (so-called cryptocurrency).39 To summarize, smart contracts offer three features: (1) full automation of contract formation and execution; (2) contract validation by other users; (3) anonymity of contractual parties.40 One of the principal differences between smart contracts and traditional contracts relates to its autonomous execution and termination. Smart contracts are essentially coded obligations that are enforced autonomously. Such codes are distributed within various nodes (different users/computers) in the underlying platform and network.41 This design makes several key features of traditional contracting almost impossible: termination, modification, interpretation, and even adjudication.42 Since codes for smart contracts act as the rule of the game in the platform on which different users/nodes rely, any modification is extremely difficult.43 In summary, a smart contract encodes certain conditions and outcomes so that if such conditions occur, the contract automatically executes itself. michaeldelcastillo/2019/04/16/blockchain-goes-to-work/#192dc52e2a40 [https://perma.cc/9ENZ-8VXY]. 39.Ron Shevlin, Why Does Walmart Want a Cryptocurrency?, FORBES (Aug. 5, 2019, 11:00 AM), https://www.forbes.com/sites/ronshevlin/2019/08/05/why-does-walmart-want-a-cryptocurrency/#54d8a7e91502 [https://perma.cc/A4TQ-JMF2]. 40.Sklaroff, supra note 31, at 264. Moreover, smart contracting can cause several groundbreaking shifts in firm contracting and corporate governance. It alters firm contracting since it removes certain transactions costs while adding others. It automates certain organizational and governmental decisions. It provides more power to smaller stakeholders. Alex Murray, Scott Kuban, Matthew Josefy & Jon Anderson, Contracting in the Smart Era: The Implications of Blockchain and Decentralized Autonomous Organizations for Contracting and Corporate Governance, ACAD. MGMT. PERSPS. (Apr. 17, 2019), https://journals.aom.org/doi/abs/10.5465/AMP.2018.0066 (last visited Mar. 3, 2021). 41.PRIMAVERA DE FILIPPI & AARON WRIGHT, BLOCKCHAIN AND THE LAW: THE RULE OF CODE 74–75 (2018); see also Castillo, supra note 38 (“At its core, blockchain is simply a distributed database, with an identical copy stored on many computers.”). 42.Stuart D. Levi & Alex B. Lipton, An Introduction to Smart Contracts and Their Potential and Inherent Limitations, HARV. L. SCH. F. ON CORP. GOVERNANCE (May 26, 2018), https://corpgov.law.harvard.edu/2018/05/26/an-introduction-to-smart-contracts-and-their-potential-and-inherent-limitations/ [https://perma.cc/8S5W-HB7W]. 43.See id. (“Indeed, given that blockchains are immutable, modifying a smart contract is far more complicated than modifying standard software code that does not reside on a blockchain. The result is that amending a smart contract may yield higher transaction costs than amending a text-based contract, and increases the margin of error that the parties will not accurately reflect the modifications they want to make.”). In such platforms, any change would likely require 51% of the users. For example, in Bitcoin, 51% attack refers to the hypothetical that a group of miners acquire more than 50% of the platform computing power and therefore could change the rules of the game (e.g., confirming transactions, executing payments, and prohibiting double-spending). Jake Frankenfield, 51% Attack, INVESTOPEDIA (May 6, 2019), https://www.investopedia.com/terms/1/51-attack.asp [https://perma.cc/UEE2-QN36].
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 61 This process can be verified by other nodes in the network.44 Several states have adopted laws related to smart contracts that include definitions referring to smart contracts as event driven.45 These laws typically define the smart contract as “an event-driven program, with state, that runs on a distributed, decentralized, shared and replicated ledger and that can take custody over and instruct transfer of assets on that ledger.”46 They also confirm that smart contracts “may exist in commerce” and a contract shall not be denied “legal effect, validity or enforceability solely because that contract contains a smart contract term.”47 B. Validation and Verification Smart contracts automate the formation and performance of contractual obligations. Traditional contract law is agential, believing in the notion that human agents can choose to assume certain obligations through contracting (e.g., autonomy principle or will theory in contract law).48 In smart contracting, much of the contract formation and performance are delegated to an electronic agent.49 Machines, which can use artificial intelligence and machine learning to predict and exercise new promises, take over the very act of promising. In other words, human will is increasingly missing from the ex ante formation of contracts. This casts 44.ALAN MCQUINN & DANIEL CASTRO, INFO. TECH. & INNOVATION FOUND., A POLICYMAKER’S GUIDE TO BLOCKCHAIN 20–21 (2019), https://itif.org/sites/default/files/2019-policymakers-guide-blockchain.pdf [https://perma.cc/NW4B-5DEK]. 45.ARIZ. REV. STAT. ANN. § 44-7061 (2020); TENN. CODE ANN. § 47-10-201 (2020). 46.ARIZ. REV. STAT. ANN. § 44-7061(e)(2). The Tennessee law offers a more detailed definition. It provides a similar definition but adds that the ledger is “used to automate transactions, including, but not limited to, transactions that: (A) [t]ake custody over and instruct transfer of assets on that ledger; (B) [c]reate and distribute electronic assets; (C) [s]ynchronize information; or (D) [m]anage identity and user access to software applications.” TENN. CODE ANN. § 47-10-201(2). 47.ARIZ. REV. STAT. ANN. § 44-7061(c). 48.In a classic article from 1941, Lon Fuller defined the autonomy principle as follows: the most pervasive and indispensable is the principle of private autonomy. This principle simply means that the law views private individuals as possessing a power to effect, within certain limits, changes in their legal relations. . . . This power of the individual to effect changes in his legal relations with others is comparable to the power of a legislature. Lon L. Fuller, Consideration and Form, 41 COLUM. L. REV. 799, 806–07 (1941). With the expansion of the law and economics approach, scholars also proposed theories of contract law based on efficiency. See generally Alan Schwartz & Robert E. Scott, Contract Theory and the Limits of Contract Law, 113 YALE L.J. 541 (2003) (discussing traditional theories of contract law and their limits). 49.Electronic agent is defined as “a computer program, or electronic or other automated means used independently to initiate an action or respond to electronic messages or performances without intervention by an individual at the time of the action, response or performance.” UNIF. COMPUT. INFO. TRANSACTIONS ACT § 102(a)(28) (UNIF. L. COMM’N 1999).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 62 WASHINGTON LAW REVIEW [Vol. 96:51 doubt on the moral theory of contracting since “[p]romises lie at the center of persons’ moral experience of one another, and contracts lie at the center of their legal experience of one another.”50 The validation and verification process of smart contracting changes the network structure based on which contractual parties enter into agreements. In traditional contracting, parties enter into agreements against the backdrop of law and judicial enforcement.51 Parties rely on trust, law, and a select group of people for validation and verification of their contracts.52 For instance, in the purchase of a used laptop via Amazon, the buyer has to exercise some level of trust in the platform and in the buyer. The buyer is also under the belief that law has put in place certain measures to protect them from fraudulent activities. The buyer can also rely on reviews about the seller and request a few of their trusted acquaintances to check the specifics of the merchandise or examine it. A similar network structure also exists for the seller. In traditional contracting, the seller and buyer are mostly reliant on a few centralized networks for their transactions: a group of trusted individuals (e.g., close friends, lawyers, experts, etc.); platform providers (e.g., Amazon); and the legal system (e.g., the judiciary). The contractual parties are also largely familiar with these networks. The form of trust radically changes through smart contracting, in which parties are reliant on computers, codes, and peers (other nodes) to validate their transactions.53 In this structure, parties (or to be more precise, electronic agents) transact in reliance on a network of unknown individuals (nodes) with whom they are not familiar. Smart contracts function pursuant to a game theory, in which other nodes in the network are incentivized to 50.Daniel Markovits, Contract and Collaboration, 113 YALE L.J. 1417, 1419 (2004). 51.Contract enforcement is a matter of public law. See, e.g., Farshad Ghodoosi, The Concept of Public Policy in Law: Revisiting the Role of the Public Policy Doctrine in the Enforcement of Private Legal Arrangements, 94 NEB. L. REV. 685, 697 (2016) (“[E]nforcing a contract is a matter of public law.”); David A. Hoffman & Cathy Hwang, The Social Cost of Contract, COLUM. L. REV. (forthcoming 2021) (manuscript at 1), https://scholarship.law.upenn.edu/faculty_scholarship/2188/ [https://perma.cc/97X4-4GDN] (arguing that contracts are “bargains that always involve the public”); Aditi Bagchi, Interpreting Contracts in a Regulatory State, 54 U. S.F. L. REV. 35, 41 (2019) (noting that “[o]ur modern regulatory state can, and sometimes does, directly regulate those terms”); Cathy Hwang & Matthew Jennejohn, Contractual Depth (Nov. 10, 2019) (unpublished manuscript), https://am.aals.org/wp-content/uploads/sites/4/2019/12/AM20BusinessLawHwang Paper.pdf [https://perma.cc/6DSQ-SWHF] (describing how contracts between private parties are written with regulators as an intended audience). 52.For the discussion of trust in contract law see generally Anthony J. Bellia, Jr., Promises, Trust, and Contract Law, 47 AM. J. JURIS. 25 (2002). 53.MCQUINN & CASTRO, supra note 44, at 5.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 63 validate the contracts.54 In the process of smart contracting, each time a transaction is concluded, the platform simultaneously broadcast it the entire network. Once different nodes validate and verify the transaction, a new block is added to the blockchain.55 In other words, once a consensus is reached amongst the users, a block inscribed with the transaction is added to the chain. Scholars and computer scientists disagree over the technology and the features of blockchain.56 For example, a key feature of blockchain is its decentralization.57 As noted, in the current technology, decentralization has not been achieved yet.58 More importantly, human agency has been instrumental in the blockchain technology as “many actions taken by small, coordinated groups of people” made pivotal changes to Bitcoin and Ethereum.59 Technology rapidly changes, so discussing the nuances of it is often times moot. The most salient aspect of blockchain technology is that it allows for record keeping of transactions that are verified by a consensus mechanism in a decentralized system. Imagine a ridesharing company where all rides and payments are recorded on an immutable, decentralized chain of blocks instead of a company recording and managing this data. The types of information and the ways in which this information is recorded are all determined by the validation and verification process of this network (instead of being dictated by a company). To put it more simply, imagine a group of friends who decide to record their daily 54.See generally Giancarlo Bigi, Andrea Bracciali, Giovanni Meacci & Emilio Tuosto, Validation of Decentralised Smart Contracts Through Game Theory and Formal Methods, in PROGRAMMING LANGUAGES WITH APPLICATIONS TO BIOLOGY AND SECURITY 142, 142 (Chiara Bodei et al. eds., 2015) (combining game theory and formal methods to address the complexity of the analysis and validation of smart contracts). 55.MCQUINN & CASTRO, supra note 44, at 5. 56.Adrianne Jeffries, ‘Blockchain’ Is Meaningless, THE VERGE (Mar. 7, 2018, 11:36 AM), https://www.theverge.com/2018/3/7/17091766/blockchain-bitcoin-ethereum-cryptocurrency-meaning [https://perma.cc/FH53-5B8J] (noting that “there is widespread disagreement over which qualities are essential in order to call something a blockchain”); see also Marco Iansiti & Karim R. Lakhani, The Truth About Blockchain, HARV. BUS. REV. (Jan.–Feb. 2017), https://hbr.org/2017/01/the-truth-about-blockchain [https://perma.cc/KSL2-WYJK]. 57.Mally Anderson, Exploring Decentralization: Blockchain Technology and Complex Coordination, J. DESIGN & SCI. (Feb. 6, 2019), https://jods.mitpress.mit.edu/pub/7vxemtm3/ release/1 [https://perma.cc/6N2E-A4S6] (“More importantly, blockchain-supported technologies can potentially facilitate decentralized coordination and alignment of human incentives on a scale that only top-down, command-and-control structures previously could.”). 58.Angela Walch, Deconstructing ‘Decentralization’: Exploring the Core Claim of Crypto Systems, in CRYPTOASSETS: LEGAL, REGULATORY, AND MONETARY PERSPECTIVE 39, 58 (Chris Brummer ed., 2019) (arguing that decentralization has created a veil for people who are behind the technology in order to limit their liabilities). 59.Id. at 67.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 64 WASHINGTON LAW REVIEW [Vol. 96:51 expenditure. They can hire an accountant. Alternatively, they can set in place a mechanism by which each transaction is recorded by the members of the group following the pre-approved verification process of other members. The latter resembles the core of what blockchain technology promises to do.60 To be clear, humans create blockchain platforms and the underlying codes. Humans, however, have limited roles in changing the smart contract codes once they are programmed. II. LIMITS OF EXISTING LEGAL THEORIES OF SMART CONTRACTS As discussed, smart contracts consist of “a set of promises, specified in digital form, including protocols within which the parties perform on these promises.”61 In other words, smart contracts—embedded in a blockchain—can automatically receive and send assets and information.62 For smart contracts to work, parties’ obligations should be well thought-out and ingrained in a self-executing code (e.g., if/then). Vending machines are the often-given analogy for smart contracts where parties’ obligations are carefully pre-determined.63 All that is needed to trigger the contract is a dollar bill. Contracts are therefore simple and binary (e.g., if a dollar bill, then soda). Smart contracts further take the automated feature of a vending machine further. In vending machines, only one party’s performance is automated (i.e., the vending machine’s). In smart contracts, however, both parties’ performance of obligations is automated with no future obligations remaining to be executed.64 Moreover, in smart contracts, parties can even delegate the very conclusion of contracts to electronic agents65 and their obligations can be “synchronous,” unlike the asynchronous relationship between a vending company and a consumer.66 In these limited contracts, therefore, there are only broken codes, not 60.See generally Luke Conway, Blockchain Explained, INVESTOPEDIA (Nov. 17, 2020), https://www.investopedia.com/terms/b/blockchain.asp [https://perma.cc/VW2U-53A8]. There are many videos on YouTube on the topic. I have found this very brief explanation by the BBC helpful: BBC News, Bitcoin Explained: How Do Cryptocurrencies Work?–BBC News, YOUTUBE (Feb. 12, 2018), https://www.youtube.com/watch?v=SzAuB2FG79A [https://perma.cc/HU3U-AXKR]. 61.SZABO, supra note 28. 62.Hacker et al., supra note 29, at 9. 63.Alexander Savelyev, Contract Law 2.0: ‘Smart’ Contracts as the Beginning of the End of Classic Contract Law, 26 INFO. & COMMC’NS TECH. L. 116, 120 (2017). 64.Id. at 129. Some scholars find the lack of future obligation “simply inconsistent” with traditional notions of contracting as “[t]ypical contracts” involve future performance by one or more parties. Kolber, supra note 20, at 221–22. 65.Savelyev, supra note 63, at 121. 66.SZABO, supra note 28.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 65 bargaining nor broken promises.67 Disputes can arise out of unforeseen coding errors or hacks.68 As a result, smart contracts include “occasional earthquakes” rather than “continual linguistic drift” that is inherent in traditional contracting.69 In the last several decades, contract theory has focused on three paradigms for theorizing about the enforceability of contracts: promisor, promisee, and socio-economics surrounding the transaction.70 The bargain theory states that the promisor’s manifested intention to create legal relations result in contractual obligations and is the basis of enforceability of contracts.71 This theory has also stressed the element of exchange in which only reciprocal promises are enforceable.72 The reliance theory, on the other hand, shifts the focus onto the reliance made by the promisee as a result of a promise.73 Under this view, contracts are 67.Werbach & Cornell, supra note 18, at 322–23 (discussing that in computable contracts if the “computation diverges from the parties’ intent, as conventionally understood in contract law, they may disregard the computerized result”). 68.One example is the 2016 hack by the Decentralized Autonomous Organization. David Siegel, Understanding the DAO Attack, COINDESK (Dec. 17, 2020, 1:50 PM), https://www.coindesk.com/understanding-dao-hack-journalists [https://perma.cc/B998-HHDW]. In this hack, the attacker found a small bug in the DOA contract code and was able to transfer around $60 million to a contract of which they were in sole control. See id. 69.Grimmelmann, supra note 19, at 20. The latter term—continual linguistic drift—refers to the interpretative feature of traditional contracting whereas the former—occasional earthquakes—emphasizes the failure and incompleteness of codes underlying smart contracts. 70.Markovits, supra note 13. 71.See, e.g., FRIED, supra note 14; SAMUEL WILLISTON, THE LAW OF CONTRACTS § 21 (1924); Randy E. Barnett, A Consent Theory of Contract, 86 COLUM. L. REV. 269, 304–05 (1986); Randy E. Barnett, Some Problems with Contract as Promise, 77 CORNELL L. REV. 1022, 1027 (1992); Markovits & Schwartz, supra note 6, at 799. Scholars differ whether a moral-based approach to promise forms the basis of contract obligation or objective consent. Charles Fried insists on the moral institution of promising as the basis of contracting whereas Randy Barnett argues for manifestation of an intention, not promising per se, as the most salient aspect of contracting. Compare Fried, Thirty Years on, supra note 14, at 978, with Barnett, supra, at 305. 72.Charles J. Goetz & Robert E. Scott, Enforcing Promises: An Examination of the Basis of Contract, 89 YALE L.J. 1261, 1261–62 (1980). This theory is called the “bargain theory” in which un-reciprocal promises are presumptively unenforceable. 73.See, e.g., GRANT GILMORE, THE DEATH OF CONTRACT (1974) (arguing that the expansion of the reliance theory eroded the classical consideration theory in contract law); L.L. Fuller & William R. Perdue, Jr., The Reliance Interest in Contract Damages: 2, 46 YALE L.J. 373, 419 (1937) (“If one means by ‘contractual’ a liability imposed because a promise was made and broken, then a liability to compensate losses incurred on the faith of a promise is as ‘contractual’ as any other.”). Section 90 of the Restatement (Second) of Contracts, which sets out the doctrine of promissory estoppel, is the primary enforcement mechanism for situations where the promisee relies on the promisor’s promise. RESTATEMENT (SECOND) OF CONTRACTS § 90 (AM. L. INST. 1981); see also Juliet P. Kostritsky, A New Theory of Assent-Based Liability Emerging Under the Guise of Promissory Estoppel: An Explanation and Defense, 33 WAYNE L. REV. 895, 964 (1987) (arguing that courts should use promissory estoppel “when persuasive barriers to, or explanations for dispensing with, explicit
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 66 WASHINGTON LAW REVIEW [Vol. 96:51 enforceable because people rely on the promises they receive.74 The last paradigm centers on the efficiency resulting from an exchange of promises (law-and-economics75) or the shared public norms such as coordinating conduct (relational contract theory76). Legal scholars have debated the legal nature of smart contracts. Some believe smart contracts are neither smart nor contracts in part because parties may enter into legal obligations without “knowing it or intending to.”77 This view is reinforced by the fact that smart contracts “are simply business rules encoded in software” and therefore are “not legally binding without contractual agreements.”78 Some believe that smart contracts are contracts “at the conceptual level” but do not necessarily constitute exchange of promises per se.79 Some point to the limited role of law in smart contracts because there is no entry point for legal intervention in reciprocal or formalized contracts exist and a plausible benefit to the promisor can be identified”); Michael B. Metzger & Michael J. Phillips, The Emergence of Promissory Estoppel as an Independent Theory of Recovery, 35 RUTGERS L. REV. 472, 482–87, 531–36 (1983) (arguing that promissory estoppel is a tort-like and independent theory of recovery that is different from contractual liability); Jay M. Feinman, The Last Promissory Estoppel Article, 61 FORDHAM L. REV. 303, 303–11 (1992) (shedding light on the debate between enforcement of promise or the protection of reliance as the basis for promissory estoppel). 74.See generally Jay M. Feinman, Promissory Estoppel and Judicial Method, 97 HARV. L. REV. 678 (1984) (arguing that promissory estoppel represents a failed attempt to address the contradictions of legal classicism); Barnett, supra note 71 (summarizing the problems with the promise theory of contract); P.S. ATIYAH, THE RISE AND FALL OF FREEDOM OF CONTRACT (1979) (showing the history and limits of promise-based liability as opposed to reliance-based liabilities); Omri Ben-Shahar, Contracts Without Consent: Exploring a New Basis for Contractual Liability, 152 U. PA. L. REV. 1829 (2004) (exploring the “no-retraction” theory of contract where each party is obligated to the terms manifested by them and can refrain only with some liability); Richard Craswell, Offer, Acceptance, and Efficient Reliance, 48 STAN. L. REV. 481 (1996) (exploring efficient reliance as an economic rationale in contract formation cases); Avery Katz, When Should an Offer Stick? The Economics of Promissory Estoppel in Preliminary Negotiations, 105 YALE L.J. 1249 (1996) (examining promissory estoppel as it applies in the context of preliminary negotiations through a lens of rational choice economic theory); Lucian Arye Bebchuk & Omri Ben-Shahar, Precontractual Reliance, 30 J. LEGAL STUD. 423 (2001) (analyzing the decision to invest in precontractual reliance under alternative legal regimes). 75.RICHARD A. POSNER, ECONOMIC ANALYSIS OF LAW 4–7, 17–19 (1986). 76.For example, according to Patrick Atiyah, it is the society, not law, that determines and defines obligations and entitlements. P.S. ATIYAH, PROMISES, MORALS, AND LAW 129 (1981); Ian R. Macneil, Contracts: Adjustment of Long-Term Economic Relations Under Classical, Neoclassical, and Relational Contract Law, 72 NW. U. L. REV. 854, 862 n.24 (1978) (arguing that all aspects of contractual relations are subject to the norms characterizing contracts generally and identifying (1) harmonizing conflict and (2) preservation of the relation as two norms particularly applicable to contractual relations). 77.Grimmelmann, supra note 19, at 4; see also Rohr, supra note 18, at 72 (“‘Smart contract’ is an unfortunate name for something that is not necessarily smart, or necessarily a contract.”). 78.MCQUINN & CASTRO, supra note 44, at 24. 79.Werbach & Cornell, supra note 18, at 341.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 67 these contracts.80 Others have categorized smart contracts based on the role of the algorithm. Depending on whether the algorithm is a gap-filler or a negotiator (tool or agent), the legal nature of such contracts differs.81 Some have criticized that smart contracts eliminate the social function of the act of contracting because the “technology of smart contracts neglects the fact that people use contracts as social resources to manage their relations.”82 Moreover, contracts are purported to be the main avenue for private lawmaking where individuals can solve their problems and regulate their behavior at the micro level.83 Such private lawmaking becomes automated and atomized with smart contracts. Smart contracts are also not reliant on third-party intermediaries or human agency for their execution.84 The critique of smart contracts therefore comes from both legal and social angles. The skepticism towards smart contracts in law derives in large part from the nature of smart contracts that aim to resolve all issues ex ante and leaves little to no room for corrective measures ex post.85 Smart contracts are entirely reliant on “ex ante formalizations, which can never match the flexibility of ex post human decision-making.”86 In other words, it is the lack of human connection and decision-making that has in part sparked the skepticism about the legal and social nature of smart contracts. These studies have largely focused on the immutability and automation of smart contracts while overlooking the distributed aspects of smart contracts.87 The distributed function enables new methods of contract-making and resolution of disputes. This Part surveys the various approaches to the nature of smart contracts while providing fresh insights. A. No Contract Assent is a foundational requirement for contracts. Contract law 80.Rodrigues, supra note 19, at 717 (“[W]hen gaps arise in the blockchain’s smart contracts, there are no legal intervention points upon which the law can work.”). 81.Scholz, supra note 5, at 136 (“Contracts where the algorithms help the parties as mere tools typically do not present any new issue for contract law. They are no different from a party using a calculator or a basic excel program to determine what to offer or accept. . . . When algorithms act as negotiators, more interpretive work is required to show the fit with contract law.”). 82.Karen E. C. Levy, Book-Smart, Not Street-Smart: Blockchain-Based Smart Contracts and the Social Workings of Law, 3 ENGAGING SCI. TECH. & SOC’Y 1, 1 (2017). 83.Avery W. Katz, Contract Theory—Who Needs It?, 81 U. CHI. L. REV. 2043, 2046 (2014) (“The key feature of contract law . . . is that it affords private parties the power of lawmaking.”). 84.Alex Murray et al., supra note 40, at 36–42. 85.Arvind Narayanan, Lecture 11–The Future of Bitcoin?, YOUTUBE (Apr. 27, 2015), https://youtu.be/YG7l0XPtzD4 [https://perma.cc/R2L7-XRCB]. 86.WERBACH, supra note 22, at 163. 87.Sklaroff, supra note 31, at 276.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 68 WASHINGTON LAW REVIEW [Vol. 96:51 requires mutual assent between parties or a “meeting of the minds.”88 With the advancement of technology, it was this requirement that led some to believe that smart contracts are not contracts since they lack human assent.89 Moreover, along with the rapid progress of artificial intelligence (AI), AI can take over more aspects of contracting including bargaining, negotiation, and formation of contracts.90 This means lesser involvement of human agents and lesser relevance of consent. Codes and algorithms can be expressions of assent,91 but it is the mutuality that can be a problem in smart contracts.92 This approach suggests that smart contracts are not enforceable because they do not satisfy the requirement of “manifestation of assent.”93 In other words, lack of (apparent) assent forms the basis for doubting the contractual nature of smart contracts.94 The Restatement (Second) of Contracts provides that for a contract to be formed, each party should manifest assent with reference to manifestation of the other.95 This requirement casts doubt on the notion of assent in smart contracts where neither side of the bargain manifests assent in reference to the other side’s offer.96 Simply put, as mentioned above, smart contracts resemble unilateral offers that cross each other and are not in reference or in response to another offer.97 Due to the challenges arising from the lack of explicit assent, the law 88.This requirement has been repeated in court decisions and can be inferred from the Restatement (Second) of Contracts. See RESTATEMENT (SECOND) OF CONTRACTS § 17 cmt. c (AM. L. INST. 1981). For the opposite and minority view, see Val Ricks, Assent Is Not an Element of Contract Formation, 61 KAN. L. REV. 591 (2013). See also SMART CONTS. ALL., CHAMBER OF DIGIT. COM., SMART CONTRACTS: IS THE LAW READY? 17 (2018) [hereinafter SMART CONTRACTS] (“The use of smart contracts may raise questions about whether the contracting parties have had a ‘meeting of the minds,’ when at least one side of the contracting process is consummated without human participation or intervention.”). 89.SMART CONTRACTS, supra note 88, at 17–18. 90.Id. at 9. 91.Harry Surden, Computable Contract, 46 U.C. DAVIS L. REV. 629, 656 (“[B]asic contracting principles actively accommodate data-oriented representation.”). 92.SMART CONTRACTS, supra note 88, at 41–42. 93.In the same vein, some scholars point that code cannot literally be a contract because “no physical representation of an agreement can ever entirely represent the agreement.” Kolber, supra note 20, at 219. Moreover, a mutually-binding agreement, in their view, “cannot be reduced to a press of a button.” Id. at 220. 94.Werbach & Cornell, supra note 18, at 340 (“Do smart contracts involve promises or obligations? In a significant sense, ‘no.’”). 95.RESTATEMENT (SECOND) OF CONTRACTS § 2(1) (AM. L. INST. 1981); id. § 23 (“It is essential to a bargain that each party manifest assent with reference to the manifestation of the other.”). 96.Bellia, Jr., supra note 34, at 1052–53. 97.See id. at 1058. In these instances, the contract validity therefore relies on agency principles. See id. at 1059.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 69 moved towards agency theory and attribution.98 Most notably, the United States Uniform Computer Information Transaction Act (UCITA) provided that individuals are bound by the “operations of the electronic agent” even if such individuals are not “aware of or [have not] reviewed the agent’s operations or the results of the operations.”99 Under this theory, human agents provide a general assent to electronic agents even if human agents are not aware of the details of each transaction.100 This approach is also reflected in the Electronic Signature in Global and National Commerce Act (E-Sign Act), which provided that contracts formed as a result of electronic agents may not be denied legal effect so long as “the action of [the] electronic agent is legally attributable to the person to be bound.”101 B. Unilateral Contracts A key feature of smart contracts is that parties do not exchange promises.102 The promises are in the form of offers that cross each other.103 In these types of contracts, one party puts a contract in the form of codes (smart) on a platform such as Ethereum.104 The smart contract therefore contains a set of unilaterally stipulated codes (conditions) that allow for the transfer of a digital asset or e-currency if those conditions are met.105 Pursuant to this approach, smart contracts are “interrelated unilateral contracts,”106 by which each party presents its side of the bargain unilaterally. Under this approach, performance of the conditions presented by the 98.See id. at 1059–65; see also SMART CONTRACTS, supra note 88, at 17. 99.UNIF. COMPUT. INFO. TRANSACTIONS ACT § 107(d) (UNIF. L. COMM’N 1999). 100.Bellia, Jr., supra note 34, at 1059–65. 101.Electronic Signature in Global and National Commerce Act § 101(h), 15 U.S.C. § 7001(h). Agency theory however has its own critics. For example, electronic agents do not have human judgments and intentionality and cannot hold fiduciary duties towards their principal. Werbach & Cornell, supra note 18, at 341; see also Bellia, Jr., supra note 34, at 1065; SAMIR CHOPRA & LAURENCE F. WHITE, A LEGAL THEORY FOR AUTONOMOUS ARTIFICIAL AGENTS 55–61 (2011). 102.Raskin, supra note 18, at 323. 103.Bellia, Jr., supra note 34, at 1058. In these instances, the contract validity therefore relies on agency principles. See id. at 1059. 104.Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena & Aquinas Hobor, Making Smart Contracts Smarter, CCS ’16: PROC. OF THE 2016 ACM SIGSAC CONF. ON COMPUT. & COMMC’NS SEC., Oct. 2016, at 254 (“Recently, Ethereum’s smart contract system has seen steady adoption, supporting tens of thousands of contracts, holding millions [of] dollars worth of virtual coins.”); Rodrigues, supra note 19, at 698 (“The Ethereum blockchain permits the central recording not just of an exchange, but of contractual conditions and limits on the circumstances under which an exchange can occur.”). 105.Werbach & Cornell, supra note 18, at 343. 106.Id.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 70 WASHINGTON LAW REVIEW [Vol. 96:51 smart contract is key for the analysis of the contractual nature of the transaction. In a unilateral contract, the offeree can only accept the offer by performance rather than exchanging promises.107 The classic illustration of a unilateral contract is where the offeror states “I will give you $100 if you walk across the Brooklyn bridge.”108 In these types of contracts, contractual liability exists upon performance without the need for exchange or return of promise. This feature has been the reason for judges adopting the unilateral contracts framework in instances where a promise given goes unreciprocated. For example, one study shows that judges have used the concept of unilateral contracts and found “promissory liability” of the employer in the context of employee benefits “without the necessity of finding a return promise by the employee.”109 The same analysis applies to the blockchain technology where initiators of smart contracts offer certain digital assets or crypto-currency if offerees perform by, for example, solving complex mathematical problems.110 Smart contracts therefore create a digital escrow where funds can only be released if certain conditions (performance) are satisfied by the offeree.111 C. Agreement to Agree Another theory of smart contracts rests on the notion that such contracts are agreements to agree. Smart contracts therefore simply invite further agreements and lack essential contractual terms. Although in most current 107.The Restatement (Second) of Contracts does not refer to unilateral contracts but discusses the topic in section 45, i.e., option contracts that are created by part performance or tender. See RESTATEMENT (SECOND) OF CONTRACTS § 45 (AM. L. INST. 1981). As one scholar stated, the drafters of the second restatement tried to purge the term “unilateral contract” but kept its legal device. Daniela Caruso, Then and Now: Mark Pettit’s Modern Unilateral Contracts in the 1980s and in the Age of Blockchains, 98 B.U. L. REV. 1789, 1790 (2018). The drafters’ skeptical view towards unilateral contracts originated from Professor Karl Llewellyn, who criticized the common law categorization of unilateral versus bilateral contracts. See generally K.N. Llewellyn, On Our Case-Law of Contract Offer and Acceptance, I, 48 YALE L.J. 1 (1938). A few decades later, however, Professor Mark Pettit showed that courts have consistently invoked the concept of unilateral contracts in their decisions including in the context of employee benefits. See generally Mark Pettit, Jr., Modern Unilateral Contracts, 63 B.U. L. REV. 551 (1983). 108.I. Maurice Wormser, The True Conception of Unilateral Contracts, 26 YALE L.J. 136, 136 (1916); see also Brackenbury v. Hodgkin, 102 A. 106, 107 (Me. 1917) (ruling that performance of the act accounts for acceptance and creates a binding contract). 109.Pettit, Jr., supra note 107, at 565; see also Caruso, supra note 107, at 1791. 110.Caruso, supra note 107, at 1793. 111.Werbach & Cornell, supra note 18, at 341–44. (“[T]he smart contract somewhat breaks down the traditional line between executory and executed contracts. Like the conveyance, there is no promise left to be performed. Unlike the conveyance, though, the smart contract does not transfer property at the time. It is neither executory, insofar as there is no action left to be performed, nor is it executed, insofar as the result is yet to be accomplished. This causes conceptual difficulty. Smart contracts are both committing to something in the future, but not exactly making a promise.”).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 71 forms of smart contracts important terms are specified due to simplicity (for example, if mining is completed first, the miner receives Bitcoin), this theory may be applied to more complex smart contracts. Under this approach, again, reliance is key and mutual assent is not necessary.112 The agreement to agree, or precontractual agreement, lies in the grey area of “full-blown contracts” and “no obligation.”113 More importantly, this framework can work well for smart contracting where each side puts forward its own set of conditions and, as discussed, parties dispatch cross offers.114 Under this view, the inherent incompleteness of smart contracting stems from the fact that each party attaches different meanings to the obligations.115 The discord over the meanings and scope of the obligations, however, does not negate liability.116 In other words, liability should always arise from unilateral promises, but not necessarily from consensus and agreement.117 The negotiations between parties fall into three categories. First, parties simply have engaged in preliminary negotiations.118 “Second, the parties have agreed on all material terms and intend to memorialize this agreement in a formal document.”119 Third, parties have negotiated and “agreed on certain terms but left some terms open.”120 In the first category, the party who did not benefit from the negotiations cannot recover any damages.121 In the second category, the contract is binding “when the evidence supports a finding that the parties did not intend the 112.Ben-Shahar, supra note 74, at 1833 n.6 (arguing that promise (which does not require consent) rather than harm or benefit should be the basis of liability). 113.Id. at 1829. 114.Bellia, Jr., supra note 34, at 1057–58 (describing the problem of “crossing offers” in which parties may express assent with reference to the anticipated but unknown assent of the other). 115.Ben-Shahar, supra note 74, at 1830–31 (“In contrast to the mutual assent approach, the no-retraction principle developed here suggests that when two parties attach different, but equally plausible, meanings to their agreed-upon contractual obligation, the absence of consensus would not negate any liability. Instead, under the no-retraction principle, each party should have a right to enforce a contractual obligation according to the meaning intended by the other.” (emphasis in original)). 116.Id. at 1831. 117.Id. at 1834 (“[I]t is nonetheless the will of a party—a ‘promise’—that ignites liability. The obligation is voluntary and promise-based, yet decoupled: A contract can be two, potentially different, bargains, with each party ‘responsible’ for one.” (emphasis omitted)). 118.Alan Schwartz & Robert E. Scott, Precontractual Liability and Preliminary Agreements, 120 HARV. L. REV. 661, 664 (2007). 119.Id. 120.Id. 121.E. Allan Farnsworth, Precontractual Liability and Preliminary Agreements: Fair Dealing and Failed Negotiations, 87 COLUM. L. REV. 217, 221 (1987).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 72 WASHINGTON LAW REVIEW [Vol. 96:51 formalization of their agreement to be essential.”122 Under the third category, a prevailing rule is that parties should bargain in good faith over open terms, or else the refusing party will be responsible for the reliance expenditure.123 The third category most resembles smart contracts. Smart contracts can only envision a limited world with a limited set of automated conditions. Inevitably, all contingencies cannot be determined ex ante. In such digital environments, however, parties cannot negotiate in good faith for open terms. This is consistent with the criticism of some law and economics scholars who stated that good faith negotiations are “deficient,” and the law should only “protect the promisee’s reliance interest if [t]his promisor deviated from an agreed investment” without the requirement for good faith negotiations.124 Although courts have adopted a narrow approach to precontractual liability,125 this approach can also be helpful in understanding the nature of smart contracts. As mentioned, smart contracts are similar to a “pail of water on top of a door” that would inevitably and automatically drop once the door opens.126 This contract determines the main (automated) quid pro quo between parties. However, it leaves many contingencies out. What if the door does not open due to an external event or faulty codes?127 What if the code does not specify the contingency where multiple recipients complete the tasks simultaneously? Smart contracts can fit the definition of a pre-contract because codes have not determined many contingencies of an agreement. In case of a fall-out, the party who relies on the code should be awarded the reliance damages (and not expectation interest).128 122.Schwartz & Scott, supra note 118, at 664. 123.Id. at 664–65. 124.Id. at 667. 125.Id. at 672–73. (“In sum, the sample shows that courts consistently have denied recovery for precontractual reliance unless the parties, by agreeing on something significant, indicated their intention to be bound.”). 126.Werbach & Cornell, supra note 18, at 340. 127.One of the problems with blockchain is 51% attacks. It is a special type of collusion that occurs in a blockchain network if 51% of the users decide to take certain actions. Frankenfield, supra note 43. 128.Schwartz & Scott, supra note 118, at 704 (“This analysis should help courts for three significant reasons. First, it shows what must be settled for there to be an actionable preliminary agreement: the parties must agree on the type of project, such as a shopping center or a financing; on an imprecise but workable division of authority for investment behavior; and on the rough order in which their actions are to be taken. These three conditions are each necessary and together sufficient. Second, the analysis clarifies that a deviation from the agreed investment sequence is a breach. Third, it recognizes that the law has two related goals: to deter strategic behavior and to encourage investment. These goals are advanced by awarding the faithful party her verifiable reliance costs if the other has wrongfully delayed investment. There is no need to protect the promisee’s expectation, which would be difficult to do in any event for projects that never get past the preliminary stage.” (footnote omitted)).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 73 The agreement-to-agree framework can also be helpful. However, as mentioned, precontractual liability is contested. Moreover, smart contracts, which currently only contain basic transaction formulas, do not have many essential elements left open to be determined (e.g. price of a commodity). Third, the theory of precontractual reliance rests on the idea of avoiding underinvestment in reliance.129 Whether this reliance incentive may work in the digital world where computers conduct transactions is unclear. As such, the agreement-to-agree framework, even though very helpful, may not capture the entirety of smart contracts. As explained above, the existing contractual theories of smart contracts do not capture the nature of smart contracts nor do they fully explain their enforceability. Part III below argues for the reliance-based theory for smart contracts as the best theory to protect users. III. RELIANCE AS THE BASIS FOR SMART CONTRACTS Automation of contracts requires a new framework for analyzing contract law. The existing theories, as explained above, do not fully explain smart contracts. The prevailing bargain theory, which focuses on assent and mutuality, does not fully capture the intricacies of smart contracts and does not fully furnish a theory that can protect users. In this Part, the Article argues for reliance-based theory of smart contracts that aims to protect users’ reliance. In section A, it provides an overview of promissory estoppel as the chief theory of reliance in contract law. In section B, it argues for the reliance-based theory of smart contracts that protects users’ reliance. A. Reliance Theory Best Explains Smart Contracts Promissory estoppel is the reliance theory of promise enforcement. It is reflected in section 90 of the Restatement (Second) of Contracts. The consideration requirement under contract law dictates that only bargained-for promises form contracts.130 A promise is bargained for “if it is sought by the promisor in exchange for his promise and is given by the promisee in exchange for that promise.”131 Promises that are gratuitous and open-ended are not enforceable.132 129.Craswell, supra note 74, at 490–94; Katz, supra note 74, at 1267–77; Bebchuk & Ben-Shahar, supra note 74, at 423–29. 130.RESTATEMENT (SECOND) OF CONTRACTS § 71 (AM. L. INST. 1981). 131.Id. 132.Promissory estoppel originally was limited to non-bargain promises in donative settings. See Ricketts v. Scothorn, 77 N.W. 365 (Neb. 1898). Later courts expanded its scope to business
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 74 WASHINGTON LAW REVIEW [Vol. 96:51 Pursuant to the promissory estoppel doctrine, however, promises that induce action or forbearance from the promisee can result in liability if, among others, the promisee reasonably relies on the promise to their detriment.133 Under promissory estoppel, an equitable remedy, contracts are binding if “injustice can be avoided only by enforcement of the promise.”134 Promisee’s detrimental reliance renders the promise binding and enforceable. This doctrine has introduced a reliance-based tort-like liability into contract law.135 Scholars have debated the scope of promissory estoppel for many decades.136 Professor Jay Feinman summarized the debate by stressing on the distinction between enforcement promise or protection reliance as the two possible bases for promissory estoppel, while arguing for a third approach based on relational theory of contract law.137 What is clear is that promissory estoppel of section 90 of the Restatement (Second) of relationships. See Hoffman v. Red Owl Stores, Inc., 133 N.W.2d 267 (Wis. 1965); see also Randy E. Barnett & Mary E. Becker, Beyond Reliance: Promissory Estoppel, Contract Formalities, and Misrepresentations, 15 HOFSTRA L. REV. 443, 450 (1987). 133.RESTATEMENT (SECOND) OF CONTRACTS § 90 (AM. L. INST. 1981) (“A promise which the promisor should reasonably expect to induce action or forbearance on the part of the promisee or a third person and which does induce such action or forbearance is binding if injustice can be avoided only by enforcement of the promise. The remedy granted for breach may be limited as justice requires.”). 134.Id. 135.GILMORE, supra note 73, at 87–91 (arguing that contract and tort were artificially separate and that contract would ultimately evolve into a reliance-based tort); Randy E. Barnett, The Death of Reliance, 46 J. LEGAL EDUC. 518 (1996) (discussing the shift from consent-based to reliance-based approach in contract law); Charles L. Knapp, Reliance in the Revised Restatement: The Proliferation of Promissory Estoppel, 81 COLUM. L. REV. 52, 53 (1981) (“[T]he principle of section 90 . . . has become perhaps the most radical and expansive development of this century in the law of promissory liability.”); Sidney W. DeLong, The New Requirement of Enforcement Reliance in Commercial Promissory Estoppel: Section 90 as Catch-22, 1997 WIS. L. REV. 943, 949–50 (showing that section 90 promissory estoppel has been “virtually extinguished” from much of the commercial contracting). Law and economics scholars have debated whether the reliance-based approach of the promissory estoppels is consistent from efficiency and economics. See Eric A. Posner, Economic Analysis of Contract Law After Three Decades: Success or Failure?, 112 YALE L.J. 829 (2003). Some scholars also rejected the tort-like characterization of promissory estoppel by arguing that promissory estoppel doctrine is “merely [a] substitute doctrinal method[] for showing the assent required for an enforceable consensual exchange.” See Kostritsky, supra note 73, at 901–02; see also Juliet P. Kostritsky, The Rise and Fall of Promissory Estoppel or Is Promissory Estoppel Really as Unsuccessful as Scholars Say It Is: A New Look at the Data, 37 WAKE FOREST L. REV. 531 (2002). 136.See, e.g., Kostritsky, supra note 73, at 964 (arguing that courts should use promissory estoppel “when persuasive barriers to, or explanations for dispensing with, explicit reciprocal or formalized contracts exist and a plausible benefit to the promisor can be identified”); Metzger & Phillips, supra note 73, at 863–64 (arguing that promissory estoppel is a tort-like and independent theory of recovery that is different from contractual liability); Feinman, supra note 73, at 303–11 (shedding light on the debate between enforcement of promise or the protection of reliance as the basis for promissory estoppel). 137.Feinman, supra note 73, at 303–11.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 75 Contracts made its way for courts to impose liability when the relationship is not contractual. As Professor Randy Barnett & Professor Mary Becker stated after analyzing the case law, “courts have . . . used promissory estoppel as a remedy for promissory or factual misrepresentation . . . on the basis of conventional tort or (possibly) contract doctrines.”138 Promissory estoppel protects reliance trust of promisees even if the bargain is deficient or lacking. This approach fits our increasingly automated contractual relationship as described below. B. Reliance Theory Can Help to Protect Users’ Reliance As stated above, promissory estoppel furnishes a competing basis for enforcement of non-bargained-for promises. This Article argues that smart contracts are enforceable because the offeree has detrimentally relied on the set of conditions presented.139 There is doubt that conditions coded as smart contracts constitute a “promise” as discussed in contract law generally (and promissory estoppel).140 Smart contracts resemble a “pail of water on top of a door” that would inevitably and automatically drop once the door opens.141 Smart contracts set in motion unalterable conditions that can only be completed.142 Despite such skepticism, the framework of promissory estoppel best fits smart contracting. On the one hand, the promisor should “reasonably expect”143 that the set of coded conditions are likely to induce actions (and even forbearance) within the platform. On the other hand, the promisee detrimentally relies on the codes (conditions) provided to attain the promised reward or return. Furthermore, the promissory estoppel approach has several advantages in framing smart contracts. First, the doctrine does not rely on mutuality of assent or exchange of promises. In fully-automated contracting with minimal human agent involvement, this doctrine can best explain the contractual nature of the transaction. Second, instead of the forward-looking feature of the bargain theory, it is backward-looking—aiming to remedy harms caused by reliance or misrepresentation.144 Third, the 138.Barnett & Becker, supra note 132, at 496. 139.Ricketts v. Scothorn, 77 N.W. 365 (Neb. 1898). 140.Werbach & Cornell, supra note 18, at 340. 141.Id. 142.See id. 143.The first element of promissory estoppel according to section 90 of the Restatement (Second) of Contracts is that the promisor “should reasonably expect” that the promise “induce action or forbearance on the part of the promisee.” RESTATEMENT (SECOND) OF CONTRACTS § 90(1) (AM. L. INST. 1981). 144.Markovits & Schwartz, supra note 6, at 802.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 76 WASHINGTON LAW REVIEW [Vol. 96:51 reliance-based approach is the “thinnest form of trust,” where trust is only limited to the statements of another, in this case codes.145 Fourth, the reliance by the computer may be considered reasonable since it triggers the transfer only if it sees a match with another computer.146 Fifth, the doctrine of promissory estoppel arguably provides limited avenues for damages.147 The party who relies on the promise can claim reliance losses (as opposed to often more expansive expectation damages).148 In the digital world, contractual breaches occur largely due to incomplete or poor coding, not forward-looking promises that trigger expectations. Hence, awarding reliance losses—often awarded in tort cases149—can be a more appropriate remedy.150 Moreover, due to automated and binary features of smart contracts, partial performances are rare. Equally, smart contracting present few opportunity costs that justify expectation damages.151 This view of smart contracts also avoids the problems legal scholars have faced with the issue of consent and assent in other new forms of contracting. In the last several years, consent has been the subject of 145.Id. at 801. 146.See, e.g., Craswell, supra note 74, at 491–95 (arguing that the offeree should be reasonable in its reliance on a promise to avoid inefficient reliance); see also Richard Craswell, Performance, Reliance, and One-Sided Information, 18 J. LEGAL STUD. 365, 365–66 (1989) (“The only remedy capable of optimizing both parties’ incentives (at least, the only remedy identified in the existing literature) is one that limits the promisee to recovering no more than the value that his expectation interest would have had if he had chosen the socially optimal level of reliance.” (emphasis omitted)). 147.Mary E. Becker, Promissory Estoppel Damages, 16 HOFSTRA L. REV. 131, 131–32 (1987). 148.See id. at 132–33. 149.See id. at 155–63. The mismatch between what the code is and what the code ought to be is most similar to misrepresentation in tort. Courts seem to have used promissory estoppel to afford tort remedy for misrepresentation. Put differently, courts awarded reliance damages in promissory estoppel cases, which most closely resemble non-intentional misrepresentation. See id. 150.Moreover, promissory estoppel in this context also does not have the problem of part-performance as in unilateral contracts. Under unilateral contract doctrine, part-performance can lead to irrevocability of offers. Arguably, the doctrine of part-performance cannot be reconciled with blockchain technology. For example, in the context of Bitcoin, many computers perform complex computational mechanisms in order to be the first to solve the problem and receive the reward (Bitcoin). RESTATEMENT (SECOND) OF CONTRACTS § 45 (AM. L. INST. 1981) (“Where an offer invites an offeree to accept by rendering a performance and does not invite a promissory acceptance, an option contract is created when the offeree tenders or begins the invited performance or tenders a beginning of it.”); see, e.g., Steiner v. Thexton, 226 P.3d 359 (Cal. 2010) (ruling that in the context of unilateral contracts when part of the consideration requested is rendered, the offeror is bound to a contract). 151.Opportunity costs refer to the loss of an opportunity for contracting parties to make alternative contracts. See Robert Cooter & Melvin Aron Eisenberg, Damages for Breach of Contract, 73 CALIF. L. REV. 1432 (1985). Opportunity damages award the non-breaching party the benefit that party would have enjoyed by signing an alternative contract. Id. Opportunity costs form part of expectation damages. Id.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 77 debates in legal scholarship.152 Even though contract law is premised on the notion of consent, the importance of finding consent is diminishing due increasingly to cyber contracts and boiler plates. Scholars have discussed that true consent in this new age is amorphous and can be obtained by manipulation.153 This approach can be traced in the Uniform Electronic Transaction Act154 that stipulates that a contract “may be formed” even if “no individual was aware of or reviewed the electronic agents’ actions.”155 This trend is notable in consumer contracts where the new draft restatement called for a “grand bargain” in which consent is exchanged for a more robust unconscionability doctrine.156 Recent behavioral law scholarship further shows that individuals have a formalistic view of contracts and often blame themselves for contractual harms even though they have not properly consented to the contractual terms and disclosures.157 Studies show that individuals find contracting a matter of formalizing an agreement rather than an assent.158 The historical data from the Harvard Case Law Access Project also shows a sharp decline in recent years on the reference to the notion of consent in case law.159 Against this background enters smart contracts and blockchain technology. The problem is more acute in blockchain technology where 152.See, e.g., Chunlin Leonhard, The Unbearable Lightness of Consent in Contract Law, 63 CASE W. RSRV. L. REV. 57 (2012) (arguing that consent can be obtained through manipulation). 153.See id. at 60 (“To begin with, consent is an amorphous, difficult-to-define concept that is made increasingly more difficult by the marketplace manipulations of human decision making biases.”). 154.UNIF. ELEC. TRANSACTIONS ACT § 14 (NAT’L CONF. OF COMM’RS ON UNIF. STATE L. 1999). 155.Id. 156.Gregory Klass, Empiricism and Privacy Policies in the Restatement of Consumer Contract Law, 36 YALE J. ON REGUL. 45, 57 (2019). By restructuring the relationship between consumers and companies, some argue that smart contracts can offer a solution to “mass-market consumer contracting” and increase the ability of consumer to negotiate their own contract terms. Joshua Fairfield, Smart Contract, Bitcoin Bots, and Consumer Protection, 71 WASH. & LEE L. REV. ONLINE 35, 42–43 (2014). 157.See, e.g., Tess Wilkinson-Ryan, A Psychological Account of Consent to Fine Print, 99 IOWA L. REV. 1745, 1758 (2014) (“[T]he cognitive psychology literature explain[s] why most people do not deliberate carefully over the fine print, and the moral psychology literature suggest[s] that most people view their contractual agreements as serious moral obligations.”). 158.Tess Wilkinson-Ryan & David A. Hoffman, The Common Sense of Contract Formation, 67 STAN. L. REV. 1269, 1300 (2015) (“The picture that emerges from the studies suggests that intuitions in this area are actually quite nuanced. Most people have a sense that the law of contracts is one of formality. On the other hand, their own behavior appears quite sensitive to social and moral dimensions of promise and disappointment, such that they are reluctant to even revoke an offer, much less break a deal.”). 159.Historical Trends, HARV. L. SCH.: CASELAW ACCESS PROJECT, https://case.law/trends/ [https://perma.cc/EY5L-S6K2] (To view this data: go to the URL; delete any words in the search bar; type the word “consent”; and view the chart, which shows the historical use of the word consent in court cases from 1800 until 2018).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 78 WASHINGTON LAW REVIEW [Vol. 96:51 automation, anonymity, and synchronous transactions further isolate the notion of consent. The legal analysis of smart contracts, therefore, cannot be based on the notion of consent and mutual assent. As suggested above, it is the reliance on the technology of blockchain and codes that should lead the way for the legal analysis of smart contracts. As the recent hacks of blockchain show, it is the broken codes (or incomplete codes) that will be at the epicenter of contractual breach.160 The problem of mismatched codes—between what codes say they would do and what they actually do—is present in the context of initial coin offerings.161 Some of the intentional instances of mismatch is fraudulent.162 Most instances, however, are codes that are insufficient or can be manipulated.163 With the exception of contract-as-reliance, all major contract theories require mutuality and bargain. The bargain theory requires intention or mutuality. The reliance theory, which is based on section 90 of the Restatement (Second) of Contracts on promissory estoppel, does not require a full quid-pro-quo bargain.164 It is aimed to protect reasonable reliance in the absence of a bargained-for exchange.165 Under this approach, the focus of contract enforceability shifts from manifestation or assent and consideration to promisee’s reliance and would create a distinct type of liability.166 In smart contracts, however, the manifestation of human intention occurs solely at the outset of entering the platform while human involvement, let alone mutuality of assent, is absent from each transaction. The socio-economics approach to contracting also requires an exchange of promises or societal norms. Neither of these elements can be found in an automated digital world.167 Smart contracts resemble the 160.Reza M. Parizi, Ali Dehghantanha, Kim-Kwang Raymond Choo & Amritraj Singh, Empirical Vulnerability Analysis of Automated Smart Contracts Security Testing on Blockchains, CASCON ’18: PROC. OF THE 28TH ANN. INT’L CONF. ON COMPUT. SCI. & SOFTWARE ENG’G, Oct. 2018, at 103. 161.Cohney et al., supra note 20, at 598–99 (showing empirically that CO code and ICO disclosures often do not match). 162.Id. at 595–97. 163.Parizi et al., supra note 160. 164.For the discussion of promissory estoppel, see supra section III.A. 165.Feinman, supra note 73, at 303–11 (shedding light on the debate between enforcement of promise or the protection of reliance as the basis for promissory estoppel); Farnsworth, supra note 121, at 677; Barnett & Becker, supra note 132, at 445–46; Michael I. Swygert & Donald W. Smucker, Promissory Estoppel in Florida: Growing Recognition of Promissory Obligation, 16 STETSON L. REV. 1 (1986); James Gordley, Enforcing Promises, 82 CALIF. L. REV. 547, 548 (1995). 166.Hoffman v. Red Owl Stores, Inc., 133 N.W.2d 267, 275 (Wis. 1965) (“We deem it would be a mistake to regard an action grounded on promissory estoppel as the equivalent of a breach of contract action.”). 167.In law and economics, for example, contracts are enforceable since parties are better off ex
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 79 “truly discrete” exchange transaction hypothetical that Professor Macneil put forward in 1977.168 Such a transaction would be separated from all present, past, and future relations, and occur between “total strangers, brought together by chance (not by any common social structure)” while each party “would have to be completely sure of never again seeing or having anything else to do with the other.”169 As explained above, therefore, a reliance-based approach can be a better fit for framing smart contracting. This view is also relevant for resolution of smart contract disputes. The consent theory leads parties to decipher and find programmer’s elusive intent. My approach, however, is to place the emphasis on the collective reliance of all users. As a result, the best contractual dispute mechanism would be collective wisdom of the users, as I explain below in Part IV. But first it is important to understand the foundational problems with smart contracts from a contract law perspective before understanding the best dispute resolution mechanism. The following Part addresses two main problems with smart contracts. IV. TWO PROBLEMS OF SMART CONTRACTS Despite the name, smart contracts are not smart in every aspect. Some main issues include the perpetual incompleteness—a problem shared with the traditional form of contracts—and the lack of entry point for legal resolution. This Part identifies readily available solutions to enhance smart contracts, such as finding the collective users’ reliance, creating a common fund to provide compensation, and adopting a hybrid contract approach. A. Smart Contracts Are Incomplete Almost all contracts are incomplete.170 Contracts are incomplete at least for two reasons: parties fail to specify all future contingencies or the ante as a result of an exchange of promises. ERIC A. POSNER, CONTRACT LAW AND THEORY 27–28 (2d ed. 2016) (“The conventional, utilitarian or welfarist explanation for why courts should normally enforce contracts is that if the parties are rational and fully informed, the contract will make both parties better off (ex ante) without making third parties worse off. . . . [F]or example, a contract in which Seller sells an apple to Buyer in return for $1. Buyer prefers the apple to $1 and Seller prefers $1 to the apple; no third party is affected by this transaction.”). 168.Macneil, supra note 76, at 856 (emphasis omitted). 169.Id. This hypothetical cannot always apply to the blockchain technology because in retail, parties know other parties well. They simply automate the enforcement of their transaction by using smart contracts. 170.See generally Ian Ayres & Robert Gertner, Filling Gaps in Incomplete Contracts: An Economic Theory of Default Rules, 99 YALE L.J. 87 (1989) (explaining that contracts are incomplete when parties fail to specify parties’ duties or are insensitive in the face of future constituencies).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 80 WASHINGTON LAW REVIEW [Vol. 96:51 contract is “insensitive to relevant future contingencies.”171 Smart contracts, similar to all other contracts, are destined to be incomplete.172 This was proven in the 2016 hack of a firm that used smart contracts to create a decentralized organization. The DAO—or decentralized autonomous organization—was a crowdfunding platform on blockchain that used Ethereum.173 Using the code of the smart contract for the platform, the hacker managed to transfer ether cryptocurrency to a “child DAO” that had a similar structure as the main DAO.174 The term hacking may not be accurate; the hacker in fact applied the terms of the smart contract in a way that allowed the hacker to transfer funds elsewhere.175 The hacker later wrote a letter arguing that the transfer of funds was legal since smart contracts are their own arbiters and no outside authority can change the rules of the transactions.176 The attacker may have been right. Smart contracts are supposed to be immutable and account for all contingencies. In the same vein, some have argued that smart contracts are new forms of self-help “because no recourse to a court is needed for the machine to execute the agreement.”177 Following the attack, several users suggested splitting the DAO but could not get the votes. It was the attacker who appeared to voluntarily stop after hearing of the split proposal.178 The incompleteness in smart contracts, however, can be different. 171.Id. at 92 n.29 (“There are two distinct ways for a contract to be incomplete. First, a contract may fail to specify the parties’ duties for specific future contingencies. For example, a contract for the construction of a third floor to a house may not state the parties’ respective rights and responsibilities should the entire house burn down before construction is started. Since construction of a third floor is impossible (without the lower two floors), the contract does not cover the contingency of the house burning down. The second form of contractual incompleteness is more subtle. A contract may also be incomplete in that it is insensitive to relevant future contingencies. . . . For example, consider a contract that simply obligates one party to construct a garage adjacent to a house. On the face this contract imposes a duty to build a garage whether or not the adjacent house burns down before construction of the garage is complete. The contract is incomplete in this second sense, however, because the duty to build a garage is not sufficiently dependent on future contingencies. If the adjacent house burns down, the parties probably would want to adjust the terms of contract. Such contracts we call insufficiently state-contingent.”). 172.Grimmelmann, supra note 19, at 3 (arguing that smart contracts do not eliminate ambiguity). 173.See generally Nathan Reiff, Decentralized Autonomous Organization (DAO), INVESTOPEDIA (June 25, 2019), https://www.investopedia.com/tech/what-dao/ [https://perma.cc/W2KJ-Y8XH]. 174.Siegel, supra note 68. 175.Raskin, supra note 18, at 336–37. The DAO terms and conditions stated that DAO’s code superseded all explanations, guarantees, and statements. Therefore, the DAO code was controlling (code is the entire contract). However, despite this explicit language, the code cannot be the entire contract in the DAO and possibly all smart contracts. Kolber, supra note 20, at 217–24. 176.Siegel, supra note 68. 177.Raskin, supra note 18, at 333. 178.Siegel, supra note 68.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 81 Generally, there are three layers of contractual agreements in a transaction involving smart contracts. One is the code of the smart contract (if/then). The second is the code of the platform which determines the validation mechanism. The last layer concerns the terms and conditions that users subscribe to prior to using the platform. Scholars have shown that inconsistency often exists between these three layers.179 Moreover, the syntax used in coding (e.g., if/then) could be subject to controversy and “requires something outside the program itself” for it to have meaning.180 The incompleteness of smart contracts therefore largely arises out of broken codes and inconsistency of the aforementioned three layers. A recent case from the Singapore International Commercial Court, decided based on common law, further illuminates this issue.181 In this case, the defendant installed a software to ensure cryptocurrency trades occur at their market price.182 Due to an oversight in coding, however, seven trades of cryptocurrency occurred at 250 times the market exchange rate.183 The defendant, upon discovery of this issue, reversed the seven trades.184 The plaintiff who benefited from this software glitch sued for breach of contract.185 The terms and conditions of the software states that “once an order is filled” the transfer is “irreversible.”186 The court continued by stating that the intent of “the operator or controller of the machine” should be considered.187 In other words, “the mind of the programmer” at the time of drafting the code is most relevant in cases of software glitches.188 As a result, the court decided that the trades should not have been reversed and the reversal goes against the intent of the coder.189 This case is not directly about smart contracts but it 179.See Cohney et al., supra note 20 (showing empirically that CO code and ICO disclosures often do not match); Kolber, supra note 20, at 220. To further explain, one can analogize it with apps in smart phones. One layer is computer codes underlying the app. Another layer refers to the codes of the platform on which the app runs (e.g., Android). Another layer that can govern parties’ relationship is the terms & conditions users agree to prior to using the app. 180.Grimmelmann, supra note 19, at 11. The author further argues that “no computer program can determine its own semantics.” Id. 181.Anisha Franklin & Kimarie Cheang, How Are Contract and Trust Law Principles Applied in Cryptocurrency Disputes?, HFW LITIG. BRIEFING (Holman Fenwick Willan LLP, London, U.K.), July 2019, http://www.hfw.com/How-are-contract-and-trust-law-principles-applied-in-cryptocurrency-disputes-July-19 [https://perma.cc/SSV3-VGNC]. 182.See id. 183.Id. 184.Id. 185.Id. 186.Id. (emphasis omitted). 187.Id. (emphasis omitted). 188.Id. (emphasis omitted). 189.Id.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 82 WASHINGTON LAW REVIEW [Vol. 96:51 shows how the court had to navigate between the terms of the software and its underlying code to determine an incompleteness in the agreement. Another interesting aspect of the case lies in the argument put forward by the defendant. The defendant argued for unilateral mistake.190 The mistake was the software glitch which the plaintiff was aware of and benefitted from.191 The court, however, stated that at the time of the contract (transfer) there was no “human involvement” and consequently the doctrine of unliteral mistake did not apply here.192 B. Smart Contracts Do Not Allow Entry Points Smart contracts are incomplete because the underlying codes do not account for all errors. They are also ambiguous because the platform codes are subject to change and modification. The problem, however, is that smart contracts do not allow for any intervention to remedy the incompleteness or breach.193 In traditional contracting, parties can re-negotiate the terms of the agreement or a third party (e.g., a judge) determines the points of contention upon disagreement or change of circumstances. In smart contracting, there is no entry point for legal intervention because: (1) parties are anonymous, (2) codes forming smart contracts are immutable, and (3) no one can issue a “fiat” to change the code and the underlying platform.194 How can automated codes which no one controls undergo change or revision? Imagine A sets up a smart contract whereby B gets paid $1 if it rains on Thursday or else A will get paid $1. This process is automated with no human involvement. Now imagine that it hails on Thursday. Who is supposed to receive the $1?195 On a blockchain, the next block is added by the consensus mechanism. If consensus is reached that hail is similar to rain, B will receive $1. If not, A will receive $1. If there is disagreement, there is a possibility of split. No one can regulate this issue ex post if the code is not sufficient. This shows that blockchain technology does not allow for legal entry points.196 190.See id. 191.Id. 192.Id. 193.See Rodrigues, supra note 19, at 714–27. 194.Anna Gelpern, Abandoned at the Nexus of Contracts, CORP. L. JOTWELL (Jan. 29, 2019), https://corp.jotwell.com/abandoned-at-the-nexus-of-contracts/ [https://perma.cc/B4R3-CYJB] (reviewing Rodrigues, supra note 19). 195.This is not just a hypothetical. MetLife insurance developed a smart contract whereby as soon as a patient uploads a positive diabetes test result, an insurance payment is made into the patient’s account. See Castillo, supra note 38. 196.Rodrigues, supra note 19, at 714–27.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 83 The solutions to this problem are not clear yet. One possible solution is to create a pool of funds by users. Under this proposal, each user gives some tokens (e.g., cryptocurrency) to a pool of funds in each of the transactions. The fund can then be used to compensate any contractual damages. For example, in the DAO attack, the fund could be used to compensate those who lost cryptocurrency as a result of the attack. The users can decide on a solution and transfer the necessary amount from the fund to those users who have been affected by the breach. Another solution lies in hybrid contracts. Businesses increasingly intend to use blockchain technology.197 They primarily use “hybrid contracts,” which are smart contracts that use off-blockchain information and include it in the chain of blocks.198 Take Walmart for example. In response to an E. coli infection linked to romaine lettuce, Walmart launched a pilot blockchain platform to record the supply chain of lettuce.199 The information that is recorded on blockchain comes from farmers, warehouse keepers, truck drivers, and others. The hybrid architecture combines both on- and off-blockchain components, similar to the Walmart example. Therefore, “[s]ome of the clauses [of the contracts] are monitored/enforced off-blockchain, whereas others are enforced on-blockchain.”200 In short, hybrid blockchain and contracts allow for external information (external to the chains in the block) to be fed into the blockchain. Businesses do not simply let go of their control of the contracts. After all, contracts and their residual rights create governance.201 Under hybrid contracts, parties automate their obligations in whole or in part against a backdrop of a traditional contract. In these circumstances, parties may stipulate that the code embedded in smart contracts is part of their agreement.202 Under this approach, smart contracts form part of the 197.Castillo, supra note 38, at 4. 198.Carlos Molina-Jimenez, Ioannis Sfyrakis, Ellis Solaiman, Irene Ng, Meng Weng Wong, Alexis Chun & Jon Crowcroft, Implementation of Smart Contracts Using Hybrid Architectures with On- and Off-Blockchain Components, IEEE ’18: 8TH INT’L SYMP. ON CLOUD & SERV. COMPUTING, Nov. 2018, at 1, 3–8. New efforts are underway to improve the hybrid transactions involving on-blockchain and off-blockchain technology. See id. 199.See Michael Corkery & Nathaniel Popper, From Farm to Blockchain: Walmart Tracks Its Lettuce, N.Y. TIMES (Sept. 24, 2018), https://www.nytimes.com/2018/09/24/business/walmart-blockchain-lettuce.html [https://perma.cc/LZW7-46CB]. 200.Ellis Solaiman, Todd Wike & Ioannis Sfyrakis, Implementation and Evaluation of Smart Contracts Using a Hybrid On‐ and Off‐Blockchain Architecture, 33 CONCURRENCY & COMPUTATION: PRAC. & EXPERIENCE (SPECIAL ISSUE PAPER) e5811, e5813 (2020). 201.Oliver Hart, Incomplete Contracts and Control, 107 AM. ECON. REV. 1731 (2017). 202.FILIPPI & WRIGHT, supra note 41, at 80 (“[P]arties can draft master agreements written in traditional legal prose and can include provisions stipulating that the parties agree that smart contract code qualifies as valid writing.”).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 84 WASHINGTON LAW REVIEW [Vol. 96:51 agreement between parties. In the case of a disagreement concerning the smart contract, the traditional contract may prevail.203 This is because the traditional contract seems to be closer to the parties’ intent. Ricardian contract is a type of hybrid contract by which a parent document determines parties’ obligations before its performance through codes (smart contracts).204 In other words, a Ricardian contract is a traditional contract whereby parties agree to automate some of its provisions through smart contracts and blockchain technology. Hybrid contracts are another way of combatting the problem of entry points. Parties can always bring their disputes pursuant to the traditional contract portion of their agreement. However, the hybrid structure still relies on off-blockchain legal recourses to make smart contracts function. This limits smart contracts and makes the adjudicative process reliant on traditional contractual methods. For this reason, there is a need for an effective and truly decentralized dispute resolution. Part IV analyzes the current ongoing yet inchoate efforts for decentralized dispute resolution and offers a new way of doing so. V. TOWARDS TRULY DECENTRALIZED USER-BASED DISPUTE RESOLUTION New efforts are underway to create a built-in dispute resolution mechanism in smart contracts. Dispute resolution clauses are already common in traditional contracting. The majority of consumer and employment contracts include a dispute resolution clause stipulating that an arbitrator or a panel of arbitrators decides the dispute between parties.205 Similar to contracts, adjudication or dispute resolution also leads to solidarity as it brings “disputants into reciprocal recognition and into the shared perspective.”206 Such dispute resolution mechanisms, 203.Existing laws seem to be silent on this point. For example, Uniform Electronic Transaction Act provides that automated transactions are binding (§ 14) and render all electronic records admissible in trial (§ 13). UNIF. ELEC. TRANSACTIONS ACT (NAT’L CONF. OF COMM’RS ON UNIF. STATE L. 1999). However, it does not directly address the issue of hybrid contracts where contracts are in part automated and in part non-electronic as described above. 204.Ian Grigg, The Ricardian Contract, IEEE: PROC. OF THE FIRST INT’L WORKSHOP ON ELEC. CONTRACTING, 2004, at 25. 205.See Alexander J.S. Colvin, The Growing Use of Mandatory Arbitration, ECON. POL’Y INST. (Apr. 6, 2018), https://www.epi.org/publication/the-growing-use-of-mandatory-arbitration-access-to-the-courts-is-now-barred-for-more-than-60-million-american-workers/ [https://perma.cc/2YUE-ZGE9]. 206.Daniel Markovits, Arbitration’s Arbitrage: Social Solidarity at the Nexus of Adjudication and Contract, 59 DEPAUL L. REV. 431, 469 (2010). In Markovits’s view, adjudication and contract both result in solidarity with differences in “paths to recognition” between subjects:
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 85 which are built into the contract algorithm ex ante, aim to handle more complex disputes via a distributed system.207 Blockchain technology is benefitting from this common practice. There are several startups that specialize in blockchain dispute resolution, and each has its own unique solution to this problem. For example, OpenBazaar uses the multisig feature208 of Bitcoin and therefore requires at least three signatures (buyer, seller, and a moderator) for completion of each transaction.209 Mattereum tries to connect real property rights to smart contracts to create legally enforceable contracts.210 In doing so, Mattereum promises dispute resolution that is effective.211 Kleros operates on a decentralized network that randomly assigns disputes to a group of self-selected jurors.212 Aragon selects several anonymous arbitrators from its pool to determine the outcome of a dispute.213 Sagewise devised an Adjudicative solidarity employs an intensive, transformative process in order to draw disputants into reciprocal recognition and into the shared perspective that such recognition establishes, even when the disputants do not intend to engage one another in this way, and indeed to induce them to recognize each other against their initial intentions. Contractual solidarity, by contrast, must itself be directly intended by those who participate in the contract, even if they are motivated not by solidarity but rather by self-interest. Id. 207.See Federico Ast & Clément Lesaege, Kleros, A Decentralized Court System for the Internet (Abridged), MEDIUM (Sept. 18, 2017), https://medium.com/kleros/kleros-a-decentralized-court-system-for-the-internet-abridged-1e415c04604a [https://perma.cc/8SWR-557V]. 208.Multisig (multisignature) refers to requiring multiple keys to authorize a Bitcoin transaction. See What Is a Multisig Wallet?, BINANCE ACAD. (Oct. 21, 2020), https://academy.binance.com/en/ articles/what-is-a-multisig-wallet [https://perma.cc/SE46-ETUE]. 209.How Moderators and Dispute Resolution Work in OpenBazaar, OPENBAZAAR (Feb. 23, 2016), https://openbazaar.org/blog/how-moderators-and-dispute-resolution-work-in-openbazaar/ [https://perma.cc/E6CY-SSV3] (“Instead of just having one person control the bitcoins in a certain account (called addresses), you can have multiple people control the same bitcoins. However, they can only send those coins to another address if a certain number of people controlling the bitcoins agree. For example, you can have a 2-of-2 multisig address. This means that there are two people who control the address, and both of them must agree to a transaction before the bitcoins can be sent anywhere else. A 2-of-3 address means three people control the address, and two of them must agree before the funds can be spent. OpenBazaar uses 2-of-3 multisig addresses for transactions. When a buyer wants to purchase a listing, instead of sending the funds directly to the seller, he will send the funds to the multisig account. The three people who control this account are the buyer, the seller, and a trusted third party selected beforehand. We call these trusted third parties ‘moderators.’”). 210.See For Truth in Trade, MATTEREUM, https://mattereum.com [https://perma.cc/3YMW-XJYA]; see also Darcy W. E. Allen, Aaron M. Lane & Marta Poblet, The Governance of Blockchain Dispute Resolution, 25 HARV. NEGOT. L. REV. 75, 85–90 (2019); Vinay Gupta, The First Mattereum Briefing, MEDIUM (Dec. 15, 2017), https://medium.com/humanizing-the-singularity/the-first-mattereum-briefing-11a67c75d840 [https://perma.cc/D22U-4NT3]. 211.Id. 212.See About Kleros, KLEROS, https://kleros.io/about [https://perma.cc/2FBJ-GEKE]; Allen et al., supra note 210, at 91. 213.Tatu Kärki, Aragon Network Jurisdiction Part 1: Decentralized Court, ARAGON (July 18, 2017), https://aragon.org/blog/aragon-network-jurisdiction-part-1-decentralized-court-c8ab2a 675e82 [https://perma.cc/ZL6X-H59K].
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 86 WASHINGTON LAW REVIEW [Vol. 96:51 embedded layer into smart contracts, which enables a toolkit to resolve coding errors and security vulnerabilities along with features to amend contracts or resolve disputes.214 An academic article also suggests creating an “open-source platform ecosystem” for smart contract dispute resolution that preserves its anonymity and calls it “distributed jurisdiction.”215 The blockchain technology is nascent and so is dispute resolution premised on this technology. It is also evolving rapidly. Such nascent systems largely rely on a so-called “proof-of-stake model,” in which a select stakeholder resolves the disputes.216 After a dispute arises, a few users are selected to serve as jurors to decide the dispute. If such a mechanism is built into contracts, it is possible that more complex contracts that require judgment can be “smart.” For example, a smart contract code can state that if it rains on Sunday, $1 will be transferred from party A to B. If, however, it hails on Sunday, the question arises whether such transfer should be made. This incompleteness in the contract requires judgment and decision-making. The built-in dispute resolution mechanism enables judgments to be made in such events that are unaccounted for in the code. Unlike traditional dispute resolution mechanisms, the new efforts involve other users within the platform to exercise their judgments, not third parties outside of the platform. Due to the importance of judgment and decision-making, the future of smart contracts, arguably, depends on an effective blockchain-based dispute resolution.217 Based on the existing technology, this Article argues that blockchain-based dispute resolution can offer three important features capable of 214.See Jonathan Shieber, Sagewise Pitches a Service to Verify Claims and Arbitrate Disputes over Blockchain Transactions, TECHCRUNCH (Aug. 3, 2018, 12:51 PM), https://techcrunch.com/2018/08/03/sagewise-pitches-a-service-to-verify-claims-and-arbitrate-disputes-over-blockchain-transactions/ [https://perma.cc/LP4N-6FKG]; see also Allen et al., supra note 210, at 85. 215.Wulf A. Kaal & Craig Calcaterra, Crypto Transaction Dispute Resolution, 73 BUS. LAW. 109, 148 (2018). According to this piece, several limitations exist in the current dispute resolution efforts. First, the existing solutions do not assure “full anonymity.” Id. Second, random selection of arbitrators would fail since users would like to appoint the arbitrators with the “highest possible expertise.” Id. Third, the democratic selection of arbitrators along with a lack of subject-matter expertise would result in users’ lack of confidence. Id. Fourth, the current solutions do not necessarily allow for use of attorneys. Id. Fifth, the current solutions do not always allow users to use a different dispute resolution mechanism. Id. 216.See infra section IV.A. 217.The future effectiveness of the blockchain is also dependent on the reliability of Oracle-type blockchain platform for uncontroversial cases. See Benjamin Pirus, Oracle Blockchain Platform Helps Big Businesses Incorporate Blockchain, FORBES (July 22, 2019, 1:05 PM), https://www.forbes.com/sites/benjaminpirus/2019/07/22/oracle-blockchain-platform-helps-big-businesses-incorporate-blockchain/#2c7a9d55797b [https://perma.cc/5ATS-GTKM].
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 87 transforming contractual disputes, distinct from traditional dispute resolution: (1) a mechanism for consensus that may be based on a larger pool of arbitrators (or jurors), (2) dispute resolution that can be distributed and functions on a random basis (avoiding the repeat problems), and (3) enforcement that is independent from judicial systems. The inclusion of a dispute resolution mechanism can change the smart contract scene through the interjection of human interaction at the tail end of the process (i.e., resolution of the dispute). Moreover, this Article argues that instead of a handful of users that are selected to resolve disputes, blockchain technology has the ability to access a large pool of users who can be selected randomly to resolve disputes. In sum, the dispute resolution mechanism brings back the human connection ex post and helps with existing problems such as mandatory arbitration or repeat players through enabling a large anonymous group of users randomly selected to resolve controversies. A. Dispute Resolution Should Be Truly Decentralized Traditional dispute resolution often does not involve consensus. Typically, parties appoint an arbitrator or a panel of arbitrators (often three) to resolve their disputes outside of the judicial system.218 One of the main breakthroughs of blockchain technology, however, pertains to its consensus mechanism as explained above. Several consensus mechanisms exist in blockchain technology. Two of the most widely used are proof-of-work and proof-of-stake. Under the proof-of-work consensus mechanism, every node in the network can validate transactions. Nodes often compete to verify the transactions to receive a reward. This is the consensus mechanism for Bitcoin.219 The other most common consensus mechanism is proof-of-stake, in which the system chooses a node based on the tokens held by the node (its stake). For example, if a node holds ten tokens and the other node 100, the latter is more likely to be chosen to validate the next transaction and hence add the next block.220 The consensus mechanisms of the blockchain technology may vary.221 218.What We Do, AM. ARB. ASS’N, https://adr.org/Arbitration [https://perma.cc/2MYV-K4XN]. 219.MCQUINN & CASTRO, supra note 44, at 7–8; see also Andrew Tar, Proof-of-Work, Explained, COINTELEGRAPH (Jan. 17, 2018), https://cointelegraph.com/explained/proof-of-work-explained [https://perma.cc/CE8Y-ZFSW]. 220.See MCQUINN & CASTRO, supra note 44, at 7–8; Ameer Rosic, Proof of Work vs Proof of Stake: Basic Mining Guide, BLOCKGEEKS, https://blockgeeks.com/guides/proof-of-work-vs-proof-of-stake/ [https://perma.cc/U7XV-4PH3]. 221.For a more nuanced analysis of the different consensus mechanisms, see ARATI BALIGA, PERSISTENT, UNDERSTANDING BLOCKCHAIN CONSENSUS MODELS (2017),
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 88 WASHINGTON LAW REVIEW [Vol. 96:51 The relevant point here is that the blockchain technology enables a structure in which different nodes engage in the validation process. In other words, the network allows for more nodes to participate in the decision-making process. Underlying the idea to build a dispute resolution on blockchain is its capacity to reach a wider network of individuals. This capacity is essential for the consensus mechanisms described above as various nodes must participate in the network for the validation process. The current efforts related to blockchain-based dispute resolution focus again on expertise (and a proof-of-stake model) whereby the system selects a handful of individuals for dispute resolution.222 Regardless of current efforts, blockchain has the capability of transforming the dispute resolution mechanism. For example, in the blockchain technology, any node can be an arbitrator of a dispute. Decisions can also be made through voting.223 Imagine a dispute between a buyer and a seller in which each side proposes its own narrative. Each participant in the network can review the dispute and vote for either the buyer or the seller. The users are incentivized to conduct such review because either they would receive a token (e.g., cryptocurrency) or because they are stakeholders of the platform. This development alone, which is technologically feasible with blockchain,224 can transform dispute resolution (and law generally) if it receives wide acceptance. This trend can also go against the tendency towards centralization in the judiciary which has happened in the United States and elsewhere.225 B. Network-Based Dispute Resolution Can Solve Some Arbitration Problems for Small Claims The distributed and decentralized feature of the blockchain technology can help combat one of the principal problems of the current dispute resolution mechanism. Arbitration—as the leading method for dispute resolution—is believed to be elitist and involves only a handful of https://www.persistent.com/wp-content/uploads/2017/04/WP-Understanding-Blockchain-Consensus-Models.pdf [https://perma.cc/WHU4-JGLJ]. 222.See KLEROS, supra note 212; see also Allen et al., supra note 210, at 86. 223.A Startup has already put forward a system which is based on this model. Under the JUR model, any user can stake their token to verify the raised dispute and cast a vote. See Blockchain Technology Is Now Entering the Dispute Resolution Arena, NASDAQ (Aug. 7, 2018, 11:37 AM), https://www.nasdaq.com/article/blockchain-technology-is-now-entering-the-dispute-resolution-arena-cm1003487 [https://perma.cc/4FQA-4BGE]. 224.See id. 225.See, e.g., MICHAEL DICHIO, THE US SUPREME COURT AND THE CENTRALIZATION OF FEDERAL AUTHORITY 6 (2018) (“The judiciary’s tendency to centralize federal authority over time represents a crucial dimension in the construction of political authority.”).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 89 individuals over a wide range of cases.226 For example, in international arbitration, recent data suggests that only a handful of individuals in the network of professionals decide the majority of the disputes.227 The problems of repeat appointments and the repeat player effect commonly occur in arbitration. Under the current system (both in domestic and international arbitration), a small group of individuals are often selected to adjudicate disputes.228 In the same vein, studies show that those who utilize arbitration often (repeat players) have a significant advantage over others.229 Proponents of the system often claim that this phenomena is due to the need for expertise.230 This is not necessarily supported by existing data, which to the contrary shows that participants do not list expertise as their main reason to use arbitration and complain about the repeat players problem.231 The problem may be structural. Individuals often are channeled by their counsels and the arbitral institutions to appoint the same arbitrators. Moreover, the repeat players have a significant advantage due to their information and influence on the selection of arbitrators among others.232 The promise of blockchain-based dispute resolution rests on the notion that it is distributed, randomized, and anonymized. The distributed feature guarantees more participants in the decision-making process while randomization prevents concentration of decision-making in select nodes. This does not negate the possibility that over time users will “inevitably 226.See Susan D. Franck, The Legitimacy Crisis in Investment Treaty Arbitration: Privatizing Public International Law Through Inconsistent Decisions, 73 FORDHAM L. REV. 1521 (2005); Anthea Roberts, Clash of Paradigms: Actors and Analogies Shaping the Investment Treaty System, 107 AM. J. INT’L L. 45 (2013); David Hacking, Ethics, Elitism, Eligibility: A Response: What Happens if the Icelandic Arbitrator Falls Through the Ice?, 15 J. INT’L ARB. 73, 74–75 (1998); Diane A. Desierto, Rawlsian Fairness and International Arbitration, 36 U. PA. J. INT’L L. 939 (2015). 227.In investment arbitration one study reveals that the top twenty-five arbitrators, which only account for 4% of all arbitrators, are appointed in over a third of all arbitration cases. Malcolm Langford, Daniel Behn & Runar Hilleren Lie, The Revolving Door in International Investment Arbitration, 20 J. INT’L ECON. L. 301, 310 (2017). 228.Daphna Kapeliuk, The Repeat Appointment Factor: Exploring Decision Patterns of Elite Investment Arbitrators, 96 CORNELL L. REV. 47, 68–78 (2010). 229.Andrea Cann Chandrasekher & David Horton, Arbitration Nation: Data from Four Providers, 107 CALIF. L. REV. 1, 2 (2019). 230.See, e.g., Jan Paulsson, Ethics, Elitism, Eligibility, 14 J. INT’L ARB. 13, 19 (1997) (“Given the high stakes and great sensitives frequently involved in arbitration, there seems to be a good case for supporting the emergence and recognition of an elite corps of international arbitrators.”). 231.WHITE & CASE, 2018 INTERNATIONAL ARBITRATION SURVEY: THE EVOLUTION OF INTERNATIONAL ARBITRATION (2019), https://www.whitecase.com/sites/whitecase/files/files/ download/publications/qmul-international-arbitration-survey-2018-19.pdf [https://perma.cc/7L3D-NAK5]. 232.Alexander J.S. Colvin, An Empirical Study of Employment Arbitration: Case Outcomes and Processes, 8 J. EMPIRICAL LEGAL STUD. 1, 1 (2011).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 90 WASHINGTON LAW REVIEW [Vol. 96:51 demand the highest possible expertise of their judges and arbitrators.”233 Network-based dispute resolution simply promises that a wider network of individuals be available to disputants. Anonymization can also improve any biases that exist in current dispute resolution mechanisms. A simple graph can demonstrate the difference between the judiciary, extrajudicial dispute resolution mechanism, and a possible blockchain-based dispute resolution. The centralized network best resembles the judiciary system while the decentralized network shows the existing dispute resolution system, in which some nodes attract most of the connections. The third graph shows the possibility of a blockchain-based dispute resolution in which everyone could have easy and equal access to all the nodes. As explained above, this system can mitigate the problem of repeat appointments and repeat players. Figure 1: Three Types of Network Connectivity C. Smart Dispute Resolution Awards Are Enforceable Blockchain-based dispute resolution may also obviate the need for judicial enforcement. For the dispute resolution to be effective, smart contracts should be designed to allow for direct enforcement mechanisms. For this reason, some existing startups have come up with solutions such 233.Kaal & Calcaterra, supra note 215, at 161.
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 2021] SMART CONTRACTING 91 as freezing the smart contract,234 live contract,235 or Ricardian contracts.236 Although these efforts are still developing, they demonstrate a trend where contracts would include a built-in enforcement mechanism. The inclusion of an ex ante built-in enforcement mechanism shows another possible major breakthrough of the blockchain technology in dispute resolution. One of the breakthroughs in globalization was the wide ratification of the New York Convention where 159 countries accepted to recognize and enforce international arbitral awards issued elsewhere.237 The New York Convention allowed for limited reviewability by national courts prior to their recognition and enforcement of awards.238 Blockchain technology, on the other hand, is promising a self-enforcement mechanism which is built into smart contracts. This self-help feature of smart contracts239 can have unprecedented challenges. One of the main developments could be the elimination of the reviewability function of national courts for dispute resolutions outside of the judiciary. This development has already begun where courts rarely review arbitral awards.240 Courts can limit dispute resolution outside of 234.See, e.g., Sagewise, Leading Smart Contract Dispute Resolution Company, Raises $1.25 Million Seed Funding, Led by Wavemaker Genesis, BUS. WIRE (Aug. 7, 2018, 9:00 AM), https://www.businesswire.com/news/home/20180807005319/en/Sagewise-Leading-Smart-Contract-Dispute-Resolution-Company [https://perma.cc/2WM2-UBZB] (“The company’s SDK provides the tools and infrastructure needed for the effective handling of disputes at any stage in the development and execution of smart contracts, freezing contracts in place while they are being resolved.”). 235.The LTO platform creates an ad hoc private blockchain for each Live Contract. Such a blockchain is not intended as an immutable ledger but ensures all parties have an up-to-date countersigned history of events and shared states. . . . Live Contracts do not directly hold value but describe how two or more parties should interact. The intent is much closer to that of a traditional (paper) contract. LTO NETWORK, BLOCKCHAIN FOR DECENTRALIZED WORKFLOWS 3, https://lto.network/documents/LTO%20Network%20-%20Technical%20Paper.pdf [https://perma.cc/M9VT-U724]. 236.See MATTEREUM, supra note 210; see also Allen et al., supra note 210, at 85; Gupta, supra note 210. 237.Convention on the Recognition and Enforcement of Foreign Arbitral Awards art. V, June 10, 1958, 21 U.S.T. 2517, 330 U.N.T.S. 3; Status: Convention on the Recognition and Enforcement of Foreign Arbitral Awards (New York, 1958) (the “New York Convention”), UNCITRAL, https://uncitral.un.org/en/texts/arbitration/conventions/foreign_arbitral_awards/status2 [https://perma.cc/9HNL-HW3P]. 238.Convention on the Recognition and Enforcement of Foreign Arbitral Awards, supra note 237, at art. V. 239.Raskin, supra note 18, at 333. 240.See generally FARSHAD GHODOOSI, INTERNATIONAL DISPUTE RESOLUTION AND THE PUBLIC POLICY EXCEPTION (2018) (showing the impact of the notion of transnational public policy on enforceability of arbitral award); Farshad Ghodoosi, Fall of Last Safeguard in Global Dejudicialization: Protecting Public Interest in Business Disputes, 98 OR. L. REV. 99 (2020) (showing with empirical data the decreasing importance of public policy review in the context of international commercial arbitration).
Ghodoosi (Do Not Delete) 3/22/2021 11:45 AM 92 WASHINGTON LAW REVIEW [Vol. 96:51 the judiciary. With blockchain technology, it is much harder for the judiciary to know of the existence of disputes since even enforcement of awards do not need judicial help. CONCLUSION Contracts are increasingly becoming digitized. In parallel, businesses are rapidly adopting digital contracts. Such digital (smart) contracts operate as self-executing, self-enforcing, automated contracts in which parties involved are often anonymous. This trend is a departure from the traditional notion of contracts, whereby consent and forward-looking promises play a pivotal role in ex ante formation and ex post enforcement of contracts. The legal nature of smart contracts remains shrouded in ambiguity. For example, terms and conditions of the platform, the underlying platform codes, and smart contract codes may be conflicting when it comes to parties’ obligations and the binding nature of smart contracts.241 Moreover, the possibility of hacks or code failures always exist.242 Given the new developments, this Article suggests that smart contracts should be analyzed through the lens of reliance-based contracting (similar to promissory estoppel or tort-based misrepresentation). Moreover, the reliance-based approach solves some of the problems posed by the consent-based approach in digital contracting. Further, this Article analyzes the new efforts aimed at the resolution of disputes on the blockchain platform. It identifies key features of blockchain-based dispute resolution that have the capability of modifying contractual disputes and the very act of contracting. The Article argues that blockchain-based dispute resolution results in seismic changes such as decentralized decision-making, network-based dispute resolution, and extrajudicial enforcement of decisions. More importantly, human connection and recognition can only be found in the dispute phase of contracting. This marks a shift from traditional contractual solidarity to digital solidarity.243 241.Kolber, supra note 20, at 217–26. 242.See id. at 203–04. 243.Markovits, supra note 206, at 469.
CopyrightofWashingtonLawReviewisthepropertyofWashingtonLawReviewAssociationanditscontentmaynotbecopiedoremailedtomultiplesitesorpostedtoalistservwithoutthecopyrightholder’sexpresswrittenpermission.However,usersmayprint,download,oremailarticlesforindividualuse.
Alexander Savelyev CONTRACT LAW 2.0: «SMART» CONTRACTS AS THE BEGINNING OF THE END OF CLASSIC CONTRACT LAW BASIC RESEARCH PROGRAM WORKING PAPERS SERIES: LAW WP BRP 71/LAW/2016 This Working Paper is an output of a research project implemented at the National Research University Higher School of Economics (HSE). Any opinions or claims contained in this Working Paper do not necessarily reflect the views of HSE Electronic copy available at: https://ssrn.com/abstract=2885241
Alexander Savelyev1 CONTRACT LAW 2.0: «SMART» CONTRACTS AS THE BEGINNING OF THE END OF CLASSIC CONTRACT LAW The paper analyzes legal issues associated with application of existing contract law provisions to so-called Smart contracts, defined in the paper as “agreements existing in the form of software code implemented on the Blockchain platform, which ensures autonomy and self-executive nature of Smart contract terms based on predetermined set of factors”. The paper consists of several sections. In the first section, the paper outlines peculiarities of Blockchain technology as currently implemented in Bitcoin cryptocurrency and which forms the core of Smart contracts. In the second section, the main characteristic features of Smart contracts are described. Finally, the paper outlines key tensions between classic contract law and Smart contracts.. The conclusion section sets the core question for analysis of the perspectives of implementation of this technology by governments: “How to align the powers of the government with Blockchain if there is no central authority but only distributed technologies”. The author suggests two solutions, which are not optimal: 1) providing the state authorities with the status of a Superuser with extra powers and 2) relying on traditional remedies and enforcement practices, by pursuing specific individuals – parties to Smart contract – in offline mode. It is emphasized that those jurisdictions, which have the most Blockchain-friendly regulations will have competitive advantage in attraction of new innovative business models and companies willing to exploit them in a legal way. Key words: contract, obligation, Blockchain, Bitcoin, Smart contract. JEL classification Z 1 Ph.D., Associate professor and senior researcher of National Research University Higher School of Economics (Moscow, Russian Federation), Legal Attorney of IBM Russia; E-mail: [email protected] Electronic copy available at: https://ssrn.com/abstract=2885241
3 Day by day, however, the machines are gaining ground upon us; day by day we are becoming more subservient to them; more men are daily bound down as slaves to tend them, more men are daily devoting the energies of their whole lives to the development of mechanical life. The upshot is simply a question of time, but that the time will come when the machines will hold the real supremacy over the world and its inhabitants is what no person of a truly philosophic mind can for a moment question. Samuel Butler, 1863 The future is already here — it’s just not very evenly distributed. William Gibson, 1993 Introduction The beginning of the XXI century revealed multiple innovative technologies which produced substantial impact on the new data-driven economy, the most notable of which are: Cloud Computing, Big Data, Internet of Things, Augmented Reality and Blockchain. The latter technology, initially introduced as a technological backbone of cryptocurrency Bitcoin, started to have significance in its own. Governments and companies all over the world are puzzling over the possible implementation of Blockchain technologies in many areas of life, not associated with usage of cryptocurrency. One of most promising areas of implementation of Blockchain technology is using it for creating fully automated contracts – agreements, which are performed without human involvement. Such agreements in IT-environment are frequently called as “Smart” contracts. I. What is Blockchain? This is, possibly, the first question, which the person making a deep dive in “Smart” contracts set of issues faces. In order to answer it, one has to understand the origin of this technology which is inseparably linked with Bitcoin cryptocurrency, forming the core of its technological infrastructure. Bitcoin was developed by an unidentified programmer, or group of programmers, under the name of Satoshi Nakamoto, which is indicated as an author of White paper describing the Electronic copy available at: https://ssrn.com/abstract=2885241
4 basics of functioning of Bitcoin2. In the most general terms, Bitcoin can be described as a decentralized, open-source software based peer-to-peer electronic currency. The key features of Bitcoin can be summarized as follows: 1) Decentralized nature. Bitcoin does not have a centralized emission center or any trusted central authority: maintenance of the Bitcoin transactions is performed by a network of communicating nodes running special software. From a technical perspective, Bitcoin as a currency unit is nothing more than a computer file, created based on special algorithm processed on computing power belonging to the Bitcoin community members. Bitcoin protocol developers also don’t have control over Bitcoin-related transactions: since its code is distributed on the terms of MIT open source license, it is available for inspection for any interested person and modifications, which can become a standard only if accepted by the majority of the community. 2) Anonymous nature. One can use Bitcoin without any special registration or identification procedure. It is sufficient to install special wallet application to initiate transactions with Bitcoin. Each wallet consists of Bitcoin units, public key and private key. Private key is used for transfer of Bitcoin unit by its owner to another user’s wallet. Without knowledge of the private key, the transaction cannot be signed and Bitcoin unit cannot be spent3. Public key is used by other persons to send Bitcoin units to this wallet and is used by Bitcoin network for verification of transactions. Thus, Bitcoin is a pseudonymous currency, meaning that funds are not tied to real-world entities but rather to specialized addresses. Their owners are not explicitly identified, but all transactions on the Blockchain are public. 3) Mathematic algorithm as a basis of Bitcoin value. There is no specific intrinsic value in Bitcoin, similar to commodities with limited availability like gold, neither there is authority of the government like in fiat money behind it. However, it does not mean that Bitcoin does not have anything backing up its value. It is backed by mathematics, cryptography, and computer code. Bitcoin units are created during the process known as “mining”. Each person, who installed specialized software, may “mine” Bitcoin unit as a reward for solving a complex mathematical problem, associated with verification of transactions performed with Bitcoins. The complexity of such problems is growing together with the amount of transactions performed in Bitcoin network. In other words, emission of new Bitcoin is a result 2 Satoshi Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System. P. 3. < www.bitcoin.org> 3 From technical perspective, it is possible to state that ownership of Bitcoin unit amounts to knowledge of the private key. Electronic copy available at: https://ssrn.com/abstract=2885241
5 of performance of computing activities to the benefit of all the Bitcoin community. Overall number of Bitcoins is defined by the protocol and amounts to 21 million bitcoins. Since computational power is a valuable and limited resource, having intrinsic costs (e.g. for hardware involved and electricity), and Bitcoin has limited availability, which is ensured by mathematic algorithms, it is possible to claim that Bitcoin has some value behind it. 4) Absence of single administrator of transactions. It is a well-known fact that electronic money is subject to the risk of double-spending4. Unlike physical coins, electronic money like any computer data can be duplicated and thus be used more than once. Traditional electronic money systems prevent double-spending by having a centralized trusted administrator that follows established process for authorizing each transaction. The problem with this solution is that the fate of the entire money system depends on the company running administrative function, with every transaction having to go through them, just like a bank. Bitcoin resolves double-spending problem by using a peer-to-peer network and this is where Blockchain technology plays the key role. All the transactions ever performed with all Bitcoin units are included in publicly available database. Information about new transaction with Bitcoin is distributed through the network, is verified by miners and then is fixed with indication of the time it was made (timestamp) and unique number of Bitcoin unit. Thus, it is possible to trace all the history of transactions with each particular Bitcoin unit in the database of all the transactions with Bitcoin – Blockchain. 5) Resilience to data manipulations from outside. Cryptography used in the process of creating records on Bitcoin-related transactions in Blockchain database prevents tampering with the content of such records ensuring their perpetual nature. Whenever two people exchange Bitcoin units, an encrypted record of the transaction is sent out to all other nodes in the Bitcoin network. The other nodes verify the transaction by performing complex cryptographic calculations on the data in the record («mining»), and notify one another each time a new “block” of transactions is confirmed as legitimate. When a majority of the nodes agree that a block passes review, they all add it to the Blockchain database and use the updated version as a cryptographic basis for encrypting and verifying future transactions. Each block is guaranteed to come after the previous block chronologically because the previous block’s hash would otherwise not be known. Each block is also 4 See, e.g. Schneider G 2008, Electronic Commerce. 8th ed, Cengage Learning, P. 522 ff. Electronic copy available at: https://ssrn.com/abstract=2885241
6 computationally impractical to modify once it has been in the chain for a while because every block after it would also have to be regenerated. Thus, it is not possible to rewrite information about certain transaction once it is included in Blockchain: such information will be rejected by the network, unless the intruder possesses more than 50% of the overall computational power of the Bitcoin network5. As a result all the members of Bitcoin community have a single version of “truth”, which is irreversible. Each participant to the transaction has a copy of the Blockchain database and it is synchronized with each other by using specialized algorithm. All this creates an unprecedented level of trust between the users of Bitcoin, where Blockchain is the core element facilitating such trust. Most of the features of Bitcoin cryptocurrency are facilitated by Blockchain technology. However, potential of this technology goes far beyond facilitation of decentralized electronic payments. To name a few examples from other spheres, there are existing prototypes of solutions, built on Blockchain technology facilitating electronic voting in the sphere of corporate governance. Russian national payment depositary created a distributed database of votes, protected by cryptographic measures. Copies of such database are stored by all the shareholders and, as developers claim, cannot be falsified; regulators or auditors may receive all the necessary information for performance of supervision function simply by connecting to the database6. There are potential applications for Blockchain technology within the real estate industry. Once information on the title to the real estate is in the Blockchain, the owner can transfer property without any further interaction with the registry. Moving forward, each new transfer of property would build-out the chain of title on the Blockchain. Blockchain-based land registration system (in conjunction with associated business process changes) has the potential to decrease insurance premiums7. Finally, Blockchain may be used for creating a new contracting environment, where the contracts are performed or even both concluded and performed automatically, without human involvement or at least with substantially minimized involvement. Based on above Blockchain can be defined a decentralized distributed database of all verified transactions that take place across the P2P-network system operating on cryptographic algorithms. It’s value can be characterized by the following two core enablers: 1) it allows to transfer digital asset (or virtual representation of physical offline asset) in a way that 2) 5 Swanson T, 2014, Great Chain of Numbers, P. 18. < https://goo.gl/lBDVE5> 6 CNews, April 29, 2016, NSD Tested a Blockchain-Based E-Proxy Voting Prototype, <https://www.nsd.ru/en/press/pubs/index.php?id36=629089> 7 Spielman A 2016, Blockchain: Digitally Rebuilding the Real Estate Industry, <http://dci.mit.edu/assets/papers/spielman_thesis.pdf > Electronic copy available at: https://ssrn.com/abstract=2885241
7 facilitates disintermediation of the economy by allowing to maintain truthful records about the asset owners without involvement of a trusted intermediary (registrar, financial institution, notary, etc.). Blockchain ensures equal access to transparent and trustworthy information. Not surprising, that this potential is already recognized. According to World Economic Forum report, by 2027 around 10% of the world’s GDP will be concentrated in Blockchain based technologies8. Now it is time to switch to analysis of «Smart» contracts as one of the most promising implementation of Blockchain technology. II. Definition of «Smart» contract and its key features Contract law is one of the most dynamically developed area of law: it constantly evolves, addressing appearance of new business models and technologies. Based on the analysis of the evolution of the methods of contracting and the shape of freedom of contract principle, it is possible to argue that each type of society has its own predominant form of contracting9. Agrarian economics was mostly dominated by individually agreed contracts where the parties to the contract negotiated “at arms length” all its terms. Industrial society is dominated by more simplified form of contracting: standardized terms, which allowed mass-market contracting with minimized human involvement in its negotiation process and lower transaction costs. Information society will tend to go further by minimizing human involvement not only in defining the contractual terms but also in their enforcement. Besides, new types of agreements may be also concluded without direct human involvement, by electronic agents. “Smart” contracts are a good example of the development of contracting procedure in this direction. There is no universally agreed definition of “Smart” contract, what is not a surprise, both due to the very novel nature of this phenomena, and due to its complex technological basis. According to the most simple definition, Smart contract is an agreement whose execution is automated. According to Nick Szabo, one of the pioneers in analysis of automated self-enforced agreements, Smart contract is a computerized transaction algorithm, which performs the terms of the contract10. However, this definition may hardly catch the difference of “Smart” contracts from some already well-known contractual constructs implementing automated performance, e.g. vending machines. 8 ‘Deep Shift. Technology Tipping Points and Societal Impact’, World Economic Forum, Survey Report, 2015, p. 24. 9 Using the level of development of contract law as a litmus paper for assessing the degree of maturity of the society has a long tradition ascending to the famous statement by Henry Meine according to which civilization’s progress can be generally determined as a movement from “status to contract”. See: Maine H 1920, Ancient Law: Its Connection with the Early History of Society and its Relation to Modern Ideas, London, p. 151. 10 Szabo N 1994, Smart contracts in Essays on Smart Contracts, Commercial Controls and Security <http://szabo.best.vwh.net/smart.contracts.html > Electronic copy available at: https://ssrn.com/abstract=2885241
8 Vending machines are defined as self-contained automatic machines that dispense goods or provide services when coins are inserted or payment in other forms (e-cash, credit card) is made. Vending machines are programed with the certain rules that could be defined in a contract, and perform such rules. If there is no principle difference between vending machines and Smart contracts, then we will have to admit, that Smart contracts are almost as old as Roman law itself. The earliest known reference to a vending machine is in the work of Hero of Alexandria, a first-century AD Greek engineer, and mathematician. Hero Ctesibius (sometimes referred to as Heron) of Alexandria documented the first vending machine in the published journal entitled Pneumatika in 62 A.D. His machine accepted a coin and then dispensed holy water. When a-five-Drachma piece deposited in, it was exchanged for a small supply of holy water in Egyptian temples. The lever opened a valve which let some water flow out. The pan continued to tilt with the weight of the coin until it fell off, at which point a counterweight snapped the lever up and turned off the valve11. So, a contemporary vending machine is based on a piece of technology that’s nearly two thousand years old. Acknowledging the wide-known statement that there is nothing new under the sun, it is still necessary to analyze, whether there is something principally new in Smart contracts comparing to automated vending machine or not. The degree of novelty of Smart contracts and presence of certain special features in it becomes especially relevant if we turn to practices used in exchange markets, where so-called automated trading systems is widely used. For example in foreign exchange markets, trades are frequently executed not by the trader himself, but by a computer system based on a trading strategy implemented as a program run by the computer system. As of 2014, more than 75 percent of the stock shares traded on United States exchanges originate from automated trading system orders12. So, automated contracts per se are not something new: they are widely used in many spheres for a long period of time already. So what is so special with Smart contract then? For this it is worthy to refer to another definition of Smart contract provided by Gideon Greenspan: “A smart contract is a piece of code which is stored on an Blockchain, triggered by Blockchain transactions, and which reads and writes data in that Blockchain’s database13 ”. This definition is more concrete, as it makes an emphasis on the Blockchain technology as one of the core features of Smart contract. 11 Segrave K 1944 Vending Machines: An American Social History, McFarland and Company, Inc., Publishers, p. 3 12 Levine D 2013, ‘A day in the quiet life of a NYSE floor trader’,Fortune, 29 May, <http://fortune.com/2013/05/29/a-day-in-the-quiet-life-of-a-nyse-floor-trader/> 13 Greenspan G 2016 ‘Beware of the Impossible Smart Contract’, Blockchain news, 12 April, < http://www.the-blockchain.com/2016/04/12/beware-of-the-impossible-smart-contract> Electronic copy available at: https://ssrn.com/abstract=2885241
9 However, the question is: whether Blockchain has certain legal implications on contracting process, which would make it significant for characterization of Smart contract, or it is only a fashionable technology, representing interest mostly for IT-specialists. From the author’s point of view, Blockchain can be regarded as a “paradigm-shifter” in the sphere of contracting: it allows to automate the process of performance contractual process of both parties. Old-school vending machines automate performance only of one party, requiring at least some personal involvement on the other side (e.g. coin insertion or application of a banking card). When both parties’ performance can be fully automated it creates a new quality of the contract, even triggering a question, whether there is still a contract in a legal sense and not some other kind of phenomena. Another peculiarity of Blockchain-based contracts is that it allows not only to automate performance of a contract, but also a process of its conclusion: it can be concluded be electronic agents, employed by the parties. In some cases, a contracting party can be represented by the so-called Decentralized Autonomous Organization (DAO).14 This concept has not yet received universally-recognized definition. According to one of the positions, DAO is nothing more than a set of long lasting “Smart” contracts as opposed to a regular “Smart contract” having specific purposes and coming to an end once they are achived. The organizational theorist Arthur Stinchcombe once wrote that contracts are merely organizations in miniature, and by extension all organizations are just complexes of contracts. Firms are created using a series of contractual agreements, ranging from employment contracts and employee benefits, to deals with vendors and suppliers and obligations to its customers, to building leases and sales & purchases of equipment. Traditionally, these contractual obligations are quite costly because they need to be enforced externally by society in the form of a trusted legal system and through legal enforcement. Courts, lawyers, judges and investigators all form this system of contract enforcement. With a blockchain-based «Smart» contract, however, much of these costs are greatly reduced or eliminated. This promises to make blockchain-based organizations more efficient, cost-effective, and competitive compared to traditional firms in the marketplace. All the above illustrates that “Smart” contracts go far beyond the existing models of contracting process and represent a new paradigm of interaction in a cyberspace. To illustrate this thesis it is necessary to provide some examples of potential application of “Smart” contracts in real life. “Smart” contracts allow to create pools of resources and to allocate them according to agreed criteria, what can be especially relevant for crowdfunding activities or for insurance-type 14 Hayes A 2016, ‘Decentralized Autonomous Organizations: IoT Today’, Investopedia, February 29, <http://www.investopedia.com/articles/investing/022916/decentralized-autonomous-organizations-iot-today.asp> Electronic copy available at: https://ssrn.com/abstract=2885241
10 of contracts. To bring some examples, Smart contract may track the amount of funds submitted to the crowdfunding project, and once it exceeds the necessary total, such amount is transferred to beneficiary. Otherwise, funds are returned back to the donors. Another example. A group of farmers may agree to create a pool of resources as an insurance against the drought or flood or other natural disaster. Once such a disaster occurs, machine verifies it according to the specified procedure (e.g. by checking the weather or news in predesignated sources) and allocates resources. Needless to say, that Smart contract provides ultimate degree of transparency and auditability, mitigating the risks associated with intermediary’s decision-making process and “human factor” as well as with time delays. As an additional “bonus”, such payments occur seamlessly across the borders. But is it possible to claim that Smart contract is still a contract in a meaning attributed to it by contract law? It seems that this is one of the most controversial matters in Smart contracts. Some scholars argue, that Smart contracts are a form of self-help, because no recourse to a court is needed for the machine to execute the agreement15. Self-help can be understood as “legally permissible conduct that individuals undertake absent the compulsion of law and without the assistance of a government official in efforts to prevent or remedy a civil wrong”16. Such an approach, while having some merits, appears to be too simplistic, depriving Smart contract of deeper analysis within the framework of contract law and setting certain questions, worth of answering. According to the Russian law, a contract is an agreement between two or more parties, which establishes, amends or terminates civil-law legal relations between them (Article 420 of the Civil Code of the Russian Federation, hereinafter – “CCRF”). This definition is pretty similar to the one, commonly used in Europe (“A contract is an agreement which is intended to give rise to a binding legal relationship or to have some other legal effect. It is a bilateral or multilateral act”17). One of the thesis of this paper is that Smart contract can be regarded as a legally-binding agreement. First of all, it is used to govern relations associated with circulation of certain digital assets, thus intending to govern economic relations between the parties, what is a realm of civil law. Transfer of digital Blockchain-based asset from one person to another one is a typical 15 Raskin M 2016, The Law of Smart Contracts, p. 31, < http://ssrn.com/abstract=2842258> 16 Douglas I B et al. 1984, SPECIAL PROJECT: Self-Help: Extrajudicial Rights, Privileges and Remedies in Contemporary American Society, 37 Vand. L. Rev. 845, 850. Similar understanding of self-help is shared in Russian law. 17 II. – 1:101 (1) of the Draft of a Common Frame of Reference (DCFR). DCFR is an academic text, one of the functions of which is The function to sharpen awareness of the existence of a European private law and also (via the comparative notes that will appear in the full edition) to demonstrate the relatively small number of cases in which the different legal systems produce substantially different answers to common problems. The drafters of DCFR claim that “it may furnish the notion of a European private law with a new foundation which increases mutual understanding and promotes collective deliberation on private law in Europe”. See: Study Group on a European Civil Code 2009, Draft Common Frame of Reference, Outline Edition, Sellier, p. 7. Electronic copy available at: https://ssrn.com/abstract=2885241
11 subject matter of Smart contract and may qualify as a “legal effect”, being one of the constitutive elements of a contract. Secondly, although Smart contract’s performance is automated, it still requires the presence of the will of the party to it in order to become effective. Such will is manifested at the moment when an individual decides to enter into such an agreement on the terms specified in advance, or, in case with electronic agents, – when individual decides to use such an agent for conclusion of certain agreements and agrees to be bound by their actions. The person expresses its consent with the terms of the contract and mode of their execution at the moment of conclusion of the contract. Taking into account that such person won’t be able to influence the execution of the agreement, once it is entered to, there should be a certain trust in place, which gives rise to a kind of “fiduciary” relations in Smart contract. But in contrast to classic contract where trust is put in the personality of the other party to the contract, in Smart contracts such trust is put in the computer algorithm standing behind the agreement (“trustless trust”). It is also possible to find offer and acceptance in the process of Smart contract formation. If we take an example with crowdfunding Smart contract, its terms are predefined by the beneficiary (“offer”) and a person willing to donate to the project by transferring a certain asset to the pool is making an acceptance of that offer by its behavior. Under existing contract law provisions the contract is considered to be concluded in such a case (Article 438 (3) of the CCRF, II- 4:204 DCFR) and may be qualified as a contract of adhesion (Article 428 of the CCRF) or more broadly – a contract concluded on standard terms (Section II – I: 109 DCFR). Whether or not there is an intent to create legal relations by the party’s to the “Smart” contract is a tricky question: it is possible to argue that by entering into a “Smart” contract they have an intention to use alternative regulatory system, not a classic contract law, thus there is no true intent to create legal relations. However, if the result is in fact the same in substance to the one, usually regulated by usual contracts – transfer of ownership over certain asset- then it may be argued that the nature of the relations in the core of it are also the same. Besides, “Smart” contracts don’t fall into a class of agreements, where legal contracts are not normally made (e.g. social invitations like invitation to dinner or family arrangements (e.g. a promise to wash the dishes). Finally, the mere fact that the contract is concluded by electronic means does not mean that it is not a contract. The same is true for the contract that exists solely in cyberspace. Now it is necessary to outline the features of Smart contracts, which could be used for finding its place in the existing contractual concepts. Based on the current understanding of Smart contracts it is possible to enlist the following ones: 1) solely electronic nature; 2) software Electronic copy available at: https://ssrn.com/abstract=2885241
12 implementation; 3) increased certainty; 4) conditional nature; 5) self-enforcement; 6) self-sufficiency. Let’s take a closer look on each of them. 1. Solely electronic nature. Classic contracts may exist in various forms, e.g. in oral form or in writing. Of course, the development of e-commerce substantially increased the amount of agreements concluded in electronic forms, the most evident examples of which are various click-wrap agreements. However, even in case of e-commerce contracts, there may be still some classic paperwork required, e.g. invoices, receipts or certificates of delivery, especially when such electronic contracts are covering purchase of offline goods or services. Sometimes, those documents are the only evidence or manifestation of the contract existing in electronic form. In contrast to that, Smart contracts may exist only in electronic form, it is not possible to use any other form of the contract to them (e.g. oral or written hardcopy). It is also driven by the specifics of the subject matter of Smart contracts: it may relate to certain digital assets (e.g. cryptocurrency) or digital manifestations of offline assets, title to which is registered in Blockchain. This differs Smart contract from most click-wrap agreements, which also exist in electronic form, but only impose some negative obligations on the user (e.g., not to perform certain activities while using the service or not to object to certain activities performed by the service-provider). Execution of the terms of “Smart” contract should also be linked to certain electronic events/data. Otherwise, “Smart” contract won’t be self-enforceable (see below). All these features predefine solely electronic form of possible existence of Smart contact. Moreover, “Smart” contract by its nature requires using electronic digital signatures, based on encryption technology. Under the Russian law such signatures due to the presence of cryptography would qualify as “advanced non-qualified signature” and their usage is generally governed by the agreement of the parties using such a signature18. 2. Software-implemented. Code is law, and in Smart contracts computer code is also contractual terms. Thus, contractual terms are manifested in a computer code, what is not generally prohibited based on the “freedom of contract” principle. Therefore, it is possible to argue that each Smart contract by its legal nature is also a computer program in a meaning of IP law19. 18 Russian law also recognizes so-called “advanced qualified signature”, which is provided by the specialized center accredited by the government authority what attaches the highest legal force to a document signed with such signature and “simple electronic signature” which can be based on a wide range of technologies (sms-codes, passwords) and whose legal force is based on the prior agreement of the parties to use such type of signature in their relations. See: Federal’nyy zakon ot 06.04.2011 N 63-FZ “Ob elektronnoy podpisi” [Federal Law of the Russian Federation No. 63-FZ “On electronic signature” of 04/062011]. 19 Russian definition of computer program is quite similar to the U.S. one. According to Article 1262 of the CCRF, computer program is a set of statements and instructions, to be used by a computer in order to achieve a certain result. Under U.S. Copyright Act, computer program is a set of statements or instructions to be used directly or indirectly in a computer in order to bring about a certain result. Electronic copy available at: https://ssrn.com/abstract=2885241
13 Thus, Smart contract has dual nature in the law: it serves as a “document” governing contractual relations of the parties and it is also object of the IP rights, representing the valuable object of intellectual activity. Therefore, programming certain Smart contract based on the requirements of the customer can be treated as software development process, while distribution of subsequent rights to “Smart” contract should be performed within the license/assignment of IP rights framework. To bring an example of how “Smart” contract may look like from a factual perspective, here is an extract from a text of the Smart contract based on the Ethereum platform attached20. 3. Increased certainty. Since Smart contract is having software code in its core, its terms are expressed in one of computer languages, which are rather formal languages in their substance: with strictly defined semantics and syntax21. Computer language does not allow discretion in its interpretation by machine. Smart contract terms are interpreted by machine based on Boolean logic22, in contrast to classic contract, where interpretation of terms is performed by human brain based on subjective criteria and analogous way of thinking. Thus, the precision of programming languages is able to mitigate possible issues associated with unpredictable interpretation of contractual terms by the party to the contract or enforcement agency. Although ambiguity may exist in programming languages, these ambiguities are less than in the real world because there are simply fewer terms that a computer can recognize than a human can recognize. As a result of the described specifics of the Smart contract existing rules on interpretation of the contract do not apply to it: (“Interpretation according to the common intention of the parties event if it differs from the literal meaning of the words or in accordance with the meaning which a 20 Etherium Blockchain App Platform, ‘Create your own crypto-currency with ethereum’, https://www.ethereum.org/token 21 For example, Solidity – the language based on JavaScript – was created as language for Smart Contracts on Ethereum platform. 22 Boolean logic is a form of algebra in which all values are reduced to either TRUE or FALSE. Boolean logic is especially important for computer science because it fits nicely with the binary numbering system, in which each bit has a value of either 1 or 0. Electronic copy available at: https://ssrn.com/abstract=2885241
14 reasonable person would give to it”23). Smart contracts are meant to be stand-alone agreements – not subject to interpretation by outside entities or jurisdictions. The code itself is meant to be the ultimate arbiter of “the deal” it represents. However, a couple of important points need to be made. First of all, due to technical complexities of Smart contract architecture and necessity to possess advanced programming skills to create such an agreement. And in many cases they will be created by specialized companies based on the request from the client. Due to a separation between the person programing the code and the person intending to use it in its commercial activities, there is a risk of misunderstanding between them with regard to the terms of the future agreement. Ultimately, it is about the differences between implementation and intent, which is aggravated by the huge gap of abstraction between legal language and a programming language. However, it can be argued that such misinterpretations should be within the sphere of responsibility of the person implementing Smart contract and resolved within the existing contractual framework with its contractor. Such errors should not affect external parties, persons that are subsequently accepting the terms of such agreement and become a party to a Smart contract. Secondly, since it is only the computer code, which regulates the Smart contract, the latter becomes automatically subject to various flaws and bugs, which accompany any computer program. And recent hacking attack on one of the Ethereum’s Smart contract is an excellent example: in June 2016 attackers exploited a software vulnerability and draining drain millions of ether — with a theoretical value in the tens of millions of dollars. One wallet identified by community members as a recipient of the apparently stolen funds holds more than 3.5 million ether. At an exchange rate of about $14 a unit, that works out at $47 million24. In an open letter to Ethereum community the attacker claimed that he has not done anything illegal, he was only ‘making use of this explicitly coded feature as per the smart contract terms’25. Leaving the matters of qualification of attacker’s actions aside, it is possible to state that Smart contracts are still subject to human’s misjudgment and although they are potentially immune to mistakes in legal terminology and drafting, they are still vulnerable to coding errors, what, probably, needs to be addressed by the newly developed rules on interpretation of such contracts. 4. Conditional nature. Earlier it was argued that Smart contract is drafted on one of the computer languages. Conditional statements are foundational to computing: computer code is based on statements like “if “x” then “y”. Such an approach is in harmony with contractual terms and conditions. As Raskin correctly puts it, the enforcement of a contract is nothing more than 23 See: II. – 8:101 DCFR; Article 431 of the CCRF 24 Price R 2016 ‘Digital currency Ethereum is cratering because of a $50 million hack’, Business Insider, June 17, <goo.gl/SY90Ks> 25 Pastebin, 2016, ‘An Open Letter’, June 18, ,http://pastebin.com/CcGUBgDG> Electronic copy available at: https://ssrn.com/abstract=2885241
15 the running of a circumstance through a conditional statement26. Under the Russian law, such an agreement can be qualified either as “conditional transaction” (Article 157 of the CCRF) if all of the terms of the contract are conditioned on a certain event, or a contract with conditional obligation (Article 327.1 of the CCRF), where a contract as such becomes effective at the moment of its conclusion, but execution of some of its terms is conditioned to certain events. Similar provisions are provided in Section III. – I:106 DCFR. In this regard Smart contracts fall within the existing taxonomy of contract law. 5. Self-enforceability. Once Smart contract is concluded, its further execution is no longer dependent on the will of its parties or third party, neither it requires any additional approvals or actions from their side. Computer verifies all the conditions, transfers assets and makes entries in the Blockchain database about such transfers. Thus, Smart contract is technically binding for all the parties to it, they are no longer dependent on human intermediary, which is subject to errors and subjective discretion. Subsequent change of circumstances or intent of the party to it is irrelevant. There is no room for opportunistic behavior or “efficient breach”27. This feature of Smart contracts create substantial tensions with classic contract law, as will be shown later. 6. Self-sufficiency is closely related to the previous feature of Smart contract – its self-enforcing nature. However, self-sufficiency has a different emphasis. Smart contract does not need any legal institutions to exist: neither enforcement agencies, not the corpus of legal rules, default or mandatory ones to supplement it, like they do with regard to classic contracts in case of their incompleteness. As Russian prime-minister, Dmitry Medvedev stated in its speech on the perspectives of development of law, “Smart Contracts represent new challenge to legal regulation. Systems creating such contracts live by their own rules, beyond the boundaries of law”28. Self-sufficiency is especially important in transborder transactions, since it allows not to be dependent on differences in languages, national laws and their interpretation [including various types of geopolitical economic sanctions]: same rules are applicable all over the world. Based on the above features, it is possible to define Smart contract as a piece of software code, implemented on Blockchain platform, which ensures self-enforcing and autonomous nature of its terms triggered by conditions defined in advance and applied to Blockchain-titled assets. Among the benefits of Smart contracts it is possible to outline their ability to decrease a number transaction costs which accompany regular contracts, e.g. costs associated with ensuring performance of such contract (e.g. litigation costs or costs associated with provision of 26 Raskin M 2016, The Law of Smart Contracts, p. 11, < http://ssrn.com/abstract=2842258> 27 According to Black’s Law Dictionary, efficient breach theory is “the view that a party should be allowed to breach a contract and pay damages, if doing so would be more economically efficient than performing under the contract”. 28 Vystupleniye Dmitriya Medvedeva na plenarnom zasedanii [Speech of Dmitry Medvedev on Plenary Session], Saint-Petersburg International Legal Forum, 18 May 2016. Electronic copy available at: https://ssrn.com/abstract=2885241
16 collaterals). Besides, costs associated with involvement of the intermediary in the process performance of a contract (e.g. bank or insurance organization), are also excluded in Smart contracts due to their disintermediating nature. However, it would not be correct to make a conclusion that Smart contracts are cheaper, than regular ones: infrastructure necessary for implementation of Smart contracts and costs associated with the development (“drafting”) of terms of Smart contracts are still rather high. There are Smart contracts platforms already emerged, which gained popularity and recognition. The most evident example is Ethereum, which is a public Blockchain-based distributed computing platform, featuring smart contract functionality. It provides computing capacity (a decentralized virtual machine), that can execute peer-to-peer contracts using a cryptocurrency called “ether”. In contrast to Bitcoin ecosystem, which does not allow exchange of any other object than Bitcoin unit, Ethereum allows to facilitate exchange of virtually any class of assets, which is capable of transfer in Internet environment. Ethereum was initially proposed in late 2013 by Vitalik Buterin, a cryptocurrency researcher and programmer, having Russian origins. This platform is viewed as the most prominent basis for further development of Smart contracts. Today Ethereum is the second-longest and fastest-growing public blockchain (after Bitcoin). It even can be perceived as posing a threat to Uber-like business models29. Unlike, “Whereas most technologies tend to automate workers on the periphery doing menial tasks, blockchains automate away the center. Instead of putting the taxi driver out of a job, blockchain puts Uber out of a job and lets the taxi drivers work with the customer directly.30” Thus, there is no doubt that this platform will attract further investments and the amount of Smart contracts developed on it will increase. Besides, other similar platforms will appear. All this will definitely provoke further attention to the legal nature of the smart contracts and issues associated with the application of the classic contract law provisions to them. III. Smart contracts in the context of the present contract law: Issues and challenges. Smart contracts concept creates lots of concerns and challenges when one tries to apply classic concepts of contract law. Moreover, such challenges have universal nature, going to the core of contract law provisions, which are more or less the same regardless of the jurisdiction. The main problem lies in fact, that Smart contracts are created and are developing in a technical universe “parallel” to legal realm, without a backward glance to any legal considerations, like Internet in its early days. Therefore, computer is indifferent to the fundamental legal principles, 29 Uber removes the traditional middleman — in case with taxi, the taxi dispatcher — from the buyer/seller equation, allowing each driver to be his own boss and work independently of a central company, replacing it with a new type of middleman – computer application. 30 Tapscott D, Tapscott A 2016 Blockchain Revolution: How the Technology Behind Bitcoin Is Changing Money, Business, and the World, Penguin Publishing Group, Kindle Edition, p.18 Electronic copy available at: https://ssrn.com/abstract=2885241
17 such as lawfulness, fairness, protection of weak party. Instead the principles of certainty and effectiveness prevail. The fact that provisions of Smart contract are enforced solely by technical code leads to the following issues. 1. Smart contract does not create obligations in its legal meaning. The notion of obligation, which originates from Romal law and is a key to the Continental contract law is alien to Smart contract. Insitutes of Justinian contain a famous definition of an obligation (“obligatio” in Latin): “it is a bond created by law in accordance with the laws of our community. This bond we can be compelled to sever by the performance of some act, generally the transfer of some thing”31. An obligation is a right, but the term “right” denotes only one side of the relationship, which is embraced by roman term “obligatio”. To every right there must be a correlative duty: if A has a right that B shall give him an asset, B must be under a duty to give A the book. The term “obligation” denotes therefore, sometimes the right, sometimes the duty, but more properly it denotes the whole relationship32. These ideas survived the centuries and are reflected in a modern contract law. In accordance with the Russian law, “by virtue of an obligation one person (the debtor) has the duty to take for the benefit of another person (the creditor) a defined action, such as: to transfer property, to do work, to pay money, etc., or refrain from a defined action, and the creditor has the right to demand from the debtor the performance of his obligation (Article 307 of the CCRF). One of the key elements of obligation is its 1) orientation in the future and 2) “will” component. Since obligation is a legal bond between two persons, such bond exists to the extent that certain action or inaction has to be performed in the future33 and the debtor has a certain discretion to perform or not to perform it. If nothing depends on the will of the debtor then he is under no obligation to the creditor, since there can be no liability for breach of such an “obligation”, it is discharged on force majeure basis. In order to illustrate this thesis, it is possible to highlight the difference between Smart contracts and contracts with vending machines. In the latter case, although performance is automated, the seller – owner of the vending machine has the discretion regarding the performance of the contract: he may interfere in the process of functioning of such machine (e.g. by shutting it down) and thus, change the outcome of the deal. In Smart contract it is not possible for a party to it to change the outcome by shutting down its computer – all the transactions continue to exist and be processed in cyberspace. 31 “Obligatio est iuris vinculum, quo necessitate adstringimur alicuius solvendae rei secundum nostrae civitatis iura”. Inst. iii, 13, pr. 32 Nicholas B 1962 An Introduction to Roman Law, Oxford, p 158. 33 It is possible to state that essence of a notion of “obligation” in Continental contract law performs similar functions to the notion of “executory” contract in Anglo-American law. Electronic copy available at: https://ssrn.com/abstract=2885241
18 Absence of obligations understood in classic legal sense in Smart contracts leads to conclusion that all the legal regime associated with the notion of “obligations” is not applicable: mode of performance (place and time of performance, performance by third party, etc.), consequences of non-performance, etc. And this follows from the nature of Smart contract as well: once all the provisions are enforced by technical code, there is no necessity in provisions having a purpose to regulate human interactions. Does all of the above mean that the Smart contract is not a contract because it does not contain any obligations? Such a conclusion is still too simplistic for a number of reasons. First of all, the parties still express their will when enter into a contract and they are bound by the result of their action. Secondly, contract law acknowledges certain types of agreements, which are performed instantaneously at the moment of conclusion (“executed” contracts in Anglo-american law). Probably, it would be more correct to state that the main consequence of conclusion of Smart contract is not an appearance of “obligations” but the resulting self-limitation of certain rights by technical means. Smart contract does not give rise to legal bond between the parties. Even if there is some kind of “bond”, which all the parties to it share, it relates to technical bond of a party with Blockchain platform of Smart contract and such a bond is much more solid than a legal one. 2. Smart contract cannot be breached by a party to it. This follows from its self-enforceability feature and a logical consequence of its “code is law” nature. A party to it cannot breach a contract if circumstances have changed and more profitable alternative to its performance appeared. It is Roman law “pacta sunt servanda” (Latin for “agreements must be kept”) in its absolute form. As a result, all established remedies for breach of contract, e.g. damages, penalties (liquidated damages), specific performance are not relevant for Smart contracts, unless they are explicitly included in its code. There is also no need in specific legal instruments, having a purpose to secure an obligation (collaterals). In other words, all remedies and guarantees, which the creditor has in analogue world, do not have any role to play in a digital realm of Smart contracts. There is no need to seek for enforcement of Smart contract by addressing the claims to third party – judiciary or other enforcement agency. And it is one of the main “selling points” of this contractual form. However, as was mentioned before, this feature is to some extent “compensated” by the potential vulnerabilities of the code of Smart contract, opening it to exploit, either by the party to the contract or by a third party. One disclaimer should be made here, though. It is possible to image a contract, according to which the performance is structured in a way that may still require party’s involvement in the process of its completion. For example, relevant amount of cryptocurrency is not Electronic copy available at: https://ssrn.com/abstract=2885241
19 blocked/deposited on a special account till the specified event occurs, but only details of the account are provided and once event occurred, there is a payment order directed to that account and it contains no assets on it. Thus, a contract may be formally breached. Or, let’s take another situation – the counter-performance requires transfer of an electronic asset of certain kind (e.g. passcode to a certain database), but such asset is not valid (e.g. the password does not actually work). Again, in such case the question of non-performance of the contract can be raised. However, although such agreements may be automated by using some kind of computer code, they are not Smart contracts. Not any contract performed on a computer language can be regarded as Smart contract, but only based on Blockchain technology, ensuring its self-enforcement nature. The above examples relate to the contract, which are not self-enforceable and still depend on the degree of discretion of the party to it. In such circumstances, it will be not possible to ensure trustworthiness of information in Blockchain, since it may change in a given moment of time. Thus, it is more correct to treat contracts indicated in the above examples as electronic contracts, but not as “Smart” contracts as such, otherwise, the concept of the latter will be so blurred that would loose its separate meaning. 3. Vitiated consent or intent do not have any impact on Smart contract’s validity. Whether it was concluded for mistake, as a result of fraudulent misrepresentation, coercion or threats, unfair exploitation of relationship of trust – it is completely irrelevant for its performance in contrast to classic contracts, where such circumstances serve as a basis for court interference in all the legal systems. Moreover, such consideration of such vitiating factors is in contradiction with the main feature of Blockchain-based databases of transactions: their “single version of truth” for everyone. If such factors may serve as a basis for changing the content of such database post factum, it will undermine the trust in Blockchain and depreciate its value. Therefore, in Smart contracts there cannot be a collision between intent and its expression, what really matters is only an expression of intent represented in computer code. Such an approach can be viewed as a triumph of protection of the certainty and market. Of course, there is some residual possibility to apply relevant provisions on invalidity of contract and its consequences (damages claims, obligation to return everything received under the agreement, etc.). But this will be possible only if the party to the Smart contract is identified and within the jurisdictional reach of the enforcement authority. Anyway, such enforcement actions won’t have impact on the content of Blockchain database, unless it is created on different principles than the currently known Blockchain in Bitcoin. Electronic copy available at: https://ssrn.com/abstract=2885241
20 4. Smart contracts are egalitarian by its nature. Thus, Smart contract architecture does not allow to ensure protection of weak parties, e.g. consumers. The whole layer of legal provisions relating to consumer law and unfair contract terms is non-applicable to Smart contract. At the same time, Smart contracts may provide some extra leverage for consumers to protect their interests. Currently consumers don’t have any realistic choice as to conclude or not to conclude a contract: they don’t have time to read the terms and conditions, and even if they do – they don’t understand its terms. Even if an individual understands them, he does not have bargaining power to change them and if he decides to go to another seller – the outcome will be the same. Smart contracts allow using electronic agents for conclusion of the agreement, and potentially they may be programmed in a way allowing them to search favorable terms and even negotiate them within the established boundaries. For example, so-called “snipers” in eBay online auctions allow to select offers based on certain criteria as well as place offers on behalf of the user with a certain parameters34. It is argued that in nearest future Smart contracts will allow consumers to conclude contracts based on terms, pre-established by them, e.g. on certain pricing terms, warranties, absence of monitoring individual’s behavior online, etc.35. Time will tell, whether it will be the case. However, it is quite possible to expect that at some moment of time Smart contracts will become routine technology, like Internet itself in 90s years of the last century. Usually, certain technology becomes routine when technological elite becomes bored with it, after that it becomes mass market. In any case, it is likely that on initial stages Smart contracts will mostly exist in B2B and C2C sectors, but not in B2C segment of e-commerce. 5. Possibility of illegal smart contracts. Smart contracts are treating legal and illegal subject matter in the same way, what matters is only the possibility to implement such subject matter in a code. There are lots of debates relating to the potential illegal uses of Bitcoin cryptocurrency, which cast shadow on Blockchain technologies as well. In Russia use of Bitcoin is not per se illegal, however, there are warning statements from Central Bank of Russia, and Committee of Financial Monitoring according to which Bitcoin may be used for money laundering schemes and financing of terrorism36. Smart contracts can also be used for illegal purposes, for example for procuring hacker services a contract by offering a cryptocurrency reward for hacking a particular website. Ethereum’s programming language makes it possible to control the promised funds. It will 34 eBay Inc, 2013 eBay Automated Bidding System, December 30, < http://goo.gl/NPgryF> 35 Fairfield J 2014 ‘Smart Contracts, Bitcoin Bots, and Consumer Protection’, Wash. & Lee L. Rev. Online, vol.71, <http://scholarlycommons.law.wlu.edu/wlulr-online/vol71/iss2/3> 36 Statement of the Central Bank of Russia “On the usage of cryptocurrencies, including Bitcoin, for performance of transactions” of 27 January 2014; Statement of the Committee of Financial Monitoring of the Russian Federation “On the usage of cryptocurrencies” of 6 February 2014. Electronic copy available at: https://ssrn.com/abstract=2885241
21 release them only to someone who provides proof of having carried out the job, in the form of a cryptographically verifiable string added to the defaced site37. Taking into account that Smart contracts may be programed for verification of certain facts based on information available on certain websites, it may verify the fact of completion of certain illegal act (terrorist act, assassination, theft, etc.) and release established remuneration for that act. Although such a contract will be invalid as infringing fundamental principles of legal order (Article 169 of the CCRF, II. – 7:301 DCFR), it will still be executed by program code. The only thing, which the law may oppose is to try to deanonymize and to pursue the individuals involved in the transaction in real life. 6. Autonomous nature of Smart contracts. Strictly speaking, Smart contracts don’t have a need in a legal system to exist: they may operate without any overarching legal framework. De facto, they represent a technological alternative to the whole legal system. Apart from conclusions already mentioned above, it means that there is no need in conflict of laws provisions, since there are no collisions of various legal systems. Mathematics is universal human language. Thus, Smart contracts are truly transnational and executed uniformly regardless of the differences in national laws. It is a perfect example of new type of regulator governing relations in cyberspace – Reidelberg’s lex informatica38 or Lessig’s “code is law”39 IV. Conclusion: The ultimate question of Blockchain and Smart contracts. In The Hitchhiker’s Guide to the Galaxy by Douglas Adams, the was an “Ultimate Question of Life, the Universe, and Everything”, the answer to which was being calculated by the supercomputer “Deep Thought” over a period of 7.5 million years. The resulting answer, however, was pretty disappointing to most people. While the above analysis showed that although it is possible to squeeze Smart contracts in Analysis of Blockchain technology and its core features together with established approaches to legal regulation allows to set similar question, which is as global one, as the “ultimate question of life and universe” at least for the destiny of particular technology. Let’s call it the ultimate question of “Blockchain and Smart contracts”. This question is: “How to align the powers of the government with Blockchain if there is no central authority but only distributed technologies”? 37 Duggal P 2015, Blockchain Contracts & Cyberlaw, Amazon E-Book 38 Reidenberg J 1997 ‘Lex Informatica: The Formulation of Information Policy Rules through Technology’ Texas Law Review, vol. 76, no. 3, p. 55 39 Lessig L 1999, Code and Other Laws of Cyberspace, New York: Basic Books Electronic copy available at: https://ssrn.com/abstract=2885241
22 It is possible to illustrate the essence of the question in the following example. Let’s imagine that certain asset is transferred by its owner A to the new owner B and the fact of such transfer is reflected in Blockchain. However, later the owner A claims that B threatened A and thus, the transaction is invalid. The claim succeeds in court and there is a judgment according to which the transaction is considered invalid and the asset belongs to the initial owner A. Thus, there are two realities: the first one is depicted in Blockchain and in accordance to it, the owner is “B”, since it is impossible to introduce changes in the content of Blockchain and reverse its data. The second reality is a legal one, sanctioned by the authority of legal system: according to the official judgment the owner is “A”. How to align these realities in a way that would be acceptable for all the stakeholders and won’t diminish the advantages of new technologies? This is the ultimate question. Currently, it is possible to suggest two solutions, neither of which seems to be optimal enough. 1) To introduce the concept of “Superuser” for government authorities, which will have a right to modify the content of Blockchain databases in accordance with specified procedure in order to reflect the decisions of state authority; 2) To enforce decisions of state authorities in “offline” mode by pursuing the specific users and forcing them to include changes in Blockchain themselves as well as by using traditional tort claims, unjust enrichment claims, specific performance claims. The problem with the first solution is that it leads to substantial mutation of Blockchain technology and strips it of the main advantage: resilience to data manipulations from outside and facilitated unique level of trust. If some kind of user of Blockchain technology will have extra powers, including the power to influence the data in it, resulting solution based on such “Blockchain” will be hardly more attractive than traditional databases and registers maintained by the state authorities. All the most attractive and innovative features of Blockchain will be diminished. The problem with the second solution is that it is associated with time-consuming and inefficient in transborder area instruments from the old era, which don’t keep pace with new technologies. De-anonymization and jurisdictional problems are substantially weakening the effectiveness of such an approach and lead to diminishing the sovereign power of the national authorities in cyberspace area. It is pretty likely that Smart contracts will sooner or later create their own system of dispute resolution. Recent example with the hack attack on Ethereum DAO in June 2016 shows that certain mechanism of reaching a consensus between the parties to Smart contract on certain Electronic copy available at: https://ssrn.com/abstract=2885241
23 unexpected (non-programed) events is necessary. But this won’t solve that Ultimate question of Blockchain and Smart contracts, rather will heat it even more, since the legitimacy of such mechanisms and their recognition by the state authority will become at stake. So it is necessary to state that the Ultimate question of Blockchain and Smart contracts is still waiting for its answer since the current ones are hardly satisfactory for all the stakeholders and for development of these technologies. One thing is evident, however, those jurisdictions, which will have the most Blockchain-friendly regulations will have competitive advantage in attraction of new innovative business models and companies willing to exploit them in a legal way. Savelyev Alexander Ph.D., Associate professor of Faculty of Law, senior researcher of National Research University Higher School of Economics (Moscow, Russian Federation), Legal Attorney of IBM Russia/CIS e-mail:[email protected] Tel.8 495 772 9590 Any opinions or claims contained in this Working Paper do not necessarily reflect the views of HSE or IBM. © Savelyev Alexander, 2016 List of references: 1. Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, < www.bitcoin.org> 2. Schneider G 2008, Electronic Commerce. 8th ed, Cengage Learning 3. Swanson T, 2014, Great Chain of Numbers < https://goo.gl/lBDVE5> 4. CNews, April 29, 2016, NSD Tested a Blockchain-Based E-Proxy Voting Prototype, <https://www.nsd.ru/en/press/pubs/index.php?id36=629089> 5. Spielman A 2016, Blockchain: Digitally Rebuilding the Real Estate Industry, < http://dci.mit.edu/assets/papers/spielman_thesis.pdf > 6. ‘Deep Shift. Technology Tipping Points and Societal Impact’, World Economic Forum, Survey Report, 2015 7. Maine H 1920, Ancient Law: Its Connection with the Early History of Society and its Relation to Modern Ideas, London 8. Szabo N 1994, Smart contracts in Essays on Smart Contracts, Commercial Controls and Security <http://szabo.best.vwh.net/smart.contracts.html > 9. Segrave K 1944 Vending Machines: An American Social History, McFarland and Company, Inc., Publishers 10. Levine D 2013, ‘A day in the quiet life of a NYSE floor trader’,Fortune, 29 May, <http://fortune.com/2013/05/29/a-day-in-the-quiet-life-of-a-nyse-floor-trader/> Electronic copy available at: https://ssrn.com/abstract=2885241
24 11. Greenspan G 2016 ‘Beware of the Impossible Smart Contract’, Blockchain news, 12 April, < http://www.the-blockchain.com/2016/04/12/beware-of-the-impossible-smart-contract> 12. Hayes A 2016, ‘Decentralized Autonomous Organizations: IoT Today’, Investopedia, February 29, <http://www.investopedia.com/articles/investing/022916/decentralized-autonomous-organizations-iot-today.asp> 13. Raskin M 2016, The Law of Smart Contracts < http://ssrn.com/abstract=2842258> 14. Douglas I B et al. 1984, SPECIAL PROJECT: Self-Help: Extrajudicial Rights, Privileges and Remedies in Contemporary American Society, 37 Vand. L. Rev. 845, 850. 15. Study Group on a European Civil Code 2009, Draft Common Frame of Reference, Outline Edition, Sellier 16. Federal’nyy zakon ot 06.04.2011 N 63-FZ “Ob elektronnoy podpisi” [Federal Law of the Russian Federation No. 63-FZ “On electronic signature” of 04/062011] 17. Price R 2016 ‘Digital currency Ethereum is cratering because of a $50 million hack’, Business Insider, June 17, <goo.gl/SY90Ks> 18. Tapscott D, Tapscott A 2016 Blockchain Revolution: How the Technology Behind Bitcoin Is Changing Money, Business, and the World, Penguin Publishing Group, Kindle Edition 19. Nicholas B 1962 An Introduction to Roman Law, Oxford 20. Fairfield J 2014 ‘Smart Contracts, Bitcoin Bots, and Consumer Protection’, Wash. & Lee L. Rev. Online, vol.71, <http://scholarlycommons.law.wlu.edu/wlulr-online/vol71/iss2/3> 21. Duggal P 2015, Blockchain Contracts & Cyberlaw, Amazon E-Book 22. Reidenberg J 1997 ‘Lex Informatica: The Formulation of Information Policy Rules through Technology’ Texas Law Review, vol. 76, no. 3 23. Lessig L 1999, Code and Other Laws of Cyberspace, New York: Basic Books Alexander Savelyev Ph.D., Associate professor and senior researcher of National Research University Higher School of Economics (Moscow, Russian Federation), Legal Attorney of IBM Russia; E-mail: [email protected] Any opinions or claims contained in this Working Paper do not necessarily reflect the views of HSE. © Savelyev, 2016 Electronic copy available at: https://ssrn.com/abstract=2885241
SmartContractDevelopment:ChallengesandOpportunitiesWeiqinZou,DavidLo,PavneetSinghKochhar,Xuan-BachDinhLe,XinXia,YangFeng,ZhenyuChen,andBaowenXu,Member,IEEEAbstract—Smartcontract,atermwhichwasoriginallycoinedtorefertotheautomationoflegalcontractsingeneral,hasrecentlyseenmuchinterestduetotheadventofblockchaintechnology.Recently,thetermispopularlyusedtorefertolow-levelcodescriptsrunningonablockchainplatform.Ourstudyfocusesexclusivelyonthissubsetofsmartcontracts.Suchsmartcontractshaveincreasinglybeengainingground,Þndingnumerousimportantapplications(e.g.,crowdfunding)intherealworld.Despitetheincreasingpopularity,smartcontractdevelopmentstillremainssomewhatamysterytomanydeveloperslargelyduetoitsspecialdesignandapplications.Arethereanydifferencesbetweensmartcontractdevelopmentandtraditionalsoftwaredevelopment?Whatkindofchallengesarefacedbydevelopersduringsmartcontractdevelopment?Questionsliketheseareimportantbuthavenotbeenexploredbyresearchersyet.Inthispaper,weperformedanexploratorystudytounderstandthecurrentstateandpotentialchallengesdevelopersarefacingindevelopingsmartcontractsonblockchains,withafocusonEthereum(themostpopularpublicblockchainplatformforsmartcontracts).Towardthisend,weconductedthisstudyintwophases.IntheÞrstphase,weconductedsemi-structuredinterviewswith20developersfromGitHubandindustryprofessionalswhoareworkingonsmartcontracts.Inthesecondphase,weperformedasurveyon232practitionerstovalidatetheÞndingsfromtheinterviews.Ourinterviewandsurveyresultsrevealedseveralmajorchallengesdevelopersarefacingduringsmartcontractdevelopment:(1)thereisnoeffectivewaytoguaranteethesecurityofsmartcontractcode;(2)existingtoolsfordevelopmentarestillverybasic;(3)theprogramminglanguagesandthevirtualmachinesstillhaveanumberoflimitations;(4)performanceproblemsarehardtohandleunderresourceconstrainedrunningenvironment;and(5)onlineresources(includingadvanced/updateddocumentsandcommunitysupport)arestilllimited.OurstudysuggestsseveraldirectionsthatresearchersandpractitionerscanworkontohelpimprovedevelopersÕexperienceondevelopinghigh-qualitysmartcontracts.IndexTerms—Smartcontract,challenges,empiricalstudy,blockchainÇ1INTRODUCTIONSINCEthereleaseofBitcoinin2009[105],decentralizedcryptocurrencieshavegainedconsiderableattentionandadoption[2].Forinstance,tillFebruary2018,thenumbersofcoinsandtokenshostedonthecoinmarket-cap1were896and649,respectively.Acryptocurrencyisadministratednotbyacentralauthority,butbyauto-matedconsensusamongnetworkedusers.Theusersinthecryptocurrencynetworkrunaconsensusprotocoltomaintainandsecureapublicandappend-onlyledgeroftransactions,i.e.,blockchain.Inrecentyears,thepoten-tialofblockchaintechnologyhasbeenexploitedbeyondcryptocurrencies,amongwhichapromisinguseofblockchainissmartcontract.Theterm“smartcontract”wasoriginallycoinedtorefertotheautomationoflegalcontractsingeneral[140].Thetermwas(andisstill)usedtorefertoalegalcontractwhichoratleastpartsofwhichiscapableofbeingexpressedandimplementedinsoftware[66].Theadventofblockchaintechnologyhasrecentlybroughtmuchinterestonsmartcontracts.Today,thetermispopularlyusedtorefertoascodescriptsthatrunsynchronouslyonmultiplenodesofadistributedledger(e.g.,ablockchain)[30].Inthispaper,wemainlyfocusonthelatter,morespecificdefinitionofsmartcontracts,i.e.,low-levelcodescriptsrunningonblockchains.Asaprogramrunningonablockchain,asmartcontractcanbecorrectlyexecutedbyanetworkofmutuallydistrust-ingnodeswithouttheneedofanexternaltrustedauthority.Theself-executingnatureofsmartcontractsprovidesatre-mendousopportunityforuseinmanyfieldsthatrelyondatatodrivetransactions[139].Inthebeginningof2018,morethan10percentofthejobsadvertisedonGuru2(one1.http://coinmarketcap.comW.Zou,Y.Feng,Z.Chen,andB.XuarewiththeStateKeyLaboratoryforNovelSoftwareTechnology,NanjingUniversity,Nanjing210008,China.E-mail:[email protected],[email protected],{zychen,bwxu}@nju.edu.cn.D.LoiswiththeSchoolofInformationSystems,SingaporeManagementUniversity,Singapore188065.E-mail:[email protected],Mississauga,Canada.E-mail:kochharps.2012@phdis.smu.edu.sg.X.-B.DinhLeiswiththeSchoolofComputingandInformationSystems,UniversityofMelbourne,Parkville,VIC3010,Australia.E-mail:bach.le@unimelb.edu.au.X.XiaiswiththeFacultyofInformationTechnology,MonashUniversity,Clayton,VIC3800,Australia.E-mail:[email protected];revised31Aug.2019;accepted10Sept.2019.Dateofpublication24Sept.2019;dateofcurrentversion15Oct.2021.(Correspondingauthor:ZhenyuChen.)RecommendedforacceptancebyR.Mirandola.DigitalObjectIdentiÞerno.10.1109/TSE.2019.29423012.http://www.guru.com/2084IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER20210098-5589©2019IEEE.Personaluseispermitted,butrepublication/redistributionrequiresIEEEpermission.Seeht_tps://www.ieee.org/publications/rights/index.htmlformoreinformation.Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
ofthebiggestfreelancersites)wererelatedtosmartcon-tractsandblockchains[56].Currently,moreandmoredevelopersaredevotingthemselvestodevelopingsmartcontractsinvariousdomains,e.g.,finance,game,andnotary[11].ThenumberofsmartcontractsdeployedonEthereum3(themostpopularpublicblockchainforrunningsmartcontractswithmarketcapitalizationexceeding$80billions)hasalsosharplyincreasedtomorethan2millioninMarch2018.4Theemergenceofsmartcontractsbringsaboutagrow-ingandwidespreadinterestintheresearchcommunity.Moreandmoreresearchersaretakingsmartcontractsasstudytargets[21],[69],[90].AgrowingnumberofpapershavebeenpublishedineventssuchasACM/IEEEInternationalWorkshoponEmergingTrendsinSoftwareEngineeringforBlockchain(WETSEB),5andInternationalWorkshoponBlockchainOrientedSoftwareEngineering(IWBOSE),6aswellassometracksatconferencessuchasACMConferenceonComputerandCommunicationsSecurity(CCS)andInternationalSymposiumOnLeverag-ingApplicationsofFormalMethods,VerificationandValidation(ISoLA)7[122],etc.Despitetheincreasingpopularityofsmartcontract,thepotentialchallengesthatdevelopersarefacingwhendevel-opingsmartcontractshavenotyetbeenclearlyexplored.Withoutunderstandingthesechallenges,practitionersandresearchersmayspendmucheffortsdevelopingtechniquesandtoolsthatarenotappreciatedbydevelopersandthusareunderusedinpractice.Tohelpadvanceresearchinsmartcontractdevelopment,weconductedanempiricalstudytoexploretheworkprac-ticeandpotentialchallengesfacedbydevelopersduringsmartcontractdevelopmentonblockchains,withafocusonEthereum.Wefollowedamixed-methodapproachthatisacombinationofinterviews(qualitative)andsurvey(quanti-tative).Specifically,wefirstinterviewed20developerswithdifferentbackgroundsandexpertise.Duringinterviews,weaskedparticipantsabouttheirnormalworkpracticesandrelevantchallengesfacedduringdifferentstages(e.g.,coding,testing,debugging)ofsmartcontractdevelopment.Thenweusedopencardsorting[135]toanalyzetheinterviewresults.Theresultingcategoriesproducedbyopencardsortingweregroupedintosixgroups,i.e.,secu-rity,debugging,programminglanguage,Ethereumvirtualmachine,gas,andonlinelearningresources&communitysupport.Afterthat,weperformedavalidationsurveywith232developerstoconfirmvariousinsightsfromtheinter-views,includingchallenges,bestpractices,anddesiredimprovements.Basedontheinterviewsandsurvey,wefoundthatdeveloperscaredalotaboutcodesecuritybutdidnothaveeffectivewaystoprovethecorrectness,reliabilityandsecu-rityoftheircode;meanwhile,thelackofpowerfultoolsespeciallystep-through/interactivedebuggersoftenmadeitpainfultoprogramsmartcontracts.Furthermore,asmentionedbydevelopers,thecurrentprogramminglan-guagesandvirtualmachinesthatwerespecificallydesignedforsmartcontractsstillhadanumberoflimitations(e.g.,lackofgeneralpurposelibrariesandlimitedsupportfordebugging).Theselimitationsoftenadverselyaffectedtheirprojectdevelopmentexperience,especiallyforcomplexprojects.Anotherbigchallengefordeveloperswasperfor-manceissues-theywereinterestedintoolsandresourcesthatcouldhelpthemwriteefficientsmartcontractsthatcon-sumefewerresourcesontheblockchain.Besides,lackofadvanced/updateddocumentsanddelayinresponsesfromtheonlinecommunityalsohadanimpactonsmartcontractdevelopment.Themajorcontributionsofourstudyareasfollows:Tothebestofourknowledge,thisisthefirstin-depthstudythatexplorespractitioners’perceptionsoncurrentstateofsmartcontractdevelopmentandchallengesaheadthroughinterviewsandsurvey.Weperformananalysisofthequalitativeandquan-titativedataandhighlightactionableinsightsandimplicationsthatdevelopers,toolbuilders,andresearcherscanusetoimprovedeveloperexperienceduringsmartcontractdevelopment.Theremainingpartsofthispaperarestructuredasfol-lows:InSection2,weprovidebackgroundmaterialsonsmartcontracts.InSection3,wepresentourempiricalstudymethodologyindetail.Thefindingsofourstudyarepre-sentedinSection4.Section5presentssomepotentialresearchdirectionsbasedonourfindings.Section6dis-cussesthethreatstovalidityofourstudy.Thelasttwosec-tionspresenttherelatedworkandsummarizeourstudy.2BACKGROUNDBlockchain.Ablockchaininitsverysimpleformisachainofrecordscalledblocks,inwhichblocksarelinkedandsecuredusingcryptography.Eachblockischaracterizedbysometransactiondata,atimestamp,andthehashvalueofitspreviousblock.Blockchaincanbeconsideredasapublicledgerwhereeachblockcontainsrecordsofsometransac-tions.Theblockchainisnotstoredinasinglelocationbutonanetworkofnodes,whereeachnetworknodehasacopyofthisblockchain.Thismeansalltherecordsarepub-licandeasilyverifiabletoallnetworknodes,whichmakesitveryexpensiveforanodetomodifyanydataintheblock-chain.Onceablockisappendedtotheblockchain,itisextremelyhardtomodifytheblock’stransactionswithoutachievingconsensusofallnodes.Allthesefeaturesarebydesignandbasedonpeer-to-peerconsensusprotocol[105].Theblockchaintechnologyallowstwountrustedpartiestomaketransactionssecurelywithouttheparticipationofatrustedthirdparty.Thismakesblockchainsuitableforrecordkeepingtaskssuchasstorageofownershiprightsofmusicalwork,financialtransactions,etc.Cryptocurrencieswhicharebasedonblockchainhaveattractedconsiderableattentionlately[90].Anemergingareaofblockchaintech-nologyissmartcontract.SmartContract.Theterm“smartcontract”wascoinedbyNickSzabointhemid1990s[140].Hesuggestedtranslatingtheclausesofacontractintocodeandembeddedtheminto3.http://www.ethereum.org/4.https://etherscan.io/accounts/c.LastAccess:March20185.http://conferences.computer.org/icse-w/2018/#!/toc/286.http://saner.unimol.it/blockchainOrientedSoftwareEngineering7.http://www.isola-conference.org/isola2018/tracks.htmlZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2085Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
softwareorhardwaretomakethemself-execute,inordertominimisecontractingcostbetweentransactingpartiesandtoavoidaccidentalexceptionsormaliciousactionsduringcontractperformance.Currentlypeopleindifferentdisciplinesusedtheterm“smartcontract”indifferentways.Somereferred“smartcontract”asalegalcontractwhich(oratleastelementsofwhich)couldberepresentedbysoftware.Whilesomeotherstook“smartcontract”ascodescriptswhicharedesignedtoexecutecertaintasksoncepre-definedcondi-tionsaremet;thesescriptstypically(althoughnotnecessar-ily)runondistributedledgers(e.g.,blockchains)[27],[136].Clacketal.proposedadefinitionofsmartcontractwhichisbroadenoughtocoverthebreathofabove-mentioneddefi-nitions.Theydefinedasmartcontractas“anautomatableandenforceableagreement.Automatablebycomputer,althoughsomepartsmayrequirehumaninputandcontrol.Enforceableeitherbylegalenforcementofrightsandobliga-tionsorviatamper-proofexecutionofcomputercode”[29].Inthispaper,wemainlyfocusonlow-levelcodescriptsrunningonblockchains.Asaprogramrunningonablock-chain,asmartcontractcanfacilitateacontractbetweentwopartieswithoutrelyingonatrustedthirdparty.Technicallyspeaking,asmartcontractisaprogramthatcontainsbothdata(e.g.,accountbalance)andexecutablecode.Smartcon-tractcanbestoredintheblockchain,andcanbeautomati-callyexecutedwhencertainpre-conditionismet.Aftereachexecutionofthesmartcontract,itsstatecanbeupdatedontheblockchain[152].SmartContractsRunningonCorda.Cordaisanopen-sourcepermissionedblockchainplatformthatisexplicitlydesignedtoaccountforthehighlyregulatedenvironmentofthefinancialserviceindustry[92].WithinCorda,eachnodehasacertificatethatmapstheirnetworkidentitytoareal-worldlegalidentity.ThecommunicationbetweenCordanodesispoint-to-pointandthetransactionhistoryisfullyencryptedandprivatetoonlynecessaryparties[17].SmartcontractsrunningonCordaareallowedtoconsistofbothcodeandlegalprose[146].Theassociatedlegalprosecouldbereferredbacktotraditionallegalsystemsincaseoflegaldisputesinsmartcontractperformance.Asmartcon-tractinCordahasthreekeyelements,namelyexecutablecode,stateobjects,andcommands[119].Theexecutablecodemainlyvalidatesthechangestostateobjectsintransac-tions.Stateobjectsaredatathatrecordtheexistence,contentandcurrentstateofanagreementbetweentwoormorepar-ties,andworkasinputoroutputoftransactions.Com-mandsareadditionaldatathatareincludedwithintransactions.Theymainlydescribewhatisgoingonandtelltheexecutablecodethewaytoverifyatransaction.AllsmartcontractscouldbeprogrammedinKotlinorJavaandcouldbecompiledintoJavaVirtualMachine(JVM)bytecode.On-ChainandOff-ChainSmartContracts.Duetothenatureofblockchaintechnology,smartcontractsdeployedonblockchains(i.e.,on-chainsmartcontracts)generallyneedtobeexecutedandvalidatedbyeachnode,withallrelevanttransactionsbeingvisibletotheentireblockchainnetwork.Thisreducestheprivacyofsmartcontracts.Further,forsmartcontractsespeciallythosewithcomplexcomputation,thetransactioncostmaybehigh(e.g.,usersneedtopaygasfeefortransactionsonEthereum)andthevalidationofrele-vanttransactionsmaytakealongtime(duetoreplicatedexe-cutionofsmartcontractsamongnodes).Asanalternativesolutiontowardstheseproblems,theideaof“off-chain”smartcontracthasbeenproposed[41],[83].Off-chainsmartcontractsareexecutedoutsideoftheblockchain.Unlikeon-chainsmartcontracts,anoff-chainsmartcontractonlyneedstobesignedandexecutedbyinterestedparticipants.Aspro-posed,anoff-chainsmartcontractisgenerallydesignedtoencapsulatefunctionsinvolvinghigh-costcomputationorprivateinformationabouttheparticipants;whileanon-chainsmartcontractissuggestedtoconductsomelow-costandnon-sensitivetasks.Topreservethepropertiesandbene-fitsofablockchain,inpractice,theresultsofoff-chainsmartcontractswouldbeforexampleloggedon-chain[41].Incaseofanydisagreementontheexecutionresultsofanoff-chainsmartcontract,anon-chainsmartcontractmaybeusedtoforktheoff-chainsmartcontractandexecuteitonblockchaintosolvethedispute[83].BlockchainPlatformsforSmartContracts.Blockchainscanbedividedintopublicandnon-publiccategories.Publicblockchainplatformsallowanyusertojointhenetworkwhilenon-publicblockchainplatformsallowonlypermit-teduserstojoin.ExamplesofpublicblockchainsareEther-eum,andNEO.8Someexamplesofnon-publicblockchainsareFabric9andQuorum.10Differentblockchainplatformsprovidedifferentsupportforsmartcontracts.Some(e.g.,Bitcoin)mayonlyallowuserstouseasimplescriptinglanguagetodevelopsmartcontractswithsimplelogic;whilesomeplatforms,suchasEthereum,supportmuchmoreadvancedprogramminglanguagesforwritingsmartcontracts[127].Ethereum.SinceitsreleaseinJuly,2015,Ethereumhasgrowntobecomethemostpopularblockchainplatformforsmartcontracts[21].EthereumprovidesadecentralisedTuring-completemachine,namelytheEthereumVirtualMachine(EVM),toexecutescriptsusinganinternationalnetworkofpubliccomputenodes[19].OnEthereum,peo-plecanuseprogramminglanguages,e.g.,Solidity11andVyper,12todevelopcomplexsmartcontractapplications.Allsmartcontractswritteninhigh-levellanguageswouldbecompiledtothesameformat,i.e.,Ethereumbytecode,andbeexecutedbytheEVM.Ethereumalsohasitsowncryptocurrenty,namelyEther.Ethercanbetransferredbetweenaccountsandusedtocompensateparticipantswhomineblocksforcomputationsperformed[19].Gas.Ethereumadoptsaninternalpricingmechanism,i.e.,gasforalltransactionsrunningonit[19].Gasisamea-sureofhowmuchcomputingresourceatransactionwouldcost.Peopleneedtopaygasfee(inEthers)foreachtransac-tiontheymake;andatransactionwouldfailifitrunsoutofgas.Ifuserswanttohavetheirtransactionsminedbymin-ersfaster,theycanchoosetoincreasethegasprice.Byusingthegasmechanism,Ethereumisabletobetterallocateresourcesandmitigatespamonthenetwork.8.http://neo.org/9.http://www.hyperledger.org/10.http://www.jpmorgan.com/global/Quorum11.http://github.com/ethereum/solidity12.http://github.com/ethereum/vyper2086IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
TrustedExecutionEnvironment(TEE).Topreservethecon-fidentialityorprivacyofsmartcontracts,someeffortsarebeingmadetointegratetrustedexecutionenvironments(TEEs)withblockchains[26],[46],[70].ATEEisasecureareaofamainprocessorwhichensuressensitivedatatobestored,processed,andprotectedinanisolatedenvironmentcalledanenclave.Datainsideanenclavecouldonlybeaccessedbycoderesidinginthesameenclave.Withinanenclave,boththecodeanddataareprotectedbyhardwareenforcedaccesscontrolpolicies.Theoperatingsystemandotherapplicationsarenotabletotamperwithoreavesdroponthestateofanyapplicationrunninginsidetheenclaveunlessthehardwareisbreached.TherehavebeenseveralrealizationsofTEE,includingIntelSGX(themostpromi-nentTEEtechnologytoday)[5],TrustZone[7],etc.ByusingaTEE,onedoesnotneedtotrustthehost(whichrunstheblockchaincode)oftheenclave.3METHODOLOGYFig.1showstheoverviewofourmethodologydesign.Onthewhole,ourstudyincludestwoparts:aseriesofinterviewswith20expertdeveloperstogetinsightsintosmartcontractdevelopmentandafollow-upsurveytovalidatethefindingsoftheinterviews.Wedescribethedetailshowweconducttheinterviewandsurveybelow.3.1InterviewProtocol.Inourstudy,weconductedsemi-structuredinterviews[133].Specifically,webeganeachinterviewwithanintroduction,ashortexplanationofourresearch,andsomedemographicquestionsabouttheinterviewee.Next,weusedsomeopenquestionstoguidethediscus-sion–someofthemarelistedinTable1.Thefulllistofopenquestionscanbefoundathttps://github.com/SurfGitHub/smartcontractStudy/blob/master/interview_questions.pdf.Theseopenquestionsprobedourintervieweesabouttheirviewsonmajordifferencesbetweensmartcontractdevelopmentandtraditionalsoft-waredevelopmentandtheirimpacts,challengesinvolvedinperformingvarioussmartcontractdevelopmentactivi-ties,etc.Sincetheinterviewwassemi-structured,wealsoaskedfollow-upquestionstodigdeeperintoourinter-viewparticipant’sviewpointswhenappropriate.Attheendoftheinterview,weaskedtheintervieweetoprovideanyotherimportantinformationthatwemayhavemissedduringtheinterview.Fig.1.Overviewofmethodologydesign.ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2087Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
Wetotallyhad31intervieweecandidates(moredetailsinParticipantRecruitmentbelow).Duringinterviews,wefol-lowedthemethodologyemployedin[6],[134]todecidewhentostopinterviewing,i.e.,stoppinginterviewswhensaturationoffindingswasreached.Saturationisawidely-usedmethodologicalprincipleinqualitativeresearch[55],[101],[106].Itisoftentakentoindicatethatfurtherdatacol-lectionoranalysisareunnecessarybasedonthedatathathavebeencollectedoranalyzedhitherto[124].Morespecifi-cally,ifthecollecteddataisconsideredalreadysufficientandfurtherdatacollectiondoesnotgeneratenewinforma-tion,thenthesamplingshouldnotbecontinued[137].Takingintoaccountthefindingsinbehaviorandbrainscienceswhichclaimthat“thereissubstantialvariabilityinexperimentalresultsacrosspopulations”[58],wemadesuretointerviewparticipantsfromdifferentbackgrounds(asshowninTable2)beforedecidingwhethersaturationhadbeenreached.Duringeachinterview,theauthors(whoconductedinterviews)workedtogethertoaskquestionsandtakenotes.Uponfinishinganinterview,theywouldcomparetheirnoteswithpreviousonestocheckwhethertheinterviewwasbringinganynewinsights.Finally,westoppedourinterviewswhenweachievedsaturationofthefindingsafterweinterviewed20people.AllinterviewswereperformedremotelyviaSkype,WeChat,orGoogleHangouts,andwereaudiorecordedwiththepermissionofparticipants.Theaverageandstan-darddeviationoftheinterviewtimewere52.34and15.74minutes,respectively.Table2showsthebasicdemo-graphicsoftheinterviewees.Accordingtothetable,theintervieweeshadanaverageexperienceof11.35yearsingeneralsoftwaredevelopment,and1.27yearsinsmartcon-tractdevelopmentbythetimeofinterviews.Besides,theyheldvariousroles,includingdevelopers,testers,projectmanagers,architects,designers,CEO/CTO,researchassis-tants,andsmartcontracttrainers.Thistoalargeextent,guaranteestheheterogeneityofthose20persons.ParticipantRecruitment.Wecontactedpotentialpartici-pantsinmultipleways.WesentemailstosmartcontractdevelopersonGitHub.Wealsocontactedsomedevelopersinwell-knowncompaniesworkingonsmartcontractdevel-opmentsuchasConsenSys,13andOpenZepplin.14Then,weexpandedtheinitialgroupbyusingasnowballprocess[47],i.e.,addingadditionalparticipantsrecommendedbycur-rentparticipants.Finally,31personsagreedtoparticipateinourinterviews.DataAnalysis.Foreachinterview,theaudiorecordingwasfirsttranscribedintotext.Afterthat,thefirstauthorreadthetranscriptsandconvertedthemintoseparateunitseachwithcoherentmeaning.Then,weperformedcardsorting[135]toidentifythecategoriesfromtheseunits.Cardsortingisacom-monlyusedtechniquethathelpstoderivecategoriesfromdata[75],[76].Therearethreetypesofcardsorting,namelyclosedcardsortingwithpredefinedcategoriesfordata,opencardsortingwithnopredefinedcategories(i.e.,thecategoriesofopencardsortingaretotallyderivedfromthedata),andahybridcardsortingwhichcombinestheprevioustwotypes[159].Consideringourstudyisanexploratoryonewithcate-gories(i.e.,challengesofsmartcontractdevelopment)beingunknowninadvance,wedecidedtoadoptanopencardsort-ingprocesstoanalyzetheinterviewdata.Specifically,duringcardsorting,afteracardwascreatedforeachtextualunit,thecardswerethenclusteredintomeaningfulgroups,witheachgrouphavingatopicoratheme.Thesegroups,i.e.,low-levelsubcategories,furtherevolvedintohigh-levelcategories.Theresultsofsuchanopencardsortingwouldletusobtainahierarchicalstruc-tureofthecategories.Fourresearchersincludingtwonon-authorswereinvolvedinthecardsortingprocess.Eachcardwasanalyzedandverifiedbytworesearchers.Throughcardsorting,weidentifiedsixhigh-levelcatego-ries,i.e.,security,debugging,gas,programminglanguage,theEthereumVirtualMachine,andonlineresources&com-munitysupport,witheachcategorycontainingseveralsub-categories(moredetailsinSection4).3.2SurveyDesign.Oursurveyincludesanumberofdemographicquestionsandsmartcontractquestions.ThedemographicTABLE1OpenInterviewQuestions(Excerpt)IDQuestion1Whatarethemaindifferencesbetweensmartcontractdevelopmentandtraditionalsoftwaredevelopment?2Howdothedifferencesaffectyoursmartcontractdevelopment?3Whatpracticesdoyouoftenusetoensurecodequality?4Whatkindoftoolsdoyouoftenusetodevelopsmartcontract?Aretheyusefulenough?Why?5Whatisyourwaytodebug/testsmartcontract?Anyproblemsencountered?6Doyouthinkcurrentprogramminglanguagesaregoodenough?Why?TABLE2BasicInformationofIntervieweesIDGeneralExp.SCExp.RoleP1210.7CEOandDeveloperP2170.7ArchitectP3152.8CEO,CoredeveloperofEthereumP4152.0DeveloperP561.5DeveloperP640.6ResearchAssistantP791.5ProjectManagerP861.5DeveloperP960.8DeveloperP1070.9TesterP11181.8DeveloperP12222.0CEO,Advisor,CTOP13150.6DeveloperP14151.6Blockchainspeakerandtrainer,co-founderP1580.5Developer,co-founderP1671.5Developer,TokenSaleAdvisorP17150.8ProjectManagerP1842.8DesignerP1991.5DeveloperP2080.3DeveloperGeneralExp.andSCExp.representaparticipantÕsexperienceingeneralsoft-waredevelopmentandsmartcontractdevelopmentrespectively(inyears)tillthetimeofinterview.13.https://new.consensys.net/14.https://openzeppelin.org/2088IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
questionsaremainlydesignedtounderstandtheback-groundandexperienceofrespondents.Specifically,wecre-ated8demographicquestionsthataskrespondent’smainrole(e.g.,development,testing,etc.),experienceinsoftwareengineeringandsmartcontractdevelopment,country,highesteducationalqualification,andthekindofprojectsandblockchainstheymainlyworkon.Thesmartcontractquestionsaredesignedtovalidateinsightsthatwegotbyanalyzingtheintervieweecom-ments.Foreachofthesixcategories(i.e.,security,debug-ging,programminglanguage,Ethereumvirtualmachine,gas,andonlineresources&communitysupport)thatweidentifiedbyanalyzingourinterviewresponses,wecreatedasetofsurveyquestions.Intotal,wecreated27questions.Forsomeofthem,weaskedrespondentstoratestatementsonaLikertscaleof1to5(1=stronglydisagree,and5=stronglyagree).Forsomeothers,weaskedrespondentstopickoneorafewoutofanumberofoptions.Twoofthequestionswereopen-ended.Thefulllistofoursurveyques-tionscanbefoundathttp://github.com/SurfGitHub/smartcontractStudy.SurveyRespondentRecruitmentandStatistics.OurpotentialsurveyrespondentsaredeveloperswhocontributedtosmartcontractrelatedprojectsonGitHub.Toidentifythoseprojects,wefirstreferredtothetopiclist15ofGitHub,andchosethreetopicsthataremostrelatedwithsmartcon-tracts,i.e.,Ethereum,SolidityandTruffle.16Thenwedown-loadedalltherepositoriesunderthesethreetopics.Toensurethatwedidnotmissanypopularsmartcontractprojects,wefurtherusedGitHub’ssearchAPItogetalistofprojectswhosename,descriptionorreadmecontainthekey-word“smartcontract”.Afterthat,weselectedandmanu-allychecked1,000smartcontractrelatedrepositoriesthathavethemoststars.Foreachrepository,weobtainedthee-mailaccountsbyanalyzingitscommitlogs.Intheend,wehad4,466distinctemailaddresses.Outofthese,morethan2,590developerswereinvolvedinmultiplerepositories.Thenwerandomlyselected2,000smartcontractdevelopersandsentoursurveyinvitationstothemthroughemails.Intwoweekstime,wegot205responses,witharesponserateof10.2percent.Thisresponserateissimilartothosereportedbypriorstudies[94],[118].BesidesGitHubdevel-opers,wealsoaskedourfriendsinindustrytohelpbroad-castoursurveytotheirfriendsandcolleagueswhomaybeinterestedtoparticipateinoursurvey.Withtheirhelp,wegotanother27responsesfromindustry.Intheend,wehad232responsesfromrespondentscomingfrom48countries.Amongthe232respondents,81.9percentrespondents’mainroleisdevelopment;and43.1percentrespondentshaveadvanceddegrees(e.g.,Master,Ph.D.).Therespond-entshavedifferentexpertiseingeneralsoftwaredevelop-mentandsmartcontractdevelopment:32.8percentoftherespondentshave>10yearsofgeneralsoftwaredevelop-mentexperience,and66.8percenthave>4yearsofexperi-ence;13.8percentrespondentshave>2yearsofsmartcontractdevelopmentexperience,and46.6percenthave>1yearofexperience.Wefoundthat69.4percentoftherespondentsmainlydevelopedsmartcontractsonpublicblockchains;andtheratioofdeveloperswhomostlyspenttimeonopensourceprojectsandclosedsourceprojectsare40.1and36.2percent,respectively.DataAnalysis.Afterwegotalltheresponsesfromrespondents,weadopteddifferentanalysismethodsforclosed-endedandopen-endedquestions.Specifically,foreachclosed-endedquestion,wecountedthevotesthatwenttoeachansweroption.Thenforeachansweroption,wecal-culateditsvoteratiobydividingthenumberofvotesfortheoptionover232(i.e.,thenumberofallrespondents).Whilefortheopen-endedquestions,wecollectedallthecommentsrespondentsmade.Thenweremovedsomecom-mentsthatwereeithernotmeaningful(e.g.,“Yes”)ornotrelatedtoourresearchtopic(e.g.,“happytohelpyouwithyourresearch”).Afterthat,wetriedtoplacetheremainingcommentsintotheircorrespondingcategoriesobtainedfromtheinterviewanalysis.Ifacommentinvolvedmorethanonecategory(e.g.,belongingtobothdebuggingandsecurity),thenwesplititintoseparatecommentswitheachassignedtoonlyonecategory.Wheneverwepresentsurveycomments,wereferitas(S?),e.g.,S5referstothefifthsur-veyrespondent.Tobetterunderstandparticipants’perspectivesofsmartcontractdevelopment,wedividedallsurveyrespondentsintodifferentdemographicgroups,andcomparedtheirvot-ingresultstowardsvariouschallengesanddesiredimprovementsmentionedbyinterviewees.Followingpriorstudies[80],[89],weconsideredthefollowingdemographicgroups:Respondentswhoaredevelopers(Dev)Respondentswhoaretesters(Test)Respondentswhoareprojectmanagers(PM)Respondentswithhighexperienceingeneralsoft-waredevelopment(>=10.0years17)(seExpH)Respondentswithlowexperienceingeneralsoft-waredevelopment(<=3.0years17)(seExpL)Respondentswithmediumexperienceingeneralsoftwaredevelopment(remainingrespondentswithmorethan3.0butlessthan10.0yearsofexperience)(seExpM)Respondentswithhighexperienceinsmartcontractdevelopment(>=2.0years18)(scExpH)Respondentswithlowexperienceinsmartcontractdevelopment(<=1.0year18)(scExpL)Respondentswithmediumexperienceinsmartcon-tractdevelopment(remainingrespondents)(scExpM)Respondentswithadvanceddegree,e.g.,Master,Ph.D.(Adv)15.GitHubTopicslistcanbeaccessedathttps://github.com/topics.16.http://truffleframework.com/17.Thethresholdsettingsof10and3helpedusobtainthreeexper-tisegroupswithroughlyequalnumbersofrespondents–thenumbersofrespondentswithhighexperience(>=10years),mediumexperience(3-10years)andlowexperience(<=3years)ingeneralsoftwaredevel-opmentwere76,79,and77,respectively).18.Asthefirstplatformthatsupportsgeneralsmartcontractdevel-opment,Ethereum(releasedonJuly30,2015)wasonlyabout3.0yearsoldbythetimeweconductedoursurvey.Thisindicatedthateventhemostexperienceddeveloperswouldgenerallyhavenomorethan3.0yearsofexperienceinsmartcontractdevelopment.Takingthisintoaccount,wechose2and1asthresholdsindeterminingwhetheradeveloperhashighexperience(>=2years),mediumexperience(1-2years),orlowexperience(<=1year)insmartcontractdevelopment.ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2089Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
Respondentswithoutadvanceddegree(nAdv)Respondentswhomainlydeveloponpublicblock-chains(pubBlk)Respondentswhomainlydeveloponnon-publicblockchains(nPubBlk)Respondentswhodeveloponbothpublicandnon-publicblockchains(bothBlk)Foreachdemographicgroup,wecalculatedthenumberofrespondentswhosaidyesor(strongly)agree,aswellasthenumberofrespondentswhosaidnoor(strongly)dis-agree,toindividualchallengesanddesiredimprovements(mentionedbyinterviewees),respectively.Thenfollowing[160],weadoptedFisher’sexacttest[43]withBonferronicorrection[98]onthesenumberstoseewhetheronegrouptendedtovotedifferentlyfromothergroup(s).Fisher’sexacttestisastatisticalsignificancetestusedintheanalysisofcontingencytables,whichdisplaysthefrequencydistri-butionofthevariables(i.e.,thenumbersofyes/(strongly)agreeandno/(strongly)disagreevotesfromeachgroupinourstudy).Itcouldassesswhethertheobserveddifferencebetweentwoproportions,e.g.,theratiosofyes/(strongly)agreevotesfromtwogroups,isstatisticallysignificant.Bon-ferronicorrectioncouldhelptocontrolthefamily-wiseerrorratewhenconductingmultiplecomparisons.Section4.7presentsthedetailedanalysisresults.4FINDINGSInthissection,wefirstreportourfindingsforeachofthesixcategoriesthatwereidentifiedbyusingopencardsortingoninterviewcontents.Eachcategoryhasseveralsubcatego-ries.Foreachsubcategory,wepicksomeofthemostmean-ingfulcommentsandhighlightsomestatisticsthatwederivedbasedonoursurveyresponsestohighlightthegen-eralizabilityofthefindings.Thenwepresentthevotingresultsofeachdemographicgrouptowardsthosechal-lengesanddesiredimprovementsmentionedbyinterview-ees,aswellasrelevantsignificancetestsovertheseresults.Last,weprovideabriefsummaryofourinterviewandsur-veyresults.4.1Security4.1.1HighRequirementforCodeSecurityBasedonourinterviewsandsurvey,wefoundthattherewasaveryhighemphasisonensuringcodesecurityforsmartcontracts.Securityconcernsbypassallotherfactors,ashighlightedbyonesurveyrespondent:ÒContractsecurityconcernsandoperationalsecurityconcernswhenmanagingdeployedcontracts(e.g.,keymanagement,contractartifactman-agement)permeatealldecisionsÓ(S71).Inoursurvey,wefoundthat75.0percentrespondentsagreedtotheassertionthatsmartcontractdevelopmenthasamuchhigherrequire-mentforcodesecuritythantraditionalsoftwaredevelop-ment.Basedonthereasonshighlightedbyinterviewees,wewereabletofindthreemajorthemesonwhytherewasanincreasedfocusonsecurityinsmartcontractdevelopment:SensitiveNatureofInformationHandled.Sincesmartcon-tractsoftencontrolandmanagesensitivedigitalassets(suchasvirtualcurrencies,token,digitalartfiles,etc.),peo-plenaturallyshowgreaterconcernforitssecurity,thantheydofortraditionalsoftware.AsP20stated:ÒDeveloperisdealingwithmoneyormoneyßowsthroughcode.PeoplewouldofcoursehaveahighrequirementonthecodesecuritybecauseitcontrolstheirassetsÓ.IrreversibleTransactions.Unliketraditionalsoftwaredevelopment,userscannotrecoveranylosstheyexperiencewhilemakingtransactionsonablockchainbasedfinancialsystemusingsmartcontracts.Sincesmartcontractsrunontheblockchain(onwhichtransactionscannotbereverted),ifyouloseyourmoney,youloseitforever.Onedevelopermentioned:ÒSmartcontractdevelopmentisveryunforgivinginthesensethatyoumightlosealotofmoneyanditisimpossibletogetback.Youknow,wecannotrevertanytransactionsonblock-chainÓ(P12).CodeUnmodiÞableAfterDeployment.Codeofsmartcon-tractcannotbechangedafterithasbeendeployedtotheblockchain.Unliketraditionalsoftware,developerscannotprovideapatchtofixabug.AsP9stated:ÒSmartcontractsarefundamentallydifferentthanregularprogramminglanguagesduetotheblockchain.Oncedeployed,smartcontractsaredifÞculttochangeÓ.4.1.2HardtoGuaranteeSecurityWefoundthat71.6percentsurveyrespondentsagreedthatitwasdifficulttoguaranteethesecurityofsmartcontactsduringdevelopment.Basedonourinterviews,wewereabletouncoverfourmajoraspectsofthesedifficulties.PublicCodeAccess.Ashighlightedbyoneinterviewee,thecodeofsmartcontract(e.g.,onEthereum)isalwayspubliclyaccessible.Thismeansthatanyonecantrytoexploitthecode,designanattack,andexecuteit.Also,assmartcon-tractsdealwithmoney,theyarealwaysunderfocusbyattackerswillingtoexploitanyloophole.Suchreasonsplaceagreatburdenonsmartcontractdeveloperswhoneedtosecuretheircodefrommanypotentialattacks.Onedevel-opermentioned:ÒBlockchainenvironmentprovidesakindofauniqueenvironment,becauseallofthecoderunningontheeco-systemisdeployedpubliclyandisaccessibletoanyone.AnyonecanexploititandmayconductanattackiftheyÞndsomesecurityvulnerabilitywithincode.Youneedtothinklikeahackeranddefendyourcode.ItisnoteasytoanyoneÓ(P3).FlawsinCompiler.Anotherfactorthatmakesithardtoguaranteecodesecurityliesinthecompileritself.Comparedwithcompilersfortraditionalprogramminglanguages,compilersforsmartcontractsarenotmatureenough.Manysecuritybugshavebeenfoundwithinsmartcontractcom-piler.19Alsoasthecompileriscontinuallyevolving,newbugsmaybeuncoveredinfuturewhichdevelopersarenotevenawareofatpresent.AsP4stated:ÒPeoplehavediscoveredalistofsecuritybugswithindifferentcompilerversions.Idonotknowwhatnewbugswemayencounterwithinthecompilersinceitstillevolves.ThisisbadImean,youriskyourSoliditycodeatunseenßawswithinfuture-versioncompilerÓ.Besides,assomesurveyrespondentscommented,thecompilerchangesconstantlyanddoesnotalwayshaveback-wardcompatibility,whichmakesithardtoensurethecor-rectnessofcodeespeciallyforalong-runningproject.ÒDuetoconstantchangesoncompilers,backwardcompatibilityusuallyisaproblem.Ó(S43)ÒSoliditychangesveryrapidly,andcomplainsthatcodethatidentiÞesitselfasforanoldercompilerversionuses19.https://solidity.readthedocs.io/en/develop/bugs.html2090IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
deprecatedfeaturesthatwerecurrentatthatversion.Thismeansthat,foralong-runningproject,youeitherhavetoupdateyouroldcontractstonewlanguageversions(andhavethemnotcorrespondtothereal,deployedcodewhenyouruntests),oryouhavetoignoreascreenfullofwarningseverytimeyoubuild.Ó(S69)LackofBestPracticesforWritingSafeCode.Manyinter-vieweeshighlightedthefactthatitisharderforthemtofindcodingandsecuritybestpracticesforsmartcontractdevelopmentthanfortraditionalsoftwaredevelopment.Asmentionedbyseveralinterviewees,thereareeffortsbyorganizationssuchasConsenSys,toconstantlydevelopandorganizesomecommonbestpracticestohelpdevelopersinwritingsafecode.P2mentioned,ÒConsenSyswrotequiteagoodguideonsmartcontactbestpractices.WewouldalwayscheckitsupdateandtendtoadoptthemÓ.However,developerssaidthatsucheffortsstillfallshortofmeetingtherequire-mentsofsmartcontractapplicationdevelopment.Oneintervieweementioned,ÒConsenSysoroneofthebigcompa-niesdoingsmartcontractsmayhavethatbestpractices.IcanÕtÞnditasanindependentdeveloper.WhenIdevelopsomethingnew,IjustcannotÞndanybestpracticethathelpmetomakeitsafe.SoIamgonnadowithwhateverIthinkisthebestÓ(P13).LackofTools/TechniquestoVerifyCodeCorrectness.Intradi-tionalsoftwaredevelopment,developerscouldusevarioustoolstohelpthemensurethequalityoftheircode.Whereasinsmartcontractdevelopment,manyintervieweescom-plainedthattherearenomaturetoolstoverifythecorrect-nessofsmartcontacts.Specifically,theymentionedtwokindsoftoolsthattheydesiredmosttobetterhelpguaran-teecodesecurity:codeauditingtoolsandformalverifica-tiontechniques(49.1and42.2percentsurveyrespondentslistedthemastheirmostdesiredtools,respectively).Codeauditingtoolsaretheoneswhichcanhelpdevel-operstodiscoverbugs,securitybreachesorviola-tionsofprogrammingconventions.AsP1stated:ÒTherearenoreliablecodeauditingtoolstohelpyoudoacomprehensiveanalysisofsmartcontractcode.Ihopewecanhavesuchtoolstohelpusanalyzethecode,andtelluswhethertherearesomepotentialbugs,securityproblems,orconventionviolationsÓ.FormalveriÞcationtechniquesensurethesecurityofcodebecausetheyarebasedonmathematicalproof.Someintervieweesandsurveyrespondentssaidthattheyhopedmoreresearchworkcanbedone.Asonesurveyrespondentstated:ÒMatureandrobustformalveriÞcationtoolswouldbeagodsend;codecoveragecanonlygetyousofarintermsofcorrectness.CallforformalveriÞcationÓ(S128).4.1.3CurrentBestPracticesforSecurityAswritingsecurecodeisoneofthemajorfocusofdevelop-ingsmartcontractapplications,weaskeddeveloperswhatstepstheyfollowedtoensuresecurityinfaceofanumberofchallenges.Intervieweesmentionedthattestingandcodereviewaretheirmajorwaystoensurethecorrectnessofsmartcontracts,whicharediscussedindetailsbelow.Testing.AsP11stated:ÒToensurethequalityofsmartcon-tract,IthinkonebestpracticeistomostlymakeheavyuseofunittestingÓ.Tobetterunderstandthesituationofsmartcontracttestinginpractice,weaskedintervieweeswhatkindsoftestingtheyconductedandwhatkindsofcodecoveragetheyused,thenweaskedthepotentialchallengestheyfacedduringsmartcontracttesting.Weverifiedtheiranswersinthesurvey.Oursurveyresultsshowthat84.9percentdevel-opersconductedunittesting,61.6percentdevelopersper-formedintegrationtesting,and25.4percentdevelopersperformedperformancetesting.Themostcodecoverageusedbythemwasfunctioncoverage(with68.1percentvotes);thestatement,branch,andconditioncoverageswerelesspreferredwith37.1,34.1,and35.8percentdevelopersmentioningthattheyusedthem,respectively.Despitethesmall/mediumsizeofsmartcontractpro-gram,2072.4percentsurveyrespondentsagreeditwasmoredifficulttotestsmartcontractsthantraditionalsoftwareprojects.Table3presentsthemajorchallengesoftestingsmartcontractratedbysurveyrespondents.Thetopthreechallengesare:(1)developersneedtoconsiderallcornercasesandscenarios;(2)thereexistpotentialunseenflawsincompilersandvirtualmachinesthemselves;(3)therearenomaturetestingframeworkslikeotherlanguages,e.g.,Java.CodeReview.84.9percentsurveyrespondentsagreedthatcodereviewisanessentialwaytoensurethecorrectnessofsmartcontacts.Oursurveystatisticsdoreflectthatdifferentkindsofreviewsareperformedinreality:83.6percentrespondentssaidtheywouldoftenperformpeercodereviewwithinteam;26.3percentrespondentssaidtheywouldoftenrequesthelpinGitHubforcodereview;and27.2percentdeveloperssaidtheywouldoftenhirethirdpartyagencytoaudittheircode.Meanwhile,comparedtotraditionalsoftwaredevelop-ment,someintervieweesmentionedthatitismorecostlytoperformcodereviewsforsmartcontracts.Theymentionedtwomajorchallengesofcodereviewthatwerealsoverifiedbyoursurveyresults.Onechallengeisthatitisverytimeconsumingtoconductcodereview(agreedby66.4percentofrespondents).Onedevelopercommented,ÒWithinourcompany,allmembersofourteamparticipateinthecodereview.Wesittogether,readandsometimesdiscusscodelinebyline.Itisindeedgoodforimprovingcodequality,butitistootimecon-sumingÓ(P8).Theotherchallengeisthatitisverydifficulttofindquali-fieddeveloperstofindsecurityflawsinsmartcontracts(agreedby80.2percentrespondents).Onesurveyrespondentcommentedthatyoucannotfindpeoplehelpyouunlessyoupaythem:ÒItÕshardtoÞndanotherdevelopertotestorevenreadTABLE3MajorChallengesofTestingSmartContractsChallengeVotesDifficulttoconsiderallcornercasesandscenarios69.4%Potentialunseenflawsincompilersandvirtualmachines53.4%Nomaturetestingframeworkslikeotherlanguages40.5%Testingneedstobedoneinanasynchronousway31.0%Lackofusefulguidancefortesting28.0%Notooltomeasurethequalityofsmartcontracttestsuite22.4%Testingconsumesgasiftestedontestnetsormainnet22.4%20.Afterexploringthesizeofsourcecodefrom10000+smartcon-tractsonEthereum,wefoundthatmorethanhalfsmartcontracthave<300codelines.ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2091Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
yoursmartcontractwithoutspendingextrafunds.Ithinkdevelop-ersthatinvolvedinopen-source,shouldhelpeachotherÓ(S32).4.2Debugging4.2.1DebuggingIsPainfulDuringourinterviews,mostparticipantscomplainedthatitismorepainfultodebugsmartcontractcodecomparedtotraditionalsoftwaredevelopment.Inourfollow-upsurveywithdevelopers,88.8percentsurveyrespondentsalsoagreedthatitisdifficulttodebugsmartcontractapplica-tions.Inoursemi-structuredinterviews,twomaincatego-riesofdebuggingchallengescameup,whichwerealsogivenasansweroptionstodevelopersduringoursurvey.Thecategoriesarebrieflydescribedbelow:LackofPowerfulInteractiveDebuggers.Assmartcontractdevelopmentisaveryrecenttechnology,thereisalackofpowerfuldebuggersinthisdomain.Asoneintervieweeexplained,ÒCurrentdebuggers,e.g.,Remix,canonlyprovidebytecodeleveldebugging(whichrequireshighskillsofdevelopers)andbasicinteractions,youcannotuseittoe.g.,visualizethememorystate,stepthroughthecodelinebylineandcheckthecur-rentvaluesofvariablesÓ(P1).69.0percentsurveyrespondentsalsoagreedthatthereisalackofpowerfulinteractivedebuggers,whichmakesdebuggingpainfulandchalleng-ingduringsmartcontractdevelopment.Non-InformativeErrorMessages.Someintervieweeshigh-lightedthefactthatapartfromthelackofdebuggingtools,Solidity(thelanguageusedforsmartcontractdevelopment)andEVM(theruntimeenvironmentusedforsmartcon-tracts)haveapoorsupportfordisplayinginformativeerrormessages.Oneintervieweeexplained,ÒSoliditycannotsup-portpeopletoe.g.,printerrormessagesincode.Instead,wecanonlyuseeventsorthrowexceptionstotrackthestateofthetrans-actionsÓ(P19).EVMinsomecasesdoesnotevenprovidesupporttodisplayerrormessagesforcertainfailuressuchaswhenatransactionfails.Thiswashighlightedbyoneoftheintervieweewhosaid,ÒSometimeswhentransactionsfail,EVMevencannotthrowouttheexceptionÓ(P2).Inthatcase,developerstotallyhavenoideawhatwentwrong.4.2.2CurrentDebuggingPracticesAshighlightedinprevioussection,thereisalacksupportfordebuggingforsmartcontractdevelopment;wewerecurioustoexploreifsmartcontractdevelopersfollowcer-tainpracticeswhiledebuggingtheircode.Basedonourinterviewsandsurveyresults,wesummarizethecurrentdebuggingpracticesfollowedbysmartcontractdevelopersbelow:Inoursurvey,65.1percentrespondentssaidthattheyuseexistingdebuggingtools,e.g.,Remixortruffledebugger,todebugbuggycode.However,another65.1percentrespondentsmentionedthattheyoftenmanuallycommentoutcodestep-by-steptonarrowdownbuggycodesearchspace.56.5percentrespondentsmentionedthattheywouldoftenwriteadditionalmethods/eventstocheckvari-ablesandtransactionstates.Thiscanbeattributedtothefactthatexistingtoolsdonotsupportcheckingvariablevaluesandtransactionstates.17.2percentrespondentsofoursurveymentionedthattheywouldoftenrequestthehelpofGitHubcommunityorotherdevelopersthroughsomeforums,e.g.,StackOverflow,whentheyencounterbugs.Allaforementioneddebuggingpractices,assomeinter-vieweesmentioned,areÒveryprimitiveandveryinefÞcientÓ(P7).Theyhopethatinthefuture,thecommunitycandevelopsomepowerfuldebuggingtoolsandcanhelpdeveloperstofindÒaneasywaytoquicklyvisualizetheeffectsofasmartcontract,suchasaparticularexecution,suchasshow-ingthecallgraphforasmartcontractinasoliditydependencygraphformat,andallowingyoutohighlightaparticularsection,debugjusttheexecutionsection.IthinkthingslikethatwouldmakeanenormousdifferenceÓ(P11).4.3ProgrammingLanguage4.3.1LimitationsofSolidityUnliketraditionalsoftwarewhicharedevelopedinmaturegeneral-purposeprogramminglanguages(e.g.,Java/Python),mostsmartcontractsaredevelopedinspecifically-designedprogramminglanguages(e.g.,Solidity).Throughoursurvey,wefoundthattheprogramminglanguagesthemselvesareamajorbarrierduringsmartcontractdevel-opment.39.7percentofoursurveyrespondents,agreedthatthisisoneofthetop3concerns.Thereareseveralspe-cificprogramminglanguages(e.g.,Solidity,Vyper,Bam-boo21)thatcanbeusedforsmartcontractdevelopment.However,asP12stated:ÒOnlySolidityisreadyforproductionandusedbymanydevelopers,othersarestillunderexperimentsÓ.Inpractice,evenSolidityhasissues,asmentionedbysomeinterviewees.Sinceithasemergedonlyinthelast3years,itisstillnotmatureandhasmanylimitations.Basedonoursurveyandinterviews,wefoundthatthemajorlimitationsofSolidityinclude:LackofGeneralPurposeLibraries.Basedonoursurveysta-tistics,56.9percentsurveyrespondentssaidthattheyoftenreuseexistinglibrariesfortheirowndevelopment.How-ever,77.2percentrespondentsagreedthattheexistinglibrariesarenotenoughforsmartcontractdevelopment.Someintervieweesandrespondentssaidtheyneedtoimplementvariouskindsoflibraries(suchasstringmanip-ulationlibraries)bythemselvesagainandagain.ÒThereisastrongneedforawell-tested(ideally:veriÞed)standardlibraryforsmartcontractdevelopment.Thecurrentstateleadstoreinvent-ing-the-wheeloverandoveragainforsimplethingssuchasstringmanipulation.Ó(S105)LackofSupportforErrorLogging/Reporting.Unlikeothertraditionalprogramminglanguages,Soliditydoesnotsup-portdirectprinting(orlogging)oferrors,thusdevelopersfacealotofchallengesindevelopinganddebuggingsmartcontracts.Asonedeveloperopined,ÒIntermsofthelanguage,Ithinkifafewfeaturessuchaserrorreportingisavailable,thatwillmakeabigdifferencetoeasethedevelopmentsinthefutureÓ(P11).LackofStandards/Rules.Severalintervieweesmentionedthatthereisascarcityofstandard/rules(e.g.,liketheERC20tokenstandardinterface)whichcanservethewhole21.http://github.com/pirapira/bamboo2092IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
developmentcommunity.P3mentioned:ÒProvidingstan-dardinterface(suchastheERC20fortoken),isevenmoreimpor-tantthanprovidinggeneralpurposelibraries.WelackstandardsinthisÞeldcurrentlyÓ.LackofSafetyChecksforDataTypes.TwointervieweesmentionedthatSoliditydoesnotprovideagoodcheckforthesafetyofdatatypes.P14stated:ÒSoliditydoesnotdowellincheckingthesafetyofdatatypes.Thecompilerdoesnothelpyouenough.WecannotrelyonthecompilertoletusknowtherecouldbeabughereÓ.InconvenientWaytoCallExternalFunctions.Manyintervieweesmentionedthatpassingparameterstocallexternalfunctionsisodd,e.g.,adevelopercannotdirectlypasshis/herowndefinedstructuretothefunc-tion,instead,he/sheshouldsplitthemandpassthemonebyone.P17stated:ÒInsolidity,structisonlyrecognizedwithinasmartcontract.IfSoliditycancreateawayofpackag-ingthestructinatransportablesortofdatastructurethatwouldbeusefulÓ.LackofSupportforMemoryManagement.OneintervieweementionedthatSolidityallocatesmemoryinaninvisiblewaythatyoucannotcontrol.Thismakesitdifficultfordeveloperstodevelopsmartcontractinaresourcecon-strainedenvironment.ÒSoliditydisguisessomeoftheunderly-ingoperationsofwhatyouÕredoingmorethanIwouldpreferpersonally,sosometimesyoucandothingsinSoliditythatappearedsimplebutactuallyresultedinconßictsunderlyingstatechangesormoreworkthanyouwouldexpect.Itdoesthingslikeallocatememoryinvisiblyandyouhavenocontroloverthat,soinaresourceconstrainedenvironmentsometimesthatcanbelessthanideal.Ó(P11)ConstrainedNumberofLocalVariables.SomeintervieweessaidthatSoliditysupportsalimitednumberoflocalvaria-blesandtosolvethisproblem,developersneedtousemorestatevariables,whichaffectstheefficiencyofcode.ÒIfafunctionusesmorethan16localvariables,itcannotbecompiled.Soyoumayhavetousestatevariables;buttheyareslowtoreadandwriteastheyarestoredinthestorageratherthaninthestackormemory.IfyoudonotwanttoloseprogramefÞciency,youmayhavetorefactoryourcode.Ó(P8)4.3.2MostDesiredSolidityImprovementsTohelpthecommunitysolvethelimitationsthatdevelopersaremostconcernedabout,weaskedeachsurveyrespon-denttoselectupto3improvementsthattheywouldliketoseeinSolidity.Sinceitisnotpossibletocoveralllimitationsbyinterviews,weprovidean“Other”textoptionthatallowsrespondentstofillrelevantimprovementstheywouldliketohave,whichdidnotcomeoutduringinter-views.Besides,weprovidean“IthinkSolidityisgoodenough”optionforanswercompleteness.Table4showsthevotes.InTable4,weobservethatonly6.5percentofthesurveyrespondentsagreedthatSolidityisgoodenough.Mostdevelopers’concernsaremainlyfocusedontheavailabilityoflibraries(includinggeneralpurposelibraries(with53.0percentvotes)andsomestan-dardinterfaces(with45.7percentvotes)),errorreportingfunctions(with48.7percentvotes),datatypechecking(with44.8percentvotes),andbetterwaytocallexternalfunctions(with35.8percentvotes).4.4EthereumVirtualMachine(EVM)4.4.1LimitationsofEVMUnliketraditionalsoftwarewhichrunonmatureandwell-testedvirtualmachineslikeJVMandCLR,smartcontractsonEthereumblockchainsareexecutedbyarelativelynewvirtualmachine,namelyEthereumVirtualMachine.Com-paredtotraditionalVMlikeJVM,thecurrentEVMhassev-erallimitations.Oursurveyresultsshowthat35.3percentofrespondentsvotedthatlimitationsofthecurrentEVMtobeoneofthetop-3majorchallengesthatpreventthemfromeffectivelydevelopingsmartcontracts.Fourmainlimita-tionsofEVMmentionedbyourintervieweesareasfollows:LimitedSupportforDebugging.Whenfailureshappen,developersneedhelptoknowwhere,why,andhowtheircodefails.Unfortunately,thesupportofdebuggingfeaturesthatcanprovidethisneededinformationislimitedinEVM.Forexample,althoughEVMsupportsthrowingexceptions,noinformativeerrormessagesaregiventodevelopers,thusgivingnocluesonwhatmightbetherootcauseoftheprob-lem.Ascommentedbyadeveloper,ÒYoucanonlythrowexceptionsincode.Butactually,whenyourtransactionsfailinEVM,sometimeseventheexceptionscannotbethrown.Inthatcase,wetotallyhavenoideawhatisgoingonÓ(P2).LackofSupportofTraditionalLanguages.Popularprogram-minglanguages(e.g.,RustorPython)arenotsupportedbyEVM.EVMinsteadonlysupportslanguagessuchasSolidityandVyper,whicharenewlyinventedbythesmartcontractcommunity.Thus,developers’familiaritywithpopularpro-gramminglanguagesmaynotbeapplicableforthoseEVM-supportedlanguages,incurringconsiderableamountoflearningcost.ÒIamfamiliarwithPython.Itisreallygood.IsitpossibleforEVMtosupportpython-likelanguage?Ó(P6)InefÞciencyofBytecodeExecution.ExecutionofbytecodeinEVMisnotspeedyduetoitsdesigntobesingle-threaded,accordingtoourinterviewees.Tomitigatethisproblem,developershavetofindwaystoexecutebytecodemoreeffi-cientlybythemselves.ÒEVMisasingle-threadedmachinethatcannotruntransactionsinparallel.ImeanitisinefÞcientinexe-cutingbytecode.ThismaybeabigproblemforpeoplewhohaveahigherrequirementonthetimelyreactionandveriÞcationoftheirtransactions.AndthisfurthermakesdevelopersÕlifeharder.Ó(P4)LimitedStackSize.TheEVMisastackmachineandallthecomputationsareperformedonanareacalledthestack.Thestackhasamaximumsizeof1,024itemswitheachitemhavingasizeof256bits.Thislimitedstacksizecouldmakeitverypainfulfordeveloperstocodetheirsmartcontracts.OneintervieweesaidthatevenaslightlycomplexsmartTABLE4ImprovementsDevelopersWouldMostLiketoHaveinSolidityImprovementVotesMoregeneralpurposelibraries53.0%Morepowerfulerrorlogging/reportingfunctions48.7%Morestandardinterfaces(e.g.,ERC20)45.7%Bettersupportforsecuritycheckingofdatatypes44.8%Moreconvenientandsecurewaytocallexternalfunctions35.8%Morepowerfulmemorymanagement18.1%Loosenthelimitednumberofglobalandlocalvariables13.4%IthinkSolidityisgoodenough6.5%Others5.6%ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2093Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
contractwouldeasilyreachthelimitofthestack.Inthiscase,aconsiderableamountofworkisrequiredtoredesignthecode.ÒWeoncedevelopedarelativelycomplexapplication,thatapplicationcouldnotbecompiledonlybecausewehaveanadditionaltemporaryargumentsincode…Tosolvethisproblem,wehadtosplitonefunctionintoseveralsmallfunctions,whichmakesthecodeveryugly.Ó(P1)4.4.2MostDesiredImprovementsforEVMNext,wewanttoidentifythemostdesirableimprovementsofEVMforwhichthecommunityshouldfocusmoreon.OursurveylistsanumberofEVM’sdesirableimprove-ments(asshowninTable5)derivedfromourinitialinter-views.Fromthislist,oursurveyrespondentscanselecttheimprovementsthattheydesirethemost.Inadditiontothefourpredefinedchoicesgiventorespondents,wealsopro-videdan“Other”optiontoallowsurveyrespondentstoproposecomplementaryimprovementsthattheywishtohave.Table5depictsEVMimprovementsoptionsgiventorespondentsandtheirpopularityamongrespondents’choices.Theresultssuggestthatbettersupportfordebug-gingisdesiredthemost(65.5percentofsurveyrespondentspickthisimprovement),followedbyimprovementinexecu-tionspeedofbytecode(31.9percent).Theabilitytosupportotherprogramminglanguagesisdesiredby26.7percentofrespondents.Interestingly,althoughmanyofourinterview-eesinitiallywishEVMtoloosenstacksizelimit,itisdesiredbyonly27.6percentoftherespondentsinthesurvey.RespondentsthataresatisfiedwithcurrentfeaturesthatEVMoffersonlymadeupof12.5percentoftotalvotes.4.5GasSomeintervieweesmentionedthatonesignificantdiffer-encebetweensmartcontractdevelopmentandtraditionalsoftwaredevelopmentliesinthegasmechanism.Thegasmechanismisuniquetosmartcontractdevelopment,wheretheexecutionofsmartcontractswouldcostgasandusersneedtopaythegasfee.Asaresult,developersneedtopayspecialattentiontogasconsumptionduringsmartcontractdevelopment.Someintervieweesalsomentionedsomedif-ficultiestheyencounteredinhandlinggasproblems.4.5.1SpecialAttentiontoGasConsumptionAsmentionedinSection2,platformslikeEthereumusethegasmechanismtocontroltheexecutionsofsmartcontracts.Majorityofintervieweesmentionedthatgasconsumptiondeservesspecialattentions.Thisisalsolatervalidatedinoursurvey–86.2percentofsurveyrespondentsdeclaredthatthey(often)paidattentiontogasconsumptionwhendevelopingsmartcontracts.Accordingtoourinterviewees,tworeasonsforwhygasconsumptionisspeciallyimportantareasfollows:GasisMoney.Oneintervieweeexplainedthat,onpublicblockchainplatformslikeEthereum,alltheresourcesthatasmartcontractusedwouldtranslateintoactualdirectcoststhatneedtobepaidbyusersintermsofgas.Inotherwords,ÒGasismoneyforusersÓ(P1),thusdevelopersneedtobemuchmoreconsciousonresourceconsumption.ÒContractsfortheEthereumblockchainhavetobeexecutedunderverytightconstraints.Alltheresourcestheyusedwouldtranslateintoactualdirectcosts.Ó(P11)TransactionFailureDuetoInsufÞcientAmountofGas.SomeintervieweesmentionedthatonEVM,ifatransactionofsmartcontractisnotgivensufficientamountofgas,thetransactionmightfail.Indeed,oursurveyresultsshowedthat35.3percentofrespondentsoftenencounteredtransac-tionfailurescausedbyrunningoutofgas.ÒYoucanspecifyhowmuchgasyourtransactionisallowedtouse;ifyourtransac-tionrunoutofgas,itwouldfail.IoftenmettransactionfailuresduetoinsufÞcientgasformyapplication.Ó(P6)4.5.2DifÞcultyinHandlingGasProblemsInoursurvey,63.4percentrespondentsagreedthatgasoptimizationisalwayspainful,especiallyforcomplexapplications.Accordingtoourinterviewees,twoaspectsthatcontributetodifficultiesinperforminggasoptimizationareasfollow:NoGasEstimationToolatSourceCodeLevel.Developersoftendesiretowriteandoptimizesourcecoderatherthanbytecode,becauseitismoreintuitivewhenworkingatsourcecodelevel.Unfortunately,therecurrentlyexistsnogasestimationtoolforsourcecode.Tooptimizetheirsourcecodewithrespecttogasconsumption,developersthushavetoalternativelyresorttoavailablegasestimationtoolsatbytecodelevel(suchasRemix22),whichmaynotfullyreflecttheeffectofchangesatsourcecode.Thisapproachishencenotintuitiveanderror-prone,renderingitdifficultfordeveloperstoperformsourcecodeoptimization.ÒWeonlyhavebytecodeleveldynamicgasestimationtools.Whatwedorightnowtooptimizecode,istomodifythecodeandrunthemodiÞedprogram,andtrytocomparethegasconsumptionwiththepreviousprogrambeforemodiÞed.Itisverytimeconsumingtodothisactually.Ó(P2)Ahighdemandoneffectivesource-code-levelgasesti-mationtoolsismentionedbyamajorityofourinterviewees.Suchtools,whichcandirectlyidentifythepieceofsourcecodethatismostgascostly,wouldbeoftremendousvalue,accordingtointerviewees.ÒWehaveabadneedingasestima-tiontools.Ideally,Ihopewecanhaveatoolthatdoesnotneedtocompileyourcodeandcantellyouhowmuchgaseachsourcecodelinecosts.Ó(P1)TradeoffbetweenGasOptimizationandCodeReadability.Accordingtoourinterviewees,optimizinggaswithouthurtingcodereadabilityisoftenatrickyproblem.ÒIfyouwanttospendlessgas,youhavetomakeyourcodemoreefÞcient,soshorterbasically,havefewerinstructions.ButifyouhavefewerTABLE5ImprovementsthatDevelopersWouldLiketoHavetheMostinEVMBettersupportfordebugging65.5%Improveexecutionspeedofbytecode31.9%Loosenthestacksizelimit27.6%Abilitytosupporttraditionallanguages26.7%IthinkEVMisgoodenough12.5%Others9.6%22.http://remix.ethereum.org2094IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
instructions,ittendstomakeyourcodelessreadableaswell,soitÕsadilemma.Ó(P14)4.6OnlineResourceandCommunitySupportSomeintervieweestoldusthatfortraditionalsoftwaredevelopment,wecangetalotofhelponlinewhenweencounterproblems;whileforsmartcontractdevelopment,theresourceandmentorsarescarcebecauseÒsmartcontractisverynewontheblockchainÓ(P16).22.8percentofthesurveyrespondentsvotedthatlackingenoughonlinelearningresourceandsupportivecommunityisoneofthetop-3majorchallengesthatpreventthemfromeffectivelydevel-opingsmartcontracts.4.6.1OnlineLearningResourcesAfteranalyzingtheinterviewandsurveyresults,wefinddevelopersmainlymentionedthreekindsofonlinelearningresourcesthataremissing,i.e.,referencecode,standardizedknowledge,andup-to-datedocumentations.LackofReferenceCode.Someintervieweestoldusthatsincetherearenotenoughonlinereferencecodetoreuse,whentheybuildnewsmartcontractapplications,theyhavetobuildthemfromscratch.ÒSoIprogrammedalotinpythonandc++andjavascript,andtheyallhaveframeworks,theyallhavelotsofcode.Thesolidityhasnothingtotestyourcodeon.IfIwanttodosomethingnew,therewasnothingontheinternetlikethat,Ihadtoinventit,Ifeellikefromscratch.Ó(P13)LackofStandardizedKnowledge.Onesurveyrespondentcommentedthatnostrictstandardizedknowledgecanguidedeveloperstowritebettercodeinaneasierway.ÒChaoticnonstandardizedknowledge.i.e.,nostrictstandards(eventhoughtherearerecommendations-erc).Communityinten-tionally(scam)orunintentionallyallowbugsthatarelaterexploited.Basicallynotmatureenoughapproaches.Ó(S92)Oneintervieweehighlightedtheimportanceofcodingconventionandbestpractices.ÒWhatÕsmissingis,whenyouwritepythoncodetherearecodestandards,andIdidnÕtÞndanythinglikethatforSolidity.IdonÕtknowwhatbestpracticesareforcode,andsoevenifIwantittofollowthemIcouldnÕt.Ó(P13)Someintervieweesthinkweshouldhaveguidestohelpdevelopersbettertesttheirsmartcontracts,andasshowninTable3,22.4percentsurveyrespondentsconsiderthelackoftestingguidanceasamajortestingchallenge.ÒIdonotknowwhatisthebestwaytodotesting,thereisnotestingguid-ancethatIcanfollow.Ó(P10)LackofUp-to-DateDocumentations.Someintervieweesmentionedthatdocumentationsareoftenout-of-dateduetothequickevolutionofrelevanttools.Suchoutdateddocu-mentationoftenmakedevelopersfeelhelplesstomakefullandcorrectuseofthetools.ÒRightnowyouhavedocumenta-tionaboutTrufße,aboutSolidity,aboutweb3,abouttestrpc.TheyÕreallseparate,theyareallevolvingatdifferentspeeds,andtheyarenotupdatedasfastastheycould.Intheend,developersneedtouseallthosetoolstogether,andyetthedocumentationisreallyinconsistentandnotalwaysup-to-date.Ó(P14)Oneintervieweesuggestedthatitisnecessarytoenrichthedocumentationforsomeimportanttools(suchasTruf-fle),e.g.,bytryingtoprovidemorecodeexamplesofsomemediumandcomplicatedapplications.ÒIthinkTrufßewouldbebetterifithadmorecodeexamples.Trufße,whenIused,ithadlikeÕhelloworldÕ,howtogetsayÕhelloÕandhadasmartcontract,smarttoken,andthatÕsallthathad.ThereÕsalotofthingspeoplearebuildingwithtrufße,buttheyreallyhadnothing,theydidnÕthavealotofexamplesforyoutobuildupthetrufße,formethesearereallysimpleexamples.Ó(P13)4.6.2CommunitySupportSomeintervieweessaidthatalthoughthecommunitysup-portforsmartcontractdevelopmentisincreasing,thesup-portisstilllimited.Whentheyencountersomeproblemsorwanttoaskforsomehelptoe.g.,reviewtheircode,theycannoteasilyfindrelevantdevelopers.Oneofthemmen-tioned,ÒSincethetechniqueisnew,thecommunityisstillindevelopment.Sometimesyoucannotgettimelyhelpfromthecom-munitywhenyougetstuckÓ(P16).AnotherintervieweeP13commented,Òifyougooncodereviewforajavascriptorpython,youwillgetlotsofpeoplewhogiveyoufeedback,butinSolidity,yougotnofeedback.Asahobbydeveloper,werelyonthecommu-nitytogiveusfeedbackandcodereview,andifyoudonÕthavethat,weÕregonnadowhateverwethinkisrightÓ.4.7SurveyResultsTable6lists28challengesanddesiredimprovementsmen-tionedbyintervieweesintheaboveSections4.1,4.2,4.3,4.4,4.5,and4.6.C1toC6weresixmajorchallengesonthewholeofsmartcontractdevelopment.C7toC17werechallengesdeveloperswerefacingduringdifferentstages(e.g.,coding,testing,debugging)ofsmartcontractdevelopment.I18toI28representeddesiredimprovementsofSolidityandEVM,respectively.ThelastcolumnofTable6isthenumber(ratio)ofrespondentswhovotedforthecorrespondingchallengesordesiredimprovements.Forchallenges/improvementswith“(top-3)”,thevaluesrepresentedhowmanyrespondentsratedthemasoneofthetop-3challengesordesiredimprovements.Forexample,166(71.6percent)outof232respondentsratedC1asoneoftop-3challenges(outofsix)duringtheirsmartcontractdevelopment.AstheoverallvotingresultsofindividualchallengesordesiredimprovementshavebeenmentionedinSections4.1,4.2,4.3,4.4,4.5,and4.6,herewemainlyfocusonanalyzingthevotingresultsofdifferentdemographicgroupstowa-rdsthese28challengesanddesiredimprovements(c.f.,Section3.2foradescriptionofthemethodologythatwefollow).Table7showsthedetailedvotingresults.FromTable7,wecouldobservethatthevotingresultsvariedfromdemographicgroups.Forexample,forC2,theratiosofscExpMandscExpLwere57.9and58.1percentwhiletheratiowasonly34.4percentforgroupscExpH.Anotherexample,forC3,theratiosofDev,Test,andPMwere38.4,83.3,and47.6percent,respectively.Tocheckwhethertheobservedratiodifferencesarestatisticallysig-nificant,foreachchallenge/desiredimprovement,weappliedFisher’sexacttestwithBonferronicorrectiononfivesetsofdemographicgroups,i.e.,groupswithdifferentroles(DevversusTestversusPM),groupswithdifferentexperienceingeneralsoftwaredevelopment(seExpHver-susseExpMversusseExpL),groupswithdifferentexperi-enceinsmartcontractdevelopment(scExpHversusscExpMversusscExpL),groupswithdifferenteducationZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2095Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
degrees(AdvversusnAdv),andgroupsworkingondiffer-entkindsofblockchains(pubBlkversusnPubBlkversusbothBlk).Afterconducting392(14grouppairs28challenges/improvements)Fisher’sexacttestswithBonferronicorrec-tions,wefoundthattherewerethreetestsshowingthattherelevantdifferenceisstatisticallysignificant.TheyarescExpMversusscExpLonC6(p-value=0.002<0.05/3afterBonferronicorrection),pubBlkversusnPubBlkonI24(p-value=0.006<0.05/3afterBonferronicorrection),andAdvversusnAdvonI28(p-value=0.038<0.05,Bonferronicorrectionisnotneededforthesingletest).Basedonthetestingresults,wecansaywithsomecer-taintythat:Developerswithlowexperienceinsmartcontractdevelopment(scExpL)aresignificantlymorelikelytorateC6(limitedonlinelearningresourceandcom-munityhelp)asamajorchallengetheyarefacingduringsmartcontractdevelopment,thanthosewithmedianexperience(scExpM)(32.3percentversus13.2percent).Developerswhomainlyworkedonnon-publicblockchainsdesiredI24(looseningthelimitednum-berofglobalandlocalvariablesofSolidity)more,thanthosemainlyworkingonpublicblockchains(pubBlk)(37.5percentversus9.9percent).Developerswithoutadvanceddegree(nAdv)desi-redI28(EVM’ssupportfortraditionalprogramm-inglanguages)morethanthosewithanadvanceddegree(nAdv)(32.1percentversus19.8percent).4.8SummaryofResultsThroughtheanalysisofinterviewandsurveydata,wecouldfindthat:Smartcontracthasahighrequirementforcodesecu-rity.However,developerscurrentlyhavenoeffectivewaytoassurecodesecurity;sometoolslikecodeauditingandformalverificationtechniquesarehighlydesired.Currently,developersmainlyusedtestingandcodereviewstohelpensurecodecorrectness.Currentdebuggingtoolsareprimitiveandinefficient,whichmakesdebuggingverypainfulinpractice;morepowerfulinteractivedebuggerswhichprovideinformativeerrormessagesarebadlyneeded.UndesirablecharacteristicsofSoliditylanguage(e.g.,difficultyinpassingdatatoexternalfunc-tions,limitationsinthenumberofvariables),compiler(backwardcompatibilityandreliabilityissuesduetorapidlychangingcompileranditsunseenflaws)andEVM(e.g.,non-informativeerrormessages,limitedstacksize,inefficientexe-cutionduetosingle-threadedEVM),makeitverychallengingtoprogramsmartcontractseffectivelyandefficientlyinpractice.Thereisaneedforsource-code-levelgas-estimationandoptimizationtoolsthatconsidercodereadability.Thereisalackofbestpractice,codeexamples,com-munitysupport,third-partylibraries,andstandardsforsmartcontractdevelopment.5FUTUREDIRECTIONS5.1SecurityandReliabilityofSmartContractsDevelopersperceivesecuritytobecriticaltosmartcontracts.Pastreportshighlightawiderangeofvulnerabilitiesthataffectsecurityofsmartcontracts,e.g.,reentrancybug[90],TABLE628ChallengesandDesiredImprovements(MentionedbyInterviewees)withSurveyVotingResultsIDChallenges/Desiredimprovements#Votes(Ratios)Majorchallengesonthewhole(top-3)C1Itishardtoguaranteethesecurityofsmartcontracts.166(71.6%)C2Thereisalackofpowerfultools(e.g.,debugger,testingframework).127(54.7%)C3Currentprogramminglanguageshaveanumberoflimitations.92(39.7%)C4TheEthereumvirtualmachinethatrunssmartcontractshaveanumberoflimitations.82(35.3%)C5Itishardtohandleperformanceproblems.79(34.1%)C6Onlinelearningresourcesandcommunitysupportarelimited.53(22.8%)Challengesofdebugging,gasoptimization,andcodereviewC7Itisdifficulttodebugduringsmartcontractdevelopment.206(88.8%)C8Doinggasoptimizationisalwayspainfulespeciallyforcomplexapplications.147(63.4%)C9Itishardtofindqualifieddeveloperstofindsecurityflawsinsmartcontractcode.186(80.2%)C10Codereviewofsmartcontractsisverytimeconsuming.154(66.4%)Challengesoftesting(top-3)C11Difficulttoconsiderallcornercasesandscenarios.161(69.4%)C12Potentialunseenflawsincompilersandvirtualmachines.124(53.4%)C13Nomaturetestingframeworkslikeotherlanguages,e.g.,Java.94(40.5%)C14Notoolstomeasurethequalityofsmartcontracttestsuite.72(31.0%)C15Testingneedstobedoneinanasynchronousway.65(28.0%)C16Testingconsumegasesiftestedontestnetsormainnet.52(22.4%)C17Lackofusefulguidancefortesting,e.g.,bestpractice,tutorials,etc.52(22.4%)DesiredimprovementsofSolidity(top-3)I18Moregeneralpurposelibraries.123(53.0%)I19Morepowerfulerrorlogging/reportingfunctions.113(48.7%)I20Morestandardinterfaces.106(45.7%)I21Bettersupportforsecuritycheckingofdatatypes.104(44.8%)I22Moreconvenientandsecurewaytocallexternalfunctions.83(35.8%)I23Morepowerfulmemorymanagement.42(18.1%)I24Loosenthelimitednumberofglobalandlocalvariables.31(13.4%)DesiredimprovementsofEVMI25Bettersupportindebugging.152(65.5%)I26Improveexecutionspeedofbytecode.74(31.9%)I27Loosenthestacksizelimitation.64(27.6%)I28Beabletosupportothertraditionallanguages.62(26.7%)2096IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
etc.Sincemanydevelopersworkingonsmartcontractdevel-opmentarenewinthearea,theymaynotbeawareofthesevulnerabilities.Thereisalsomuchcodeduplicationinsmartcontracts[71];copy-pasteisacommondevelopmentmethod.Bycopy-and-pasting,vulnerablecodecaneasily“infect”othercode.Thus,thereisaneedfortoolsupportstohelpdevelopersnotonlytodetectbutalsorepairvulnerabil-itiestopreventthemfrom“spreading”further.Relativelymaturebugfindingandautomatedcodeinspectiontoolsexistforconventionalsoftware,e.g.,Find-bugs,23FacebookINFER[20],etc.;howeverthesetoolsarenotabletobeusedtostaticallycheckandidentifysmartcontractvulnerabilities.Existingtoolsthatdetectsmartcon-tactbugs,e.g.,Oyente[90],arerelativelynew,andmuchmorestudyisneededtodemonstratetheirefficacyintermsoflowfalsepositiveandfalsenegativerate.SuchstudieshavebeendoneforFindbugs,andothertoolsforconven-tionalsoftware[120]buttherearenosimilarstudiesyetforsmartcontracttools.Moretesting,fuzzing,andconcolictestingtoolscanalsobedesignedtoaugmentexistingstaticanalysistoolstoimprovetheirefficacy.Besides,formalveri-ficationisalsoofgreatdemandtoreducethepossibleadverseimpactofsmartcontractvulnerabilities.Someresearchershavetriedtouseformalverificationmethodstoprovethecorrectnessofsmartcontracts[4],[14],[61].How-ever,theseapproachesarestillnotmatureyetandhavenotbeendemonstratedtoscaletoalargenumberofsmartcon-tractsofvaryingsizes.Programrepairshaverecentlybecomemorematurewithindustrialadoption.Facebookisnowusingautomatedpro-gramrepairtofixitsapps.24Smart-contractspecificrepairsolutionscanalsobedesignedtoautomaticallypatchvul-nerabilitiesinsmartcontract.Genericrepairisverydifficult;butwhatworksverywellinpracticearepatchingspecifickindsofvulnerabilities.AnovelprogramtransformationtoolextendingexistingtoolsthatworkforCandJava,suchasCoccinelle[111]orSpoon[115],canpotentiallybedesignedforSolidity.Next,requiredtransformationscanbespecifiedassemanticpatches[104]andappliedtopatchexistingsmartcontractsthatsufferfromvulnerabilities.DevelopersalsomentionedbugsinSoliditycompiler.Thisisaseriousissuesincesuchbugscantranslatetovul-nerabilitiesandunreliableexecutionsofmanysmartcon-tracts.Morematurecompilerslikegcchaveshowntobebuggy[138]andcompilertestingsolutionshavefoundTABLE7VotingResultsofDifferentDemographicGroupsTowards28ChallengesandDesiredImprovementsMentionedbyIntervieweesIDDevTestPMseExpHseExpMseExpLscExpHscExpMscExpLAdvnAdvpubBlknPubBlkbothBlkTotal19062176797732761241011311611655C173.250.057.173.772.268.875.071.171.067.374.871.475.070.9C254.766.752.459.249.455.834.457.958.160.450.452.875.054.5C338.483.347.638.235.445.543.840.837.943.636.637.350.043.6C434.733.342.935.532.937.746.934.233.135.635.136.025.036.4C532.633.347.627.634.240.337.539.529.834.733.629.856.340.0C621.116.742.927.613.927.39.413.232.321.823.722.425.023.6C789.5100.085.794.786.185.781.389.590.389.188.590.787.583.6C862.650.061.967.157.066.246.967.165.367.360.360.281.367.3C982.166.771.485.575.979.275.080.381.584.277.180.781.378.2C1065.350.066.763.268.467.578.167.162.967.365.670.262.556.4C1170.083.361.977.663.367.575.071.166.965.372.569.656.372.7C1253.766.761.943.460.855.853.155.352.448.557.350.356.361.8C1340.550.033.332.939.249.434.447.437.940.640.536.056.349.1C1431.10.033.332.924.136.428.130.332.332.729.826.137.543.6C1529.533.319.027.631.624.737.528.925.021.832.828.043.823.6C1624.716.719.021.125.320.818.825.021.822.822.121.125.025.5C1723.216.728.628.920.318.218.821.124.222.822.122.412.525.5I1851.150.085.752.650.655.859.451.352.452.553.450.956.358.2I1950.033.323.860.545.640.343.860.542.751.546.646.650.054.5I2047.416.757.144.749.442.953.142.146.043.647.347.231.345.5I2143.283.347.656.638.040.346.946.143.547.542.744.756.341.8I2235.833.342.934.232.940.321.930.342.737.634.431.743.845.5I2318.916.714.39.221.523.415.613.221.814.920.618.66.320.0I2412.133.39.55.310.124.76.318.412.117.89.99.937.516.4I2566.866.761.973.758.264.965.663.266.969.362.660.968.878.2I2631.666.728.627.626.641.634.431.631.531.732.130.456.329.1I2728.90.019.028.926.627.331.334.222.627.727.524.231.336.4I2826.833.323.818.427.833.821.922.430.619.832.126.718.829.1TheTotalrowrepresentsthenumberofrespondentseachgrouphas.TherowsC1toI28representthepercentages(%)ofrespondentsfromeachdemographicgroupwhovotedfor28challengesanddesiredimprovements;forexample,thevalue73.2intheC1rowmeansthat73.2%respondentsfromtheDevgroup(whichhas190respondents)ratedC1asoneoftop-3majorchallengestheywerefacingduringsmartcontractdevelopment.23.http://findbugs.sourceforge.net/24.https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2097Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
manyofsuchbugs.ThereisaneedforafurtherstudytodemonstratetheextentexistingcompilertestingsolutionscanworktoidentifybugsinSoliditycompilersanddesignstepstoadaptthesolutionsforthemtobemoreeffectiveforSolidity.Developersarealsoinneedforbestpracticesandcodesmellsthatmaypreventthemfromintroducingvulnerabilities.Systematicliteraturereviewandcatalog-ingofsuchvulnerabilitiesisonefirststep.Designingcommonrepositoriestostorecommonvulnerabilitiesspecifictosmartcontact-insimilarfashionlikeCVE25–isanotherstep.OperationalizingCVEintotools,e.g.,[132]isyetanotherstep.5.2OtherFactorsAffectingSmartContractDevelopmentAsidefromsecurity,manyotherfactorsaffectsmartcon-tractdevelopment.Here,wehighlightfivedifferentaspectsofsmartcontractdevelopmentthatposeopenresearchproblemsrequiringadvancesinthefield.5.2.1ProgrammingLanguageandVirtualMachineDesignSolidityandEthereumVMareintheirinfancyanddevelop-ersoftenencounterdifficultiesindevelopingsmartcon-tractsduetotheirlimitations(e.g.,typechecking,memorymanagement,multi-threadingsupport,etc.).Thesehigh-lightsopportunitiesforresearchtoaddadditionalfeaturesinSolidityandEthereumVM.Additionalconsiderationneedstobeputinthedesignofthesefeaturesconsideringspecificconstraintsforsmartcontractandtheuniquewayitisdeployedandruninadistributedmanner.Forexample,addingmulti-threadingsupporttoEthereumVMisnon-trivial.“Aminercannotsimplyexecutethesecontractsinparallel,becausetheymayperformconflictingaccessestoshareddata,andanarbitraryinterleavingcouldproduceaninconsistentfinalstate.”[39]Wehaveseenrecentearlyworkproposingthesemissingfeatures,e.g.,[33],[116],thatrequiredeeptechnicalnoveltyas“porting”featuresfromapopularprogramminglanguage(e.g.,Java)toSolidityandapopularVM(e.g.,JavaVM)toEthereumVMarenon-trivial.Existingproposedresearchsolutionsoftenhavetrade-offorintroduceadditionalcomplexitiesthatmaypre-venttheiradoptions;furtherresearchisneededtodevelopadditionalsolutionsthatmayconsiderothertrade-offstohelpEthereumVMandSoliditylanguagedesigners/main-tainersdecidethemostpromisingapproachordirectionthatthecommunityshouldtake.Thesedecisionsneedtobetakencarefullyasitwillhavelongtermimplications.Anotherpossibledirectionistoenabledeveloperstocodeintheirlanguageofchoice(orarestrictedsubsetofthatlanguage)andallowtheircodetobetranslatedtoSolid-ity.RecentresearchhaveexploredwaystotransformJavatoC#[107],[157].TheremayalsobesolutionsdevelopedtotransformcodewritteninlanguagessuchasJavascript(whichhasalargedeveloperbase,andissimilartoSolidity)toSoliditycode.5.2.2BetterResourceManagementSmartcontractdevelopersneedtooptimizeforgasandeffi-ciencywhileconstrainedwithstacksize,numberoflocalvar-iables,etc.Thismakesitharderfordeveloperstofocusondesigningcoolnewfeatures.Manualoptimizationoftheseconsiderationsalsoposeotherissues(e.g.,readability).Thus,newsupporttohelpdevelopersoptimizeforgasconsideringthevariousconstraintsisneeded.Currentsolutiononlypro-videsestimateforbytecodebutdevelopersmayneedsupportforsourcecodeanddevelopersmayalsoneedrecommenda-tionsonwaystooptimizecode.Solutionsthatcanautomati-callyandsafelytransformacodethatisreadable(todevelopers)butdonotsatisfyconstraintsintoanothercodethatsatisfyconstraints(butislessreadable)seamlesslymayalsobeindemand.Thesesolutionsarenon-trivialandfurtherresearchisneededinthesedirections.Existingresearchonprogramtransformations,e.g.,[91],[99],[141]canbeagoodstartingpointindesigningthesesolutions.5.2.3LibraryConstructionDevelopersareinseriousneedoflibraries.Thelevelofcoderedundanciesamongdeployedsmartcontractsishigh–thishighlightsthatdevelopersarereinventing-the-wheeloften.Thisisnotsurprisingasmodernsoftwareareoftenbuiltontopoflibraries–forexample,librariescancompriseofmorethan90percentofawebapplication.26Toolsareneededtoidentifyreusablecommoncomponentsusedinmanysmartcontractsandorganizethemintoeasy-to-findandeasy-to-useclasses,methods,andlibraries.Methodsfromclonedetection[72],[148]andcodecategorization[73],[102],[130]canpotentiallybeemployedtoconstructsuchlibrar-ies.Securityconsiderationsneedtoalsobeconsideredintheconstructionofsuchlibrariestoensurethatvulnerabil-itiesdonotspreadthroughlibrarydependencies,c.f.,[36].5.2.4Evolution,Maintenance,andDeploymentofSmartContractsAsonedevelopermentions,onceasmartcontractisdeployeditisnotpossibleforittobemodified.Thereareworkaroundstoaddresstheevolutionofcontracts(withvaryinglevelsofdifficultyandimpacttousers),suchasbyusingdetegatecall(i.e.,separatingdataandlogicofasmartcontractinseparatecontractsandlettingthedatacontractcallthelogiccontractthroughdelegatecall),27orusingareg-istrycontracttostorelatestversionofacontract,28etc.How-ever,nosystematicstudyhasbeendoneontheadvantagesanddisadvantagesofdifferentmaintenanceoptions.Fur-therstudyisneededtoexplorethisandtopossiblydevelopnewmaintenance,evolution,anddeploymentmethodsthatpreventsmartcontractevolutiontoadverselyaffectdevel-opersandusers.SolidityAPIalsochangesfrequentlyandareoftennotbackwardcompatible.ThereareneedstohelpdevelopersevolveSoliditycodeto“catchup”withAPIevolution.25.http://cve.mitre.org/26.http://www.linkedin.com/pulse/how-can-you-ensure-your-open-source-components-secure-sharma/27.http://blog.trailofbits.com/2018/09/05/contract-upgrade-anti-patterns/28.https://ethereum.stackexchange.com/questions/2404/upgradeable-smart-contracts?noredirect=1&lq=12098IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
Studiesareneededtoexploreifexistingresearchsolu-tions[57],[63]workwellforSolidityAPIandifnot,novelssolutionsareneeded.Developersalsoexpressedtheirdesireforup-to-datedocumentationsfortools/languagestheyareusing.Itwouldbevaluabletofindproperapproachesthatcanhelpautomaticallyupdateorevengeneratedocumenta-tionandlinkpiecesofdocumentationfromdifferentsour-cesontheinternet.Ideasfromexitingstudiesthatrecommendingadaptivechangesfordocumentationevolu-tion[35]anddetectingAPIdocumentationerrors[156]mayhelpinthisdirection.5.2.5SupportingEnd-UsersSmartcontracttechnologyhasagreatpotentialinthefinan-cialdomainwhileitsdevelopmentisstillnascent.Tofacili-tatethewidespreadadoptionofsmartcontractsinfinanceindustry,somebiginvestmentbanks(e.g.,EuropeanBankforReconstructionandDevelopment(EBRD)),InternationalSwapsandDerivativesAssociation(ISDA),leadinglawfirms(e.g.,Linklaters),aswellassomeresearchers,havebeenworkingtodevelopasetofbestpracticeandindustry-widestandardsintermsoftheconstruction,execution,andvalidationofsmartcontractsfrombothlegalandtechnicalperspectives[28],[29],[32],[65],[66].Relatedtotheconstruc-tionofsmartcontracts,anoticeableproblemisthatdevelop-ersofsmartcontractsmaynotbefinancedomainexperts.Thereisaneedtoenablefinancialexpertstowritesmartcontractsdirectlywithoutintermediaries.Intermediariesmayintroducemiscommunicationandbugs[1].Simplifieddomain-specificlanguageshavebeendesignedformanyareas,e.g.,ABBhavedesignedasimplifiedlanguagetoenableenduserstodirectlyprogramrobotswithmoreease[131].Similarsolutionscanalsobedesignedforsmartcontractdevelopment.ThesesolutionsmayinvolvedesignofaspecializedDomainSpecificLanguage,text-to-codesol-utions,programsynthesisfromexamples,botsthatcanclar-ifyrequirementsfromfinancialexperts,etc.Priorworkhaveshownthatthesetechnologiesarefeasibleforspecializeddomains[8],[150],butmoreeffortneedstobeinvestedintheirdesign.6THREATSTOVALIDITYInternalValidity.Inourpaper,wedesignedoursurveyquestionsbasedontheinterviewresults.However,itispos-siblethatwemaydrawwrongconclusionsfrominter-viewees’comments.Toalleviatethisthreat,wetriedtoreadtheinterviewtranscriptionseveraltimes;andeachstepofcardsortingofinterviewcommentswasperformedandver-ifiedbytworesearchers.Besides,beforesendingtheques-tionstoourpotentialsurveyrespondents,weconductedapilotstudyinwhichweasked5developerstofillthesurveyandcollectedtheirfeedbacksonthequestionsandansweroptions.Refinementissubsequentlymadebasedondevel-opers’comments.Itisalsopossiblethatsurveyrespondentsmayhavepro-videddishonestanswers(e.g.,sayingwhattheywantustohearorsayingwhatwewanttohear)duetovariousrea-sons.Tohelpreducethisbias,wemadethefollowingefforts:(1)Inoursurveyinvitationletter,weexplicitlymen-tionedthatnopersonalinformationwouldbedisseminatedinourpaper.(2)Weallowedoursurveyrespondentstobeanonymous;theyareuntraceableiftheydonotleaveemailaddresses;andtheycanalsoleavenew/anonymousemailaddresses.Accordingto[110],confidentialityandanonymityhelpedinobtainingun-biasedanswersfromsurveyrespondents.Besides,followingtheadvicein[78],i.e.,usingtheproperlanguagemediumforintendedrespondents,wealsotranslatedoursurveyintoChinesetoensurethatrespondentsfromChinacanunderstandoursurveyques-tionswell.WeonlyhaveoursurveyinEnglishandChinesesinceEnglishisalinguafrancaandChineseisthemostspo-kenlanguageintheworld.Duringresultanalysis,similarly,itisalsopossiblethatwemaydrawwrongconclusionsaboutsurveyrespondents’perceptionsbasedontheircom-ments.Toalleviatethisthreat,wealsotriedtoreadthesur-veycommentsseveraltimes.ExternalValidity.Followingthestrategyofpreviousstud-ies[6],[134],westoppedourinterviewswhenwereachedthesaturationoffindingsafterinterviewing20persons(thisnumberwasalsosimilaraspriorstudies[60],[94]).Wehavetoadmitthatthenotionof“saturationoffindings”mayintroduceinterviewersubjectivityandriskmissinginformation.Toavoidtheseproblems,wetriedtoincludetwointerviewersforeachinterviewbasedonbothinter-viewees’andinterviewers’schedules.Intotal,15outofthe20interviewswereconductedbytwointerviewers.Theyworkedtogethertotakememosandaskedquestionsduringinterviews.Havingtwointerviewerscouldhelpus:(1)cap-tureasmuchrelevantinformationaspossibleduringinter-views(someinformationmaybemissedbysingleinterviewer),and(2)reducethechanceofunfairsubjectivebiasinthediscussionofwhetherthesaturationoffindingshasbeenreached(wehadamorecomprehensivenoteforcomparisonwithpreviousinterviewnotes,andbyhavingmultipleinterviewers,collectively,wecouldbetterrecallthedetailsofwhathappenedorwhatwasdiscussed).Consideringtheremayexistotherpopulationswhomightaddnewinsights,wealsoneedtoacknowledgethattheopinionsprovidedbyourintervieweesmaynotberep-resentativeofandagreeabletothewholecommunity.Toreducethisthreat,weensuredthatourintervieweesholdvariousrolesandhavedifferentlevelsofexpertise,e.g.,developers,trainers,CEOsincompaniesdevelopingsmartcontractapplications,etc.Webelievethattheircommentsstilluncoveredvariousinsightsintothechallengesofsmartcontractdevelopment.Tovalidateourinterviewfindings,weconductedasur-veywith232developersfrom48countries.Asourrespond-entsweremainlyrecruitedthroughGitHub,wemayriskignoringsomedevelopers(e.g.,fromproprietarysmartcon-tractdevelopment)whoareunlikelyorarenotpermittedtorespondtooursurvey.Thuswecannotguaranteethatourfindingscouldbegeneralizedtoallrelevantsmartcontractpractitioners.However,ourrespondentshaddifferentexpe-riencelevels,educationalqualifications,andcontributetovariousprojects(includingopen-sourceandclose-sourceprojects)ondifferentblockchainplatforms(includingpub-licandnon-publicblockchains).Suchadiversityinback-groundstoalargeextent,madeusbelievethatoursurveyresultsstillprojectedvaluableinsightsintothechallengesofZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2099Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
smartcontractdevelopment.Tofurtherimprovethegener-alizabilityofourfindings,weencourageotherresearcherstoreplicateourstudywithmoredevelopersinthefuture.7RELATEDWORKInthissection,wehighlightrelatedworkonsmartcon-tract,includingempiricalstudiesonsmartcontract,toolsdevelopedforsmartcontract,andstudiesonchallengesandopportunitiesinotherdomainsoutsideofsmartcontract.EmpiricalStudiesonSmartContract.Therapidgrowthofsmartcontractdevelopmentmotivatedaseriesofempiricalstudies.Thesestudiesmainlyaimedtoexplorethecharac-teristicsandpotentialimpactofsmartcontracts[11],[69],summarizedevelopmentpatternsorlessons[37],[151],evaluateexistingprogramminglanguagesandtechniques[53],[112],proposesomefeasiblestrategiesforsmartcon-tractprogrammingandaltering/undoing[1],[64],[96],etc.Bartolettietal.studiedtheapplicationdomainsanddesignof834verifiedsmartcontractsfromBitcoinandEthereum[11].Fr€owisetal.investigatedtheproblemofcon-trolflowimmutabilityofsmartcontactsonEthereum[45].Bartolettietal.analyzedhowsmartcontractcanbeusedtoimplementPonzischemesonEthereum[9]whileJuelsetal.mentionedthefeasibilityofperformingcriminalactivitiesonEthereum,e.g.,leakingsecretdocuments[69].Delmolinoetal.summarizedsomecommonmistakesthatstudentsmadeduringsmartcontractprogrammingclassesandprovidedaguidetohelppeopleavoidthosemistakes[37].Byapplyinggroundedtheoryintocollectedsmartcontractdata,Wohreretal.summarizedsomesecu-ritypatternsandcorrespondingsolutions[151].Unterwegeretal.presentedsomelessonstheylearnedduringtheirimplementationofaprivacy-preservingsmartcontractintheenergydomain[145].Parizietal.didanevaluationofusabilityandsecurityofsmartcontractprogramminglanguages[112].Theyalsodidanassessmentoverexistingsmartcontracttestingtechni-quesonEthereum[113].Grishchenkoetal.didanoverviewofvariousstaticanalysistoolsthatcanbeappliedtosmartcontracts,coveringformalsemantics,securitydefinitions,andverificationtools[53].Milleretal.providedanover-viewofexistingsmartcontractlanguagesandtoolsforana-lyzingsmartcontracts;theyalsopresentedsomeresearchchallengesforformalverificationmethodsandprogramanalysisappliedtosmartcontracts[100].Idelbergeretal.studiedtheutilityoflogic-basedsmartcontractsandexploredhowtheycouldbeusedinblock-chains[64].SergeyandHoborsuggestedtouseexistingfor-malmethodstoreasonaboutconcurrencyofsmartcontract[128].MarinoandJuelsdevelopedasetofstandardsforalteringandundoingsmartcontacts[96].Khaliletal.sug-gestedthatmoreattentionbeingpaidtothetraditionaldevelopers(i.e.,thelawyers)ofcontracts[1].Clacketal.arguedthataformallanguagewhichhandlesover-the-counterfinancialsmartcontractderivativesneedstocom-binetemporal,deonticandoperationalaspectsforsuchaformalism[31].Destefanisetal.calledforadefinitionofblockchainsoftwareengineeringtohelpsolve/avoidsomesmartcontractissues[38].Unliketheabovestudiesthatmainlyfocusonperform-ingempiricalanalysesonspecificaspectsofsmartcontracts(e.g.,specificapplicationdomainsorsecuritypatterns),ourstudyexploredthemajorchallengesdevelopersarefacingduringsmartcontractdevelopment.Throughinterviewsandafollow-upsurvey,weidentifiedseveralmajorbarriersthatpreventdevelopersfromeffectivelydevelopingsmartcontracts.ToolsforSmartContract.Variouskindsoftoolshavebeenproposedtoresolvesmartcontractrelatedproblems,rang-ingfromdetectingbugs[4],[50],[61],[90],guardingdataprivacy/quality[123],[154],toeasingsmartcontractcrea-tion[44],[97]andmanualanalysis[15],[158].Duetothenatureofsmartcontracts,bugstendtobecostly,thussubstantialeffortshavebeenmadetodetectvul-nerabilitiesofsmartcontractsortoprovethecorrectnessofsmartcontracts.Luuetal.developedOyentetoidentifysev-eralpre-definedkindsofsecuritybugs(suchastransactionorderdependency)[90].Nikolicetal.developedMAIANtoidentifygreedy,prodigal,andsuicidalsmartcontracts[108].Liuetal.developedReGuardtodetectreentrancybugsthroughfuzztesting[87].Chenetal.andGrechetal.attemptedtoidentifygas-relatedproblems[22],[23],[50].Marescottietal.furtherproposedtwoapproachesinspiredbymodel-checkingtechniquestocomputetheexactworst-casegasconsumptionforsmartcontracts[95].Chenetal.proposedamethodtodetectpotentialPonzischemesonEthereum[24].Tsankovetal.developedSecurifytodetectseveralkindsofsecuritybugsbyinspectingwhetherornotsmartcontractbehaviorviolatedcertainsemanticpatternsderivedfromcontrol-anddata-flowdependencieswithinsmartcontract[143],[144].Grishchenkoetal.andGrossmanetal.triedtodetectvulnerabilitiesthroughreachabilityanalysis[51]andeffective-callback-freeobjectsdetection[54].Jiangetal.developedContractFuzzertodetectsecurityvulnerabilitiesthroughgeneratingfuzzinginputsandinstrumentingEVM[67].Liuetal.attemptedtopredictpotentialvulnerabilitiesbyidentifyingirregulartokensequences[88].Tikhomirovetal.developedSmartChecktodetectpotentialproblemsbycheckingagainstXPathpat-terns[142].Kruppetal.developedTEETHERtoautomati-callygenerateanexploitforasmartcontractgivenitsbinarycode[81].Wangetal.proposedarandombasedandaNSGA-IIbasedmulti-objectiveapproachtogeneratecost-effectivetestsuitesforsmartcontracts[149].Theyfurtherexploredthepotentialofapplyingmutationtestingintosmartcontracts[84],[153].Toprovethecorrectnessofsmartcontracts,someresearchersproposedtouseformalverificationmethodstoperformcompleteanalysisofsmartcontractsbyusinginter-activetheoremprovers[4],[13],[14],[61],[109],suchasIsabelle/HOL,29F*,30Why3[42],andK,31etc.Recently,Grishchenkoetal.hasformalizedacompletesmall-stepsemanticsofEVMbytecodefortheF*proofassistant[52].Rosuetal.alsodevelopedKEVM,aformalsemanticsoftheEVMintheKframework[25],[121];andfurtherevaluated29.Isabelle.http://isabelle.in.tum.de/30.F*.https://www.fstar-lang.org/31.KFramework.http://www.kframework.org/index.php/Main_Page2100IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
itseffectivenessinverifyingEVMsmartcontracts[59],[114].Sergeyetal.proposedaverificationframeworkbasedonScilla(anintermediaterepresentationlanguagesspecifi-callydesignedforverification)toapplyformalverificationmethodstoreasonabouttemporalpropertiesofsmartcon-tracts[129].Alt.etal.builtanSMT-basedformalverificationmoduleinsidetheSoliditycompiler,whereduringcom-pilation,userscouldgetautomaticwarningsofandcou-nterexamplesforseveralkindsofpotentialproblemslikeunreachablecode,assertionfailures,etc.[3].HiraiusedKripkemodelsofthemodallogictochecktheatomicitypropertyofaprotocolcalled“atomiccross-chainswap”(expressedinaformofhashedtimelocksmartcontracts)[62].Besidesformalverification,someresearchersproposedtoabstractsmartcontactstoacertainformbeforeconduct-ingrelevantverificationtasks[50],[71].Toguardthequalityorconfidentialityofdatainvolvedinsmartcontractexecution,Zhangetal.designedadatafeedsystemcalledTownCrier[154]toprovidetrustedinputdataforsmartcontractsandkeep-ingdatarequestssecretfromothers.SanchezandCerezoproposedasystemcalledRazieltohelpsecurelyexecut-ingsmartcontractswhileguaranteeingtheirprivacy,correctness,andverifiability[123].Liangetal.proposedaframeworkcalledDESCtoautomaticallycontrolaccessinthedomainofsecuredataexchangeandprotectdataowners’rights[85].Toeasesmartcontractcreation,FrantzandNowostawskiproposedtosemi-automaticallycreatesmartcontractsbytranslatingtextualcontractintosmartcontractrules[44].Mavridouetal.proposedaframeworkcalledFSolidityMtoallowdeveloperstodesignsmartcontractasFiniteStateMachines[97].Schransetal.inventedaprogramminglan-guagecalledFlintintroducingcallercapabilities,andsafeatomicoperations[125].Seijasetal.exploredthedesignofMarlowe,adomainspecificlanguagetargetedatfinancialcontractsonblockchains,togetherwithexamplesofitsuse;theyfurtherdescribedatool,calledMeadow,thatallowsuserstointeractwithandsimulatetheoperationsofMar-lowecontracts[126].Valliappanetal.combinedSimplicity(alanguageforprogrammingsmartcontractswithaformalsemantic)withacategoricalmodel,tofacilitatetheadditionoflocaldefinitions,functions,andboundedloops[147].Bar-tolettietal.designedahigh-leveldomainspecificlanguagewithacomputationallysoundcompiler,namelyBitML,forBitcoinsmartcontracts.BitMLcreatessmartcontractsintheformofsymbolicexpressions,thencompilestheseexpres-sionstoBitcoinscripts[10],[12].Tohelppeoplebetterunderstandandanalyzesmartcontracts,Brentetal.pro-posedaframeworkcalledVandalthatdecompiledEVMbytecodeandalloweddeveloperstoanalyzebytecodevialogicspecification[16].Zhouetal.developedEraystogen-eratehigh-levelpseudocodefrombinarycodeofsmartcon-tracts[158].Bragagnoloetal.developedSmartInspectwhichalloweduserstounderstandcontractstoredstatewithoutredeployingasmartcontract[15].Additionally,Dickersonetal.proposedawaytoallowsmartcontractstobeexecutedinparallelbyadaptingtechniquesfromsoft-waretransactionalmemory[39].Colomboetal.developedCONTRACTLARVAtorecoversmartcontractfromviola-tionsdynamically[34].Unliketheabovestudieswhichaimedtodevelopspecifictools/techniquesforsmartcontract,wefocusedonidentify-ingmajorchallengesdevelopersarefacingduringsmartcontractdevelopment.Ourstudyalsoidentifiedseveralkindsoftoolsthatdevelopersdesiredmost,suchasadvanceddebuggers,source-code-levelgasestimations,advancedformalverificationtechniques,etc.Ourstudyprovidesaguidefortoolbuilderstodeveloptoolsthatareneededbydevelopers.StudiesonChallengesandOpportunities.Therehavebeenseveralpapersstudyingthechallengesandcorrespondingopportunitiesinspecificdomainsorsoftwarepractices.TwostudiesdonebyPorruetal.[117]andLinetal.[86]aremostlyrelatedtoourstudy.Porruetal.[117]studiedthechallengesandnewdirectionsofblockchain-orientedsoftwareengineer-ing,fromdefiningnewprofessionalroles,enhancingsecurityandreliability,todevelopingnoveltoolsforsoftwarearchi-tecture/modeling,ensuringeffectivetestingactivities,etc.Theirstudymainlydiscussedsomehigh-levelchallenges/directionsindevelopingblockchain-orientedsoftware,includingbothblockchainplatformsandgeneralblockchainapplications.Unliketheirstudy,ourworkspecificallystud-iedthechallengesofsmartcontract(aspecialkindofblock-chainapplication)developmentfromthepractitioners’view.Ourstudyprovidedsomeconcreteandactionabledirectionsforbothresearchersandpractitionerstotakeontofacilitatethedevelopmentofsmartcontracts.Linetal.[86]brieflysummarizedsomeissuesandchallengesthatpeopleneedtoconcernwhentryingtoembracetheblockchaintechnologies,e.g.,regulationsproblems,scaleofblockchainproblems,etc.Unlikethem,wedidnotstudytheadoptionofblockchainitself;instead,wefocusedonexploringthechallengesandopportunitiesofdevelopingsmartcontractswhichrunonblockchainplatforms.Zhangetal.didasurveyofcloudcomputingtechnologyandpresentedsomedesignchallengesofcloudcomputing[155].Similarly,Dillonetal.presentedseveralchallengesfromthecloudcomputingadoptionperspectiveandfiguredoutthatthecloudinteroperabilityissuedeservedsubstan-tialattention[40].Kephart[74]outlinedsomescientificandengineeringchallengesofautonomiccomputing.LabrinidisandJagadishdiscussedsomecontroversiesandmythssur-roundingbigdataandsummarizedsomechallengesandopportunitieswithbigdata[82].Manferdellilistedsomechallengesandopportunitiesduringsoftwaredevelopmentbasedonmany-corecomputing[93].Knightsummarizedsomechallengesanddirectionsindevelopingsafetycriticalsystems[79].Broystudiedthechallengesinautomotivesoftwareengineering[18].Muccinietal.[103]andJoorabchietal.[68]exploredrele-vantchallengesinsoftwaretestingandsoftwaredevelop-mentofmobileapplicationsrespectively.Hiltonetal.investigatedthebarriersandunmetneedsfacedbydevel-opersduringtheiradoptionofcontinuousintegrationsys-tems[60].Gousiosetal.studiedworkpracticesandchallengesinpull-baseddevelopmentfromboththecon-tributor’sandintegrator’sperspective[48],[49].Kimetal.didanempiricalstudytounderstandrefactoringchallengesandbenefitsatMicrosoft[77].Unlikethesestudies,weexploredchallengesandoppor-tunitiesofanewtopic,i.e.,thedevelopmentofsmartZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2101Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
contracts.Wesummarizedsixmajorcategoriesofchal-lengesandfurtheridentifiedsomepotentialresearchdirec-tionsspecifictothesmartcontractdomain.8CONCLUSIONANDFUTUREWORKSmartcontract,whichoriginallyreferstotheautomationoflegalcontractsingeneral,hasrecentlyseenmuchinterestduetotheriseofblockchaintechnology.Today,itispopu-larlyusedtorefertolow-levelcodescriptsrunningonblockchains.Inthisstudy,weinvestigatedthechallengesdevelopersarefacingindevelopingsuchsmartcontracts,especiallyfocusingontheEthereumplatform.Ourinterviewandsurveyresultsindicatethatsmartcontractdevelopmentisstillinitsinfancy:thereisnogenerallyacceptedwaytosecuresmartcontractcode;theexistingdevelopmenttool-chainisnotpowerfulenough;developmentandruntimeplatforms(i.e.,programminglanguages,virtualmachines)stillhavealotoflimitations;onlinelearningresourcesandcommunitysupportsarelimited.Basedonourfindings,wesummarizedsomeconcreteandactionabledirectionsinwhichresearchersandpractitionerscouldtakeoninthefuture(e.g.,automatedsmartcontractpatching,Soliditycom-pilertesting,source-code-levelgasoptimization,automatedSoliditylibraryconstruction,etc.).Progressinsuchdirectionswouldfurtherfacilitatesmartcontractdevelopment.ACKNOWLEDGMENTSWearegratefulfortheinterviewandsurveyparticipantswhoprovidedmanyinsightfulcommentsandansweredoursurveyquestions.Westronglythanktheanonymousreviewersfortheirconstructivecomments.TheworkispartlysupportedbytheNationalKeyResearchandDevel-opmentProgramofChina(2018YFB1403400),theNationalNaturalScienceFoundationofChina(61690201,61772014),andtheprogramBforOutstandingPhDcandidateofNanj-ingUniversity.Anyopinions,findings,andconclusionsinthispaperarethoseoftheauthorsonlyanddonotnecessar-ilyreflecttheviewsofoursponsors.REFERENCES[1]F.AlKhalil,T.Butler,L.O’Brien,andM.Ceci,“Trustinsmartcontractsisaprocess,aswell,”inProc.21stInt.Conf.FinancialCryptographyDataSecurity,2017,pp.510–519.[2]M.AlharbyandA.vanMoorsel,“Blockchain-basedsmartcon-tracts:Asystematicmappingstudy,”CoRR,vol.abs/1710.06372,2017.[Online].Available:http://arxiv.org/abs/1710.06372[3]L.AltandC.Reitwiessner,“SMT-basedverificationofsoliditysmartcontracts,”inProc.Int.Symp.LeveragingAppl.FormalMeth-ods,2018,pp.376–388.[4]S.Amani,M.Begel,M.Bortin,andM.Staples,“Towardsverify-ingEthereumsmartcontractbytecodeinIsabelle/HOL,”inProc.7thInt.Conf.CertiÞedProgramsProofs,2018,pp.66–77.[5]I.Anati,S.Gueron,S.Johnson,andV.Scarlata,“InnovativetechnologyforCPUbasedattestationandsealing,”inProc.2ndInt.WorkshopHardwareArchitecturalSupportSecur.Privacy,2013,vol.13,pp.1–7.[6]M.Aniche,C.Treude,I.Steinmacher,I.Wiese,G.Pinto,M.-A.Storey,andM.A.Gerosa,“Howmodernnewsaggregatorshelpdevelopmentcommunitiesshapeandshareknowledge,”inProc.40thInt.Conf.Softw.Eng.,2018,pp.499–510.[7]ARM,“Armsecuritytechnology–buildingasecuresystemusingtrustzonetechnology,”ARMTechnicalWhitePaper,2009.[Online].Available:http://infocenter.arm.com/help/topic/com.arm.doc.prd29genc009492c/PRD29%-GENC009492C_trustzone_security_whitepaper.pdf[8]D.W.Barowy,S.Gulwani,T.Hart,andB.Zorn,“FlashRelate:Extractingrelationaldatafromsemi-structuredspreadsheetsusingexamples,”inProc.36thACMSIGPLANConf.Program.Lang.Des.Implementation,2015,pp.218–228.[9]M.Bartoletti,S.Carta,T.Cimoli,andR.Saia,“DissectingPonzischemesonEthereum:Identification,analysis,andimpact,”CoRR,vol.abs/1703.03779,2017.[Online].Available:http://arxiv.org/abs/1703.03779[10]M.Bartoletti,T.Cimoli,andR.Zunino,“FunwithBitcoinsmartcontracts,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.432–449.[11]M.BartolettiandL.Pompianu,“Anempiricalanalysisofsmartcon-tracts:Platforms,applications,anddesignpatterns,”inProc.21stInt.Conf.FinancialCryptographyDataSecurity,2017,pp.494–509.[12]M.BartolettiandR.Zunino,“BitML:AcalculusforBitcoinsmartcontracts,”inProc.25thACMSIGSACConf.Comput.Commun.Security,2018,pp.83–100.[13]K.Bhargavan,A.Delignat-Lavaud,C.Fournet,A.Gollamudi,G.Gonthier,N.Kobeissi,N.Kulatova,A.Rastogi,T.Sibut-Pinote,N.Swamy,etal.,“Formalverificationofsmartcontracts:Shortpaper,”inProc.WorkshopProgram.Lang.Anal.Security,2016,pp.91–96.[14]G.Bigi,A.Bracciali,G.Meacci,andE.Tuosto,“Validationofdecentralisedsmartcontractsthroughgametheoryandformalmethods,”inProgrammingLanguageswithApplicationstoBiologyandSecurity.Berlin,Germany:Springer,2015,pp.142–161.[15]S.Bragagnolo,H.Rocha,M.Denker,andS.Ducasse,“Smartinspect:Smartcontractinspectiontechnicalreport,”PhDthesis,Lille,Department:Inria-NationalInstituteforResearchinComputingandAutomation,France:InriaLille,2017.[16]L.Brent,A.Jurisevic,M.Kong,E.Liu,F.Gauthier,V.Gramoli,R.Holz,andB.Scholz,“Vandal:Ascalablesecurityanalysisframeworkforsmartcontracts,”CoRR,vol.abs/1809.03981,2018.[Online].Available:http://arxiv.org/abs/1809.03981[17]R.G.Brown,J.Carlyle,I.Grigg,andM.Hearn,“Corda:Anintroduction,”R3CEV,pp.1–15,2016.[Online].Available:https://docs.corda.net/_static/corda-introductory-whitepaper.pdf[18]M.Broy,“Challengesinautomotivesoftwareengineering,”inProc.28thInt.Conf.Softw.Eng.,2006,pp.33–42.[19]V.Buterin,“Anext-generationsmartcontractanddecentralizedapplicationplatform,”WhitePaper,2014.[20]C.CalcagnoandD.Distefano,“Infer:Anautomaticprogramver-ifierformemorysafetyofCprograms,”inProc.3rdInt.Symp.NASAFormalMethods,2011,pp.459–465.[21]T.Chen,X.Li,X.Luo,andX.Zhang,“Under-optimizedsmartcontractsdevouryourmoney,”inProc.24thInt.Conf.Softw.Anal.EvolutionReeng.,2017,pp.442–446.[22]T.Chen,X.Li,Y.Wang,J.Chen,Z.Li,X.Luo,M.H.Au,andX.Zhang,“AnadaptivegascostmechanismforEthereumtodefendagainstunder-pricedDoSattacks,”inProc.13thInt.Conf.Inf.Secur.PracticeExperience,2017,pp.3–24.[23]T.Chen,Z.Li,H.Zhou,J.Chen,X.Luo,X.Li,andX.Zhang,“Towardssavingmoneyinusingsmartcontracts,”inProc.40thInt.Conf.Softw.Eng.:NewIdeasEmergingResults,2018,pp.81–84.[24]W.Chen,Z.Zheng,J.Cui,E.Ngai,P.Zheng,andY.Zhou,“DetectingPonzischemesonEthereum:Towardshealthierblockchaintechnology,”inProc.27thWorldWideWebConf.WorldWideWeb,2018,pp.1409–1418.[25]X.Chen,D.Park,andG.Ro¸su,“Alanguage-independentapproachtosmartcontractverification,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.405–413.[26]R.Cheng,F.Zhang,J.Kos,W.He,N.Hynes,N.Johnson,A.Juels,A.Miller,andD.Song,“Ekiden:Aplatformforconfi-dentiality-preserving,trustworthy,andperformantsmartcon-tracts,”IEEEEur.Symp.Secur.Privacy,pp.185–200,2019.[27]C.D.Clack,“Smartcontracttemplates:Legalsemanticsandcodevalidation,”J.DigitalBanking,vol.2,no.4,pp.338–352,2018.[28]C.D.Clack,“Smartcontracttemplates:Thesemanticsofsmartlegalagreements,”J.DigitalBanking,vol.2,no.4,pp.1–15,2018.[29]C.D.Clack,V.A.Bakshi,andL.Braine,“Smartcontracttem-plates:Foundations,designlandscapeandresearchdirections,”CoRR,vol.abs/1608.00771,2016.[Online].Available:http://arxiv.org/abs/1608.00771[30]C.D.ClackandC.McGonagle,“Smartderivativescontracts:TheISDAMasterAgreementandtheautomationofpaymentsanddeliveries,”CoRR,vol.abs/1904.01461,2019.[Online].Available:http://arxiv.org/abs/1904.014612102IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
[31]C.D.ClackandG.Vanca,“Temporalaspectsofsmartcontractsforfinancialderivatives,”inProc.Int.Symp.LeveragingAppl.For-malMethods,2018,pp.339–355.[32]CliffordChanceandEuropeanBankforReconstructionandDevel-opment,“Smartcontracts:Legalframeworkandproposedguide-linesforlawmakers,”pp.1–52,2017.[Online].Available:https://www.ebrd.com/documents/legal-reform/pdf-smart-contracts-legal-framework-and-proposed-guidelines-for-lawmakers.pdf[33]M.Coblenz,“Obsidian:Asaferblockchainprogramminglanguage,”inProc.39thInt.Conf.Softw.Eng.Companion,2017,pp.97–99.[34]C.Colombo,J.Ellul,andG.J.Pace,“Contractsoversmartcon-tracts:Recoveringfromviolationsdynamically,”inProc.8thInt.Symp.LeveragingAppl.FormalMethodsVeriÞcationValidation,2018,pp.300–315.[35]B.DagenaisandM.P.Robillard,“Usingtraceabilitylinkstorec-ommendadaptivechangesfordocumentationevolution,”IEEETrans.Softw.Eng.,vol.40,no.11,pp.1126–1146,Nov.2014.[36]A.Decan,T.Mens,andE.Constantinou,“Ontheimpactofsecu-rityvulnerabilitiesinthenpmpackagedependencynetwork,”inProc.15thInt.Conf.MiningSoftw.Repositories,2018,pp.181–191.[37]K.Delmolino,M.Arnett,A.Kosba,A.Miller,andE.Shi,“Stepbysteptowardscreatingasafesmartcontract:Lessonsandinsightsfromacryptocurrencylab,”inProc.20thInt.Conf.FinancialCryp-tographyDataSecurity,2016,pp.79–94.[38]G.Destefanis,M.Marchesi,M.Ortu,R.Tonelli,A.Bracciali,andR.Hierons,“Smartcontractsvulnerabilities:Acallforblockchainsoftwareengineering?”inProc.Int.WorkshopBlockchainOrientedSoftw.Eng.,2018,pp.19–25.[39]T.Dickerson,P.Gazzillo,M.Herlihy,andE.Koskinen,“Addingconcurrencytosmartcontracts,”inProc.36thSymp.PrinciplesDistrib.Comput.,2017,pp.303–312.[40]T.Dillon,C.Wu,andE.Chang,“Cloudcomputing:Issuesandchallenges,”inProc.24thInt.Conf.Adv.Inf.Netw.Appl.,2010,pp.27–33.[41]J.EberhardtandS.Tai,“Onorofftheblockchain?Insightsonoff-chainingcomputationanddata,”inProc.6thEur.Conf.Serv.-OrientedCloudComput.,2017,pp.3–15.[42]J.-C.Filli^atreandA.Paskevich,“Why3—Whereprogramsmeetprovers,”inProc.22ndEur.Symp.Program.,2013,pp.125–128.[43]R.A.Fisher,“Ontheinterpretationofx2fromcontingencytables,andthecalculationofP,”J.Roy.StatisticalSoc.,vol.85,no.1,pp.87–94,1922.[44]C.K.FrantzandM.Nowostawski,“Frominstitutionstocode:Towardsautomatedgenerationofsmartcontracts,”inProc.1stInt.WorkshopsFound.Appl.Self*Syst.,2016,pp.210–215.[45]M.Fr€owisandR.B€ohme,“Incodewetrust?”inProc.Int.Work-shopsDataPrivacyManage.CryptocurrenciesBlockchainTechnol.,2017,pp.357–372.[46]H.S.GalalandA.M.Youssef,“Trustee:Fullprivacypreservingvickreyauctionontopofethereum,”CoRR,vol.abs/1905.06280,2019.[Online].Available:http://arxiv.org/abs/1905.06280[47]L.Goodman,“Snowballsampling,”Ann.Math.Statist.,vol.32,no.1,pp.148–170,1961.[48]G.Gousios,M.-A.Storey,andA.Bacchelli,“Workpracticesandchallengesinpull-baseddevelopment:Thecontributor’sperspective,”inProc.38thInt.Conf.Softw.Eng.,2016,pp.285–296.[49]G.Gousios,A.Zaidman,M.-A.Storey,andA.VanDeursen,“Workpracticesandchallengesinpull-baseddevelopment:Theintegrator’sperspective,”inProc.37thInt.Conf.Softw.Eng.,2015,pp.358–368.[50]N.Grech,M.Kong,A.Jurisevic,L.Brent,B.Scholz,andY.Smaragdakis,“MadMax:Survivingout-of-gasconditionsinEthereumsmartcontracts,”inProc.ACMProgram.Lang.,2018,pp.14–18.[51]I.Grishchenko,M.Maffei,andC.Schneidewind,“EtherTrust:SoundstaticanalysisofEthereumbytecode,”TechnischeUniversit€atWien,Tech.Rep.,pp.1–41,2018.[52]I.Grishchenko,M.Maffei,andC.Schneidewind,“AsemanticframeworkforthesecurityanalysisofEthereumsmartcontrac-ts,”inProc.7thInt.Conf.PrinciplesSecur.Trust,2018,pp.243–269.[53]I.Grishchenko,M.Maffei,andC.Schneidewind,“FoundationsandtoolsforthestaticanalysisofEthereumsmartcontracts,”inProc.30thInt.Conf.Comput.AidedVeriÞcation,2018,pp.51–78.[54]S.Grossman,I.Abraham,G.Golan-Gueta,Y.Michalevsky,N.Rinetzky,M.Sagiv,andY.Zohar,“Onlinedetectionofeffec-tivelycallbackfreeobjectswithapplicationstosmartcontracts,”inProc.ACMProgram.Lang.,2017,vol.2,pp.1–28.[55]G.Guest,A.Bunce,andL.Johnson,“Howmanyinterviewsareenough?Anexperimentwithdatasaturationandvariability,”FieldMethods,vol.18,no.1,pp.59–82,2006.[56]P.Hegedus,“TowardsanalyzingthecomplexitylandscapeofSoliditybasedEthereumsmartcontracts,”inProc.1stInt.Work-shopEmergingTrendsSoftw.Eng.Blockchain,2018,pp.35–39.[57]J.HenkelandA.Diwan,“CatchUp!CapturingandreplayingrefactoringstosupportAPIevolution,”inProc.27thInt.Conf.Softw.Eng.,2005,pp.274–283.[58]J.Henrich,S.J.Heine,andA.Norenzayan,“Theweirdestpeopleintheworld?”BehavioralBrainSci.,vol.33,no.2/3,pp.61–83,2010.[59]E.Hildenbrandt,M.Saxena,N.Rodrigues,X.Zhu,P.Daian,D.Guth,B.Moore,D.Park,Y.Zhang,A.Stefanescu,etal.,“KEVM:AcompleteformalsemanticsoftheEthereumVirtualMachine,”inProc.31stComput.SecurityFound.Symp.,2018,pp.204–217.[60]M.Hilton,N.Nelson,T.Tunnell,D.Marinov,andD.Dig,“Trade-offsincontinuousintegration:Assurance,security,andflexibility,”inProc.11thJointMeetingFound.Softw.Eng.,2017,pp.197–207.[61]Y.Hirai,“FormalverificationofDeedcontractinEthereumnameservice,”pp.1–81,Nov.1,2016.[Online].Available:Available:https://yoichihirai.com/deed.pdf[62]Y.Hirai,“BlockchainsasKripkemodels:Ananalysisofatomiccross-chainswap,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.389–404.[63]A.HoraandM.T.Valente,“apiwave:KeepingtrackofAPIpop-ularityandmigration,”inProc.31stInt.Conf.Softw.MaintenanceEvolution,2015,pp.321–323.[64]F.Idelberger,G.Governatori,R.Riveret,andG.Sartor,“Evaluationoflogic-basedsmartcontractsforblockchainsys-tems,”inProc.10thInt.Symp.RulesRuleMarkupLang.SemanticWeb,2016,pp.167–183.[65]ISDAandKing&WoodMallesons,“Smartderivativescontracts:Fromconcepttoconstruction,”pp.1–28,2018.[Online].Available:https://www.isda.org/a/cHvEE/Smart-Derivatives-Contracts-From-Concept-to-Construction-Oct-2018.pdf[66]ISDAandLinklaters,“Smartcontractsanddistributedledger—Alegalperspective,”pp.1–23,2017.[Online].Available:https://www.isda.org/a/6EKDE/smart-contracts-and-distributed-ledger-a-legal-perspective.pdf[67]B.Jiang,Y.Liu,andW.Chan,“ContractFuzzer:Fuzzingsmartcontractsforvulnerabilitydetection,”inProc.33rdInt.Conf.Autom.Softw.Eng.,2018,pp.259–269.[68]M.E.Joorabchi,A.Mesbah,andP.Kruchten,“Realchallengesinmobileappdevelopment,”inProc.7thInt.Symp.EmpiricalSoftw.Eng.Meas.,2013,pp.15–24.[69]A.Juels,A.Kosba,andE.Shi,“Theringofgyges:Investigatingthefutureofcriminalsmartcontracts,”inProc.23rdConf.Comput.Commun.Secur.,2016,pp.283–295.[70]H.Kalodner,S.Goldfeder,X.Chen,S.M.Weinberg,andE.W.Felten,“Arbitrum:Scalable,privatesmartcontracts,”inProc.27thUSENIXSecuritySymp.,2018,pp.1353–1370.[71]S.Kalra,S.Goel,M.Dhawan,andS.Sharma,“Zeus:Analyzingsafetyofsmartcontracts,”inProc.25thAnnu.Netw.Distrib.Syst.SecuritySymp.,2018,pp.1–15.[72]T.Kamiya,S.Kusumoto,andK.Inoue,“CCFinder:Amultilin-guistictoken-basedcodeclonedetectionsystemforlargescalesourcecode,”IEEETrans.Softw.Eng.,vol.28,no.7,pp.654–670,Jul.2002.[73]S.Kawaguchi,P.K.Garg,M.Matsushita,andK.Inoue,“MUDABlue:Anautomaticcategorizationsystemforopensourcerepositories,”J.Syst.Softw.,vol.79,no.7,pp.939–953,2006.[74]J.O.Kephart,“Researchchallengesofautonomiccomputing,”inProc.27thInt.Conf.Softw.Eng.,2005,pp.15–22.[75]M.Kim,T.Zimmermann,R.DeLine,andA.Begel,“Theemerg-ingroleofdatascientistsonsoftwaredevelopmentteams,”inProc.38thInt.Conf.Softw.Eng.,2016,pp.96–107.[76]M.Kim,T.Zimmermann,R.DeLine,andA.Begel,“Datascientistsinsoftwareteams:Stateoftheartandchallenges,”IEEETrans.Softw.Eng.,vol.44,no.11,pp.1024–1038,Nov.2018.[77]M.Kim,T.Zimmermann,andN.Nagappan,“Anempi-ricalstudyofrefactoringchallengesandbenefitsatMicro-soft,”IEEETrans.Softw.Eng.,vol.40,no.7,pp.633–649,Jul.2014.ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2103Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
[78]B.A.KitchenhamandS.L.Pfleeger,“Personalopinionsurveys,”inGuidetoAdvancedEmpiricalSoftwareEngineering,Berlin,Germany:Springer,2008,pp.63–92.[79]J.C.Knight,“Safetycriticalsystems:Challengesanddirections,”inProc.24thInt.Conf.Softw.Eng.,2002,pp.547–550.[80]P.S.Kochhar,X.Xia,D.Lo,andS.Li,“Practitioners’expecta-tionsonautomatedfaultlocalization,”inProc.25thInt.Symp.Softw.TestingAnal.,2016,pp.165–176.[81]J.KruppandC.Rossow,“TEETHER:GnawingatEthereumtoautomaticallyexploitsmartcontracts,”inProc.27thUSENIXSecuritySymp.,2018,pp.1317–1333.[82]A.LabrinidisandH.V.Jagadish,“Challengesandopportunitieswithbigdata,”TheVLDBEndowment,vol.5,no.12,pp.2032–2033,2012.[83]C.Li,B.Palanisamy,andR.Xu,“Scalableandprivacy-preservingdesignofon/off-chainsmartcontracts,”CoRR,vol.abs/1902.06359,2019.[Online].Available:http://arxiv.org/abs/1902.06359[84]Z.Li,H.Wu,J.Xu,X.Wang,L.Zhang,andZ.Chen,“MuSC:AToolformutationtestingofEthereumsmartcontract,”inProc.34thInt.Conf.Autom.Softw.Eng.-Demonstrations(Accepted),2019,pp.1–4.[85]J.Liang,W.Han,Z.Guo,Y.Chen,C.Cao,X.S.Wang,andF.Li,“DESC:Enablingsecuredataexchangebasedonsmartcontrac-ts,”Sci.ChinaInf.Sci.,vol.61,no.4,2018,Art.no.049102.[86]I.-C.LinandT.-C.Liao,“Asurveyofblockchainsecurityissuesandchallenges,”IJNetw.Security,vol.19,no.5,pp.653–659,2017.[87]C.Liu,H.Liu,Z.Cao,Z.Chen,B.Chen,andB.Roscoe,“ReGuard:Findingreentrancybugsinsmartcontracts,”inProc.40thInt.Conf.Softw.Eng.Companion,2018,pp.65–68.[88]H.Liu,C.Liu,W.Zhao,Y.Jiang,andJ.Sun,“S-gram:Towardssemantic-awaresecurityauditingforEthereumsmartcontracts,”inProc.33rdInt.Conf.Autom.Softw.Eng.,2018,pp.814–819.[89]D.Lo,N.Nagappan,andT.Zimmermann,“Howpractitionersperceivetherelevanceofsoftwareengineeringresearch,”inProc.10thJointMeetingFound.Softw.Eng.,2015,pp.415–425.[90]L.Luu,D.-H.Chu,H.Olickel,P.Saxena,andA.Hobor,“Makingsmartcontractssmarter,”inProc.23rdConf.Comput.Commun.Security,2016,pp.254–269.[91]S.Ma,D.Lo,T.Li,andR.H.Deng,“CDRep:Automaticrepairofcryptographicmisusesinandroidapplications,”inProc.11thACMAsiaConf.Comput.Commun.Security,2016,pp.711–722.[92]D.Magazzeni,P.McBurney,andW.Nash,“Validationandveri-ficationofsmartcontracts:Aresearchagenda,”Comput.,vol.50,no.9,pp.50–57,2017.[93]J.L.Manferdelli,N.K.Govindaraju,andC.Crall,“Challengesandopportunitiesinmany-corecomputing,”Proc.IEEE,vol.96,no.5,pp.808–815,May2008.[94]I.Manotas,C.Bird,R.Zhang,D.Shepherd,C.Jaspan,C.Sadowski,L.Pollock,andJ.Clause,“Anempiricalstudyofpractitioners’perspectivesongreensoftwareengineering,”inProc.38thInt.Conf.Softw.Eng.,2016,pp.237–248.[95]M.Marescotti,M.Blicha,A.E.Hyv€arinen,S.Asadi,andN.Sharygina,“Computingexactworst-casegasconsumptionforsmartcontracts,”inProc.Int.Symp.LeveragingAppl.FormalMeth-ods,2018,pp.450–465.[96]B.MarinoandA.Juels,“Settingstandardsforalteringandundo-ingsmartcontracts,”inProc.10thInt.Symp.RulesRuleMarkupLang.SemanticWeb,2016,pp.151–166.[97]A.MavridouandA.Laszka,“DesigningsecureEthereumsmartcontracts:Afinitestatemachinebasedapproach,”CoRR,vol.abs/1711.09327,2017.[Online].Available:http://arxiv.org/abs/1711.09327[98]J.H.McDonald,HandbookofBiologicalStatistics,vol.2.Baltimore,MD,USA:SparkyHousePublishing,2009.[99]N.Meng,M.Kim,andK.S.McKinley,“LASE:Locatingandapplyingsystematiceditsbylearningfromexamples,”inProc.35thInt.Conf.Softw.Eng.,2013,pp.502–511.[100]A.Miller,Z.Cai,andS.Jha,“Smartcontractsandopportunitiesforformalmethods,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.280–299.[101]J.M.Morse,“Dataweresaturated…,”QualitativeHealthRes.,vol.25,no.5,pp.587–588,2015.[102]L.Mou,G.Li,L.Zhang,T.Wang,andZ.Jin,“Convolutionalneu-ralnetworksovertreestructuresforprogramminglanguageproc-essing,”inProc.30thAAAIConf.Artif.Intell.,2016,pp.1287–1293.[103]H.Muccini,A.DiFrancesco,andP.Esposito,“Softwaretestingofmobileapplications:Challengesandfutureresearchdirections,”inProc.7thInt.WorkshopAutom.Softw.Test,2012,pp.29–35.[104]G.Muller,Y.Padioleau,J.L.Lawall,andR.R.Hansen,“Semanticpatchesconsideredhelpful,”ACMSIGOPSOperatingSyst.Rev.,vol.40,no.3,pp.90–92,2006.[105]S.Nakamoto,“Bitcoin:Apeer-to-peerelectroniccashsystem,”WorkingPaper,pp.1–9,2008.[Online].Available:https://bitcoin.org/bitcoin.pdf[106]L.R.NessandP.I.Fusch,“Arewethereyet?Datasaturationinqualitativeresearch,”TheQualitativeRep.,vol.20,no.9,pp.1408–1416,2015.[107]A.T.Nguyen,H.A.Nguyen,T.T.Nguyen,andT.N.Nguyen,“StatisticallearningapproachforminingAPIusagemappingsforcodemigration,”inProc.29thInt.Conf.Autom.Softw.Eng.,2014,pp.457–468.[108]I.Nikolic,A.Kolluri,I.Sergey,P.Saxena,andA.Hobor,“Findingthegreedy,prodigal,andsuicidalcontractsatscale,”CoRR,vol.abs/1802.06038,2018.[Online].Available:http://arxiv.org/abs/1802.06038[109]T.Nipkow,L.C.Paulson,andM.Wenzel,“Isabelle/HOL:Aproofassistantforhigher-orderlogic,”Springer,vol.2283,2002.[110]A.D.OngandD.J.Weiss,“Theimpactofanonymityonresponsestosensitivequestions,”J.Appl.SocialPsychology,vol.30,no.8,pp.1691–1708,2000.[111]Y.Padioleau,J.Lawall,R.R.Hansen,andG.Muller,“DocumentingandautomatingcollateralevolutionsinLinuxdevicedrivers,”ACMSIGOPSOperatingSyst.Rev.,vol.42,no.4,pp.247–260,2008.[112]R.M.Parizi,Amritraj,andA.Dehghantanha,“Smartcontractprogramminglanguagesonblockchains:Anempiricalevalua-tionofusabilityandsecurity,”inProc.1stInt.Conf.Blockchain,2018,pp.75–91.[113]R.M.Parizi,A.Dehghantanha,K.-K.R.Choo,andA.Singh,“Empiricalvulnerabilityanalysisofautomatedsmartcontractssecuritytestingonblockchains,”CoRR,vol.abs/1809.02702,2018.[Online].Available:http://arxiv.org/abs/1809.02702[114]D.Park,Y.Zhang,M.Saxena,P.Daian,andG.Rosu,“AformalverificationtoolforEthereumVMbytecode,”inProc.27thInt.Symp.Found.Softw.Eng.,2018,pp.18–21.[115]R.Pawlak,M.Monperrus,N.Petitprez,C.Noguera,andL.Seinturier,“Spoon:AlibraryforimplementinganalysesandtransformationsofJavasourcecode,”Softw.:PracticeExperience,vol.46,no.9,pp.1155–1179,2016.[116]J.PetterssonandR.Edstr€om,“Safersmartcontractsthroughtype-drivendevelopment,”Master’sthesis,DepartmentofComputerScienceandEngineering,ChalmersUniversityofTechnologyandUniversityofGothenburg,Gothenburg,Swe-den,2016.[117]S.Porru,A.Pinna,M.Marchesi,andR.Tonelli,“Blockchain-orientedsoftwareengineering:Challengesandnewdirections,”inProc.39thInt.Conf.Softw.Eng.Companion,2017,pp.169–171.[118]T.Punter,M.Ciolkowski,B.Freimut,andI.John,“Conductingon-linesurveysinsoftwareengineering,”inProc.2ndInt.Symp.EmpiricalSoftw.Eng.,2003,pp.80–88.[119]R3,“Cordadocuments,”2018.[Online].Available:https://docs.corda.net/[120]F.Rahman,S.Khatri,E.T.Barr,andP.Devanbu,“Comparingstaticbugfindersandstatisticalprediction,”inProc.36thInt.Conf.Softw.Eng.,2014,pp.424–434.[121]G.Ro¸suandT.F.¸Serbanu¸ta,“AnoverviewoftheKsemanticframe-work,”J.LogicAlgebr.Program.,vol.79,no.6,pp.397–434,2010.[122]C.Sanchez,G.Schneider,andM.Leucker,“Reliablesmartcon-tracts:State-of-the-art,applications,challengesandfuturedirections,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.275–279.[123]D.C.Sanchez,“Raziel:Privateandverifiablesmartcontractsonblockchains,”CoRR,vol.abs/1807.09484,2018.[Online].Avail-able:http://arxiv.org/abs/1807.09484[124]B.Saunders,J.Sim,T.Kingstone,S.Baker,J.Waterfield,B.Bartlam,H.Burroughs,andC.Jinks,“Saturationinqua-litativeresearch:Exploringitsconceptualizationandoper-ationalization,”QualityQuantity,vol.52,no.4,pp.1893–1907,2018.[125]F.Schrans,S.Eisenbach,andS.Drossopoulou,“WritingsafesmartcontractsinFlint,”inProc.Conf.Companion2ndInt.Conf.ArtSci.Eng.Program.,2018,pp.218–219.2104IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
[126]P.L.SeijasandS.Thompson,“Marlowe:Financialcontractsonblockchain,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.356–375.[127]P.L.Seijas,S.J.Thompson,andD.McAdams,“Scriptingsmartcontractsfordistributedledgertechnology,”IACRCryptologyePrintArchive,vol.2016,2016,Art.no.1156.[128]I.SergeyandA.Hobor,“Aconcurrentperspectiveonsmartcon-tracts,”inProc.21stInt.Conf.FinancialCryptographyDataSecurity,2017,pp.478–493.[129]I.Sergey,A.Kumar,andA.Hobor,“Temporalpropertiesofsmartcontracts,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.323–338.[130]A.Sharma,F.Thung,P.S.Kochhar,A.Sulistya,andD.Lo,“CatalogingGitHubrepositories,”inProc.21stInt.Conf.Eval.AssessmentSoftw.Eng.,2017,pp.314–319.[131]D.Shepherd,P.Francis,D.Weintrop,D.Franklin,B.Li,andA.Afzal,“[EngineeringPaper]AnIDEforeasyprogrammingofsimpleroboticstasks,”inProc.18thInt.Work.Conf.SourceCodeAnal.Manipulation,2018,pp.209–214.[132]O.SheynerandJ.Wing,“Toolsforgeneratingandanalyzingattackgraphs,”inProc.2ndInt.Symp.FormalMethodsComponentsObjects,2003,pp.344–371.[133]F.Shull,J.Singer,andD.I.Sjøberg,GuidetoAdvancedEmpiricalSoftwareEngineering.Berlin,Germany:Springer,2007.[134]L.Singer,F.FigueiraFilho,andM.-A.Storey,“Softwareengi-neeringatthespeedoflight:HowdevelopersstaycurrentusingTwitter,”inProc.36thInt.Conf.Softw.Eng.,2014,pp.211–221.[135]D.Spencer,CardSorting:DesigningUsableCategories.SanFrancisco,CA,USA:RosenfeldMedia,2009.[136]J.Stark,“Makingsenseofblockchainsmartcontracts,”CoinDesk,Jun.2016.[Online].Available:https://www.coindesk.com/making-sense-smart-contracts[137]A.StraussandJ.M.Corbin,GroundedTheoryinPractice.ThousandOaks,CA,USA:SAGE,1997.[138]C.Sun,V.Le,andZ.Su,“Findingandanalyzingcompilerwarn-ingdefects,”inProc.38thInt.Conf.Softw.Eng.,2016,pp.203–213.[139]M.Swan,Blockchain:BlueprintforaNewEconomy.Newton,MA,USA:O’ReillyMedia,2015.[140]N.Szabo,“Formalizingandsecuringrelationshipsonpublicnetworks,”FirstMonday,vol.2,no.9,pp.1–25,1997.[141]F.Thung,X.-B.D.Le,D.Lo,andJ.Lawall,“RecommendingcodechangesforautomaticbackportingofLinuxdevicedrivers,”inProc.32ndInt.Conf.Softw.MaintenanceEvolution,2016,pp.222–232.[142]S.Tikhomirov,E.Voskresenskaya,I.Ivanitskiy,R.Takhaviev,E.Marchenko,andY.Alexandrov,“SmartCheck:StaticanalysisofEthereumsmartcontracts,”inProc.1stIEEE/ACMInt.Work-shopEmergingTrendsSoftw.Eng.Blockchain,2018,pp.9–16.[143]P.Tsankov,“Securityanalysisofsmartcontractsindatalog,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.316–322.[144]P.Tsankov,A.Dan,D.D.Cohen,A.Gervais,F.Buenzli,andM.Vechev,“Securify:Practicalsecurityanalysisofsmartcontracts,”inProc.25thConf.Comput.Commun.Security,2018,pp.67–82.[145]A.Unterweger,F.Knirsch,C.Leixnering,andD.Engel,“Lessonslearnedfromimplementingaprivacy-preservingsmartcontractinEthereum,”inProc.9thIFIPInt.Conf.NewTechnol.MobilitySecurity,2018,pp.1–5.[146]M.ValentaandP.Sandner,“ComparisonofEthereum,HyperledgerFabricandCorda,”[ebook]FrankfurtSchool,BlockchainCenter,pp.1–8,2017.[Online].Available:https://pdfs.semanticscholar.org/00c7/5699db7c5f2196ab0ae92be0430be4b291b4.pdf[147]N.Valliappan,S.Mirliaz,E.L.Vesga,andA.Russo,“Towardsaddingvarietytosimplicity,”inProc.Int.Symp.LeveragingAppl.FormalMethods,2018,pp.414–431.[148]P.Wang,J.Svajlenko,Y.Wu,Y.Xu,andC.K.Roy,“CCAligner:Atokenbasedlarge-gapclonedetector,”inProc.40thInt.Conf.Softw.Eng.,2018,pp.1066–1077.[149]X.Wang,H.Wu,W.Sun,andY.Zhao,“Towardsgeneratingcost-effectivetest-suiteforEthereumsmartcontract,”inProc.26thInt.Conf.Softw.Anal.EvolutionReeng.,2019,pp.549–553.[150]D.Weintrop,A.Afzal,J.Salac,P.Francis,B.Li,D.C.Shepherd,andD.Franklin,“EvaluatingCoBlox:Acomparativestudyofroboticsprogrammingenvironmentsforadultnovices,”inProc.36thCHIConf.HumanFactorsComput.Syst.,2018,Art.no.366.[151]M.WohrerandU.Zdun,“Smartcontracts:SecuritypatternsintheEthereumecosystemandSolidity,”inProc.Int.WorkshopBlockchainOrientedSoftw.Eng.,2018,pp.2–8.[152]G.Wood,“Ethereum:Asecuredecentralisedgeneralisedtrans-actionledger,”EthereumProjectYellowPaper,vol.151,pp.1–32,2014.[153]H.Wu,X.Wang,J.Xu,W.Zou,L.Zhang,andZ.Chen,“MutationtestingforEthereumsmartcontract,”arXive-prints,2019.[154]F.Zhang,E.Cecchetti,K.Croman,A.Juels,andE.Shi,“Towncrier:Anauthenticateddatafeedforsmartcontracts,”inProc.23rdConf.Comput.Commun.Security,2016,pp.270–282.[155]Q.Zhang,L.Cheng,andR.Boutaba,“Cloudcomputing:State-of-the-artandresearchchallenges,”J.InternetServ.Appl.,vol.1,no.1,pp.7–18,2010.[156]H.ZhongandZ.Su,“DetectingAPIdocumentationerrors,”inProc.27thInt.Conf.ObjectOrientedProgram.Syst.Lang.Appl.,2013,pp.803–816.[157]H.Zhong,S.Thummalapenta,T.Xie,L.Zhang,andQ.Wang,“MiningAPImappingforlanguagemigration,”inProc.32ndInt.Conf.Softw.Eng.,2010,pp.195–204.[158]Y.Zhou,D.Kumar,S.Bakshi,J.Mason,A.Miller,andM.Bailey,“Erays:ReverseengineeringEthereum’sopaquesmartcontrac-ts,”inProc.27thUSENIXSecuritySymp.,2018,pp.1371–1385.[159]T.Zimmermann,“Card-sorting:Fromtexttothemes,”inPerspec-tivesonDataScienceforSoftwareEngineering.Amsterdam,Nether-lands:Elsevier,2016,pp.137–141.[160]W.Zou,D.Lo,Z.Chen,X.Xia,Y.Feng,andB.Xu,“Howpracti-tionersperceiveautomatedbugreportmanagementtechniques,”IEEETrans.Softw.Eng.,2018,doi:10.1109/TSE.2018.2870414.WeiqinZoureceivedthebachelorÕsdegreeinsoftwareengineeringandthemasterÕsdegreeincomputersciencefromtheDalianUniversityofTechnology,China,in2010and2013,respec-tively.SheisworkingtowardthePhDdegreeintheSoftwareInstitute,NanjingUniversity,China,advisedbyProf.BaowenXuandProf.ZhenyuChen.Herresearchinterestsincludeempiricalstudyandminingsoftwarerepositories.DavidLoreceivedthePhDdegreefromtheSchoolofComputing,NationalUniversityofSin-gapore,in2008.Heiscurrentlyanassociatepro-fessorwiththeSchoolofInformationSystems,SingaporeManagementUniversity.Hehasmorethan10yearsofexperienceinsoftwareengineer-inganddataminingresearchandhasmorethan200publicationsintheseareas.HereceivedtheLeeFoundationandLeeKongChianfellowforResearchExcellencefromtheSingaporeMan-agementUniversity,in2009and2018,andanumberofinternationalresearchandserviceawardsincludingmultipleACMdistinguishedpaperawardsforhisworkonsoftwareanalytics.Hehasservedasgeneralandprogramco-chairofseveralprestigiousinter-nationalconferences(e.g.,IEEE/ACMInternationalConferenceonAutomatedSoftwareEngineering),andeditorialboardmemberofanumberofhigh-qualityjournals(e.g.,EmpiricalSoftwareEngineering).PavneetSinghKochharreceivedthePhDdegreefromSingaporeManagementUniversity.HeisasoftwareengineeratMicrosoft.DuringthePhD,hecompletedanexchangeprogrammeatCarnegieMellonUniversity.Hisresearchinter-estsincludeempiricalsoftwareengineering,softwaretesting,buglocalization,andminingsoftwarerepositories.Hisresearchhasbeenpublishedinseveraltop-tierconferencesandjournalsinsoftwareengineering.ZOUETAL.:SMARTCONTRACTDEVELOPMENT:CHALLENGESANDOPPORTUNITIES2105Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
Xuan-BachDinhLereceivedthePhDdegreefromSingaporeManagementUniversity,in2018.HeiscurrentlyalectureratTheUniversityofMel-bourneAustralia.Beforethat,hewasapostdoc-toralresearcheratCyLab,CarnegieMellonUniversity.Hisresearchinterestsspansoftwareengineeringandprogramminglanguages,includ-ing:softwaremining,empiricalsoftwareengi-neering,programanalysis,repair,synthesis,andveriÞcation.Hisresearchhasbeenpublishedinseveraltop-tierconferencesandjournalsinsoft-wareengineering.XinXiareceivedbothofthebachelorÕsandPhDdegreesincomputerscienceandsoftwareengi-neeringfromZhejiangUniversity,in2009and2014,respectively.HeisalecturerwiththeFac-ultyofInformationTechnology,MonashUniver-sity,Australia.PriortojoiningMonashUniversity,hewasapost-doctoralresearchfellowwiththeSoftwarePracticesLab,UniversityofBritishColumbiainCanada,andaresearchassistantprofessoratZhejiangUniversityinChina.Tohelpdevelopersandtestersimprovetheirproductivity,hiscurrentresearchfocusesonminingandanalyzingrichdatainsoft-warerepositoriestouncoverinterestingandactionableinformation.Moreinformationat:https://xin-xia.github.io/YangFengreceivedthebachelorÕsandmasterÕsdegreesinsoftwareengineeringfromNanjingUniversity,in2011and2013,respectively.HeisadvisedbyProf.BaowenXuandProf.ZhenyuChen,andhiscurrentresearchinterestsincludesoftwaretesting,debugging,programanalysis,miningsoftwarerepositories,andprogramcom-prehension.Healsohasastronginterestincrowdsourcingtechniques,especiallycrowd-sourcingtesting,debugging,andtaskassign-mentstrategies.ZhenyuChenisaprofessorofSoftwareInstituteinNanjingUniversity.Hisresearchinterestsaremainlytheareaofintelligentsoftwareengineer-ing.Heisthefounderofmooctest.net.HeservedastheeditorboardoftheIEEETransactionsonReliabilityJournalassociateeditor,theguestedi-toroftheJournalofSystemsandSoftwareandtheSP&EJournal,thePCco-chairofQRS2016,TSA2016,QSIC2013,AST2013.Hehaspub-lishedmorethan100papersintheleadingaca-demicconferencesandjournalssuchastheACMTransactionsonSoftwareEngineeringandMethodology,theIEEETransactionsonSoftwareEngineering,ICSE,FSE,ISSTA,ICST,etc.Heownsmorethan40patents(22granted),andsomeofhispatentshavebeentransferredintowell-knownsoftwarecompaniessuchasBaidu,AlibabaandHuawei.BaowenXureceivedthebachelorÕs,masterÕs,andPhDdegreesincomputersciencefromWuhanUniversity,HuazhongUniversityofSci-enceandTechnology,andBeihangUniversity,in1982,1985and2002,respectively.HeiscurrentlyaprofessorwiththeDepartmentofComputerSci-enceandTechnology,NanjingUniversity.Hismajorresearchinterestsareprogramminglan-guages,softwaretesting,softwaremaintenance,andsoftwaremetrics.Hehaspublishedexten-sivelyinpremieresoftwareengineeringjournalsandconferencessuchastheACMTransactionsonSoftwareEngineeringandMethodology,theIEEETransactionsonSoftwareEngineering,theJournalofSystemsandSoftware,theIEEETransactionsonReliability,ICSE,FSE,ICSME,ICST,etc.HeisamemberoftheIEEE.”Formoreinformationonthisoranyothercomputingtopic,pleasevisitourDigitalLibraryatwww.computer.org/csdl.2106IEEETRANSACTIONSONSOFTWAREENGINEERING,VOL.47,NO.10,OCTOBER2021Authorized licensed use limited to: University of the Cumberlands. Downloaded on December 15,2022 at 18:53:30 UTC from IEEE Xplore. Restrictions apply.
march/april 2017 1089-7801/17/$33.00 © 2017 iEEE published by the iEEE computer Society 97Smart Contracts – Dumb IdeaKieron O’Hara • University of SouthamptonIn the summer of 2016, the world of distributed public ledgers, blockchains, cryptocurrencies, and trustless trust was agog as a US$55 million hack unfolded on the Ethereum platform. Like a slow-motion car crash, it piqued interest for a few days, taking everyone’s minds off the impending Brexit vote and the unedifying US election cam-paign. In the end, the hack was thwarted, but the money’s final resting place is far less important than the issues it raises for the digital citizenry. Let’s explore some of those issues here.Smart ContractsTechies like to develop solutions for problems that nobody ever noticed.1 The rationale, in so far as there is one, is that a messy, scruffy real world needs to be tidied up by code, because tidiness is a virtue.In The Laws (written about 350 BC), Plato wrote a little about contracts in a way that implied that they were a well-understood and familiar part of contemporary civic life in Athens. He talked about what might happen if a man (probably only men could undertake contracts then) reneged on a contract, and who should arbitrate between the disputing parties. He also suggested that not all contracts were valid — for example, where some-one contracted to do something illegal, where one of the parties consented under pressure, or where the failure to carry out the contract wasn’t the fault of the party concerned. He didn’t go into much detail, but enough to indicate that the ancient Greeks had organized their affairs via contracts quite well for some time and didn’t require the gods (not even Silicon Valley ones) to adjudicate, thank you very much.Fast forward to the 1990s, when it began to be argued that e-commerce had created a need for contracts to be smarter.2 The idea of a smart contract is surprisingly difficult to pin down, but a recent definition is “a mechanism involv-ing digital assets and two or more parties, where some or all of the parties put assets in and assets are automatically redistributed among those par-ties according to a formula based on certain data that is not known at the time the contract is initi-ated.”3 By being party to a contract, agents agree to perform (or not perform) certain tasks, and the smartness resides in the use of technology to reduce uncertainty about and transaction costs of that agreement. In the ideal, the mechanism (program) of the smart contract would implement the contract. Neither side could renege, thanks to the remorseless logic-crunching of the machine, whose algorithm would execute, verify, and enforce itself.The applications no doubt go well beyond contracts — any kind of agreement that requires the parties take on risk during coordinated movement of assets could be rebooted into the 21st century with such mechanisms (includ-ing criminal schemes4). Trust is unnecessary, because the execution of the agreement is no longer separate from the agreement itself. The code is the contract. Its execution is the undertaking.This should give us pause. Part of the point of contracts, as with other types of constraining commitment such as promises and vows, is to increase trust and spread it more widely than local social mechanisms such as those based on acquaintance, kin, or tribe. Contracts are part of the panoply of means by which we globalize trust. In a society with the rule of law and in which contracts are generally respected, coop-eration is easier and less risky (and therefore more common). Thus, it’s odd to position a form of contract as reducing the need for trust. Let’s
98 www.computer.org/internet/ iEEE iNTErNET cOmpUTiNGpark this thought for now — we’ll return to it.Building on Smart ContractsSmart contracts are an old (in digital years) idea, but their implementation became practical with another more recent technology that doesn’t trust trust: blockchains. The terms of the contract and the assets to be trans-ferred can be arithmetically coded into the open source, consensus-based, timestamped chain, and its execution verified independently. Neither party can modify the code independently, and so a blockchain-enabled smart contract will simply chug on to its conclusion, no matter how long that takes or indeed whether either party changes its mind about the contract itself.Now that smart contracts have an implementation mechanism, we can envisage how to build on them. For instance, an organization is basi-cally a group of agents cooperating in the pursuit of some kind of goal or type of practice, and many orga-nizations — private enterprise firms, most obviously — are structured using contracts, both to constrain the roles of owners, members/employees, and outside stakeholders (such as cus-tomers), and to assert property rights over buildings and other assets. Make those contracts smart, and you get an organization controlled not by a hier-archy (that’s so 20th century, dah-ling!) of (irrational) humans using (untidy) law, but a more autonomous peer network interacting via the ratio-nal, inexorable blockchain protocol.At least one platform, Ethe-reum (www.ethereum.org), has been developed with an eye to supporting smart contracts. A rival cryptocur-rency to Bitcoin, the ether, under-pins the mechanism, to encode the assets and pay for services and fees, but on top of this a more sophisti-cated scripting language facilitates a wider set of functions. Ethereum, at one stage apparently worth a cool billion dollars, has been grow-ing at Bitcoin’s expense as the latter struggles with expanding network capacity.5The Holy Grail is an autonomous organization governed by smart contracts whose operation is as far removed as possible from the day-to-day input of a clique of its managers, members, or owners — a Decen-tralized Autonomous Organization (DAO). The definition’s edges turn out to be fuzzy when you look at the details, but the idea is clear enough; as it’s decentralized it lacks a bottle-neck or single point of failure, while as it’s autonomous it runs itself. A DAO isn’t too different in principle from a complex multinational com-pany; firms are often owned by other firms (which count as legal persons), and it can be hard to work out who owns and is responsible for conglom-erates such as these. Some econo-mies, such as Italy’s or South Korea’s, contain deep overlapping networks of cross-ownership. Can the actions of a single company within those economies be identified easily as the responsibility of a particular person or group of people? Not always. In that context, a DAO might seem the next logical step.DAO Ker-ching!!The most prominent DAO called itself, with impressive hubris,6,7 The DAO. The DAO was (note the past tense) a capital investment fund run on the basis of peer-to-peer smart contracts, as well as a home for early adopters keen to show the concept’s viability. Investors bought ether coins to join the fund, in which they received a vote proportional to their investment. A candidate for funding would put forward a business plan together with a smart contract to define its relationship with The DAO; investors would vote on whether to support the candidacy. A “no” would mean there would be no relationship; a democratic “yes” would trigger the smart contract, and under the rules that it set, funds would flow.8 This, the largest crowdfunding campaign in history, raised $150 million in May 2016.By June, it had collapsed. Although there had been skepticism and some cautionary voices amid the hype, they missed the proximate cause. Some had worried that investment decisions, properly taken, were time-consum-ing, and so the number of votes cast for each decision might be too small to leverage the wisdom of crowds. With-drawing uncommitted money was simple to do, and so some commen-tators were concerned that the $150 million might disappear overnight. Still others wondered how the world’s financial system would cope with a company that wasn’t registered in any state, and which had no employees. As an article in The Economist opined, in the world of cryptocurrencies, faith and rationality go together like yin and yang.8Yet the problem was even more obvious than any of these difficul-ties. A bug in the code was exploited. The system depended on smart con-tracts, and if these weren’t secure (and research has located vulnerabilities in Ethereum’s code9), there would be nothing standing between hack-ers and 150 million smackeroonies. Less than a month after the flurry of publicity, $55 million disappeared in the general direction of who knows who, via a replay attack in which the same transaction was repeated over and again. Fortunately (depending on your point of view) the hack required the money to be siphoned off into a subsidiary bank account where it sat for long enough for Ethereum’s coders to devise and implement a hard fork to recover the cash10 and restore it to the investors (who immediately and wisely took it out of the system, no doubt breathing heavily and mopping sweat from their brows).Yet was this ethical, or principled? Recall, The DAO was premised on
march/april 2017 99smart contracts, whereby the code is the contract. The contract therefore couldn’t be rescinded, and trust in the system wasn’t needed — such was the rhetoric. Yet in the face of a loss that used the code as written, the smart contracts were indeed rewritten. A hard fork bifurcates the blockchain — it’s a change in the rules for vali-dating blocks that are the basis for consensus. After the rule changes, the chain diverges into two incompatible chains, one of which follows the new rules and the other clings to the old ways (and, it’s hoped, withers away). The relationship between these two branches — and the asset allocations they encode — is nontrivial.11 Many in the Ethereum community thought this played fast and loose with the ideology behind their innovation (which it does), and preferred to continue on the old fork (christened Classic Ethereum).The problem is clear: if the code is the contract, then whatever the hack-ers did was permitted within the con-tract. The facts that all code is buggy, and that the Ethereum coders clearly didn’t intend to license replay attacks, are neither here nor there. It was Ethereum that broke the contract, not the hacker, because The DAO, which held about one ether in seven in cir-culation, was deemed too big to fail. However, as we discovered in 2008, just because an entity is judged too big to fail, that doesn’t mean that it won’t fail.The rules is the rules, except where they isn’t. As the great philos-opher Mike Tyson once said, “Every-one has a plan till they get punched in the mouth.” How stands trustless trust now?Indeed, if the code is the contract, could the hacker even sue for his or her money back? That would be a juicy case!The Human FactorIf Ethereum can break its own unbreakable contracts, then the cer-tainty that’s supposed to be its unique selling proposition disappears. Yet smart contracts were always highly inadequate types of contracts.Can you engineer humans out of contracts? Suppose a smart contract — in insurance, for example — is to pay out after a certain event (say, an extreme weather event). If it’s distrib-uted across the blockchain, what or who is responsible for retrieving and verifying the meteorological data? Which copy of the contract activates the process? Whenever anything happens in the nondigital world as a result of the smart contract, there will surely need to be a human in the loop if only as a tiebreaker — the trusted third party turns out to be inevitable after all.This is unsurprising, but there’s a deeper point — the notion of a smart contract rests on a fundamental mis-understanding of what a contract is there to do. Contracts aren’t mecha-nisms to make specific things happen. They’re social arrangements — volun-tary constraints not unlike,12 but not identical to13,14 — promises, backed by the machinery of law.Contracts have a social func-tion (which is why they have legal underpinning). They enable cooper-ation, and help spread habits of war-ranted trusting around an economy. Society benefits from regular and reliable exchanges of goods and ser-vices; it’s hard to imagine the money economy functioning without a con-tract (money itself is another type of promise). Whereas many kinds of agreements receive support from rich networks of norms (of friendship, or kinship, for instance), parties to contracts often have little in com-mon beyond the contract. Hence the trust-building function is key to the social value of the institution.15Furthermore, the social good of contracts is promoted by the possi-bility of the contract being broken. That might seem paradoxical, and if the whole point of a contract was that contracted action A1 be performed by agent X, then X’s failure to perform it would be a moral outrage. Yet the law’s remedies aren’t generally puni-tive, and don’t enforce the perfor-mance of A1. In most jurisdictions all that other parties to the contract can expect to receive from X by way of damages is the expected value of A1. Furthermore, the law also expects other parties to take steps themselves to minimize the damage caused by X’s default.The result of this is the optimi-zation of the social benefit of X’s resources. If X can get better use of her resources by doing something other than A1, then she’s able to, and is better off even after compensating the other parties to the contract (who are no worse off). This is called the doctrine of efficient breach.16Won’t this foster a culture of opportunism and betrayal? It hasn’t yet; contracts are respected, and the law could always be changed if this ceased to be the case. The point made by supporters of efficient breach is that making the compen-sation equal to the losses following from the breach of contract encour-ages efficient breach while discour-aging inefficient breach; any more is mere paternalism. Note also that even in this limited sense, a con-tract still goes beyond a promise; a promisor neither opens herself up to legal scrutiny, nor takes upon herself responsibility for correcting harms done by failure to deliver.13Perhaps most important of all, a contract has built into it the presump-tion that interpretation and flexibil-ity will be needed, partly to deal with failures to agree on the meanings of particular commitments, partly because of the immense complexity of some contracts (for example, gov-erning major pieces of infrastructure), and partly because things change and both parties might want and expect the contractual terms to evolve over time. The courts can adjudicate here,
100 www.computer.org/internet/ iEEE iNTErNET cOmpUTiNGand can strike down unfair con-tracts, such as usurious loan rates or an unjustly one-sided employment arrangement.17 Contracts are also rarely in one direction; they generally involve reciprocity or exchange, and so have the additional complexity that brings.15There’s a balance between the words that each party signs to (the textual interpretation), and what each party wants out of the agree-ment (the intentional interpretation). Naturally there are arguments for each interpretation, and the courts seek a balance. This isn’t a bug, as techies might think, but a feature. On the other hand, there’s no way back from the smart contract (other than the hard fork, impractical as a general remedy for obvious reasons) if parties have misunderstood the specification of the code, if the code is poorly writ-ten, or if one party has been coerced or misled into taking on an unfair obligation.There are, no doubt, several impor-tant roles that could be filled by smart contracts. In some places, the rule of law may be shaky, or courts may be congested. Routine or short-term commitments might be better served by algorithms than contracts, and we could easily imagine arrangements within an organiza-tion being made using a blockchain. Intra-entity trust is a less-pressing issue than inter-entity trust, and so the inflexibility characteristic of the smart contract is less likely to cause long-term problems if used to allocate resources within a single organiza-tion. There’s also more likely to be agreement about terms.But smart contracts are dumb con-tracts, and the best contracts are fal-lible and human. In his influential book Code, Lawrence Lessig drew our atten-tion to various means of constraining human behavior — regulations, social norms, economic incentives, and code or architecture.18 This important argu-ment has resonated in many contexts, and has been a key axiom for 21st cen-tury digital politics.However, it also has led to a dan-gerous fallacy. Just because we can imagine different types of mechanisms being used to constrain behavior, it doesn’t follow, as many assume, that these mechanisms are interchange-able. It makes an enormous difference if we replace a legal constraint with software.In the first place, the law can be challenged, whereas in software the forbidden option is irreversibly grayed out and inaccessible. Second, the law is developed and administered transparently by our democrati-cally elected representatives and the courts; software development, even open source, is opaque, and con-centrated in a small programming community, many of whom are in the pay of a few oligopolistic corpo-rations directly accountable to no external party.Third — and most important from my point of view — we can break the law. There are consequences when we do, and the system would break down if we disobeyed it all the time. But the law is consistent with maxi-mal liberty; it can’t compel obedi-ence (though it can disincentivize it). Code, on the other hand, won’t allow behavior inconsistent with itself.With smart contracts, this rules out the desirable economic gain of efficient breach. But in the wider context, the law’s openness to breach allows many vital liberties, not least of which is the civil dis-obedience that helped shape our civilized liberal order from Thoreau to Gandhi to King. The next time we consider replacing law with code to tidy up a scruffy world, let’s remem-ber that. AcknowledgmentsThis work is partly supported by SOCIAM: The Theory and Practice of Social Machines, funded by the UK Engineering and Physical Sciences Research Council (EPSRC) under grant EP/J017728/2.References1. E. Morozov, To Save Everything, Click Here: Technology, Solutionism, and the Urge to Fix Problems That Don’t Exist, Perseus, 2013.2. N. Szabo, “Formalizing and Securing Rela-tionships on Public Networks,” First Mon-day, vol. 2, no. 9, 1997; http://firstmonday.org/ojs/index.php/fm/article/view/548.3. V. Buterin, “DAOs, DACs, DAs and More: An Incomplete Terminology Guide,” Ethereum Blog, 6 May 2014; https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide.4. A. Juels, A. Kosba, and E. Shi, “The Ring of Gyges: Using Smart Contracts for Crime,” Proc. 2016 ACM SIGSAC Conf. Computer and Comm. Security, 2016, pp. 283–295; http://initc3.org/files/Gyges.pdf.5. T.B. Lee, “Ethereum, Explained: Why Bitcoin’s Stranger Cousin Is Now Worth $1 Billion,” Vox, 24 May, 2016; www.vox.com/2016/5/ 24/11718436/ethereum-the-dao-bitcoin.6. H. Green, “Introducing the DAO: The Organisation That Will Kill Corpora-tions,” City A.M., 3 May 2016; www.cityam.com/240198/introducing-the-dao-the-organisation-that-will-kill- corporations.7. A. Cleary, “Here Is How the DAO Will Soon Become the Greatest Threat Banks Have Ever Faced,” Frontera, 25 May 2016; https://fronteranews.com/news/dao-will-soon-become-greatest-threat-banks-ever-face.8. “The DAO of Accrue,” The Economist, 21 May 2016; www.economist.com/news/ finance-and-economics/21699159-new-automated-investment-fund-has-attracted-stacks-digital-money-dao.9. L. Luu et al., “Making Smart Contracts Smarter,” Proc. 2016 ACM Sigsac Conf. Computer and Comm. Security, 2016, pp. 254–269; www.comp.nus.edu.sg/~loiluu/papers/oyente.pdf.10. V. Buterin, “Hard Fork Completed,” Ethe-reum Blog, 20 July 2016; https://blog.ethe reum.org/2016/07/20/hard-fork-completed.11. T. Rapp, “How to Deal with the Ethereum Replay Attack,” Medium.com, 17 July 2016;
march/april 2017 101https://medium.com/@timonrapp/how-to-deal-with-the-ethereum-replay-attack-3fd44074a6d8#.vu14sdqyl.12. C. Fried, Contract as Promise: A Theory of Contractual Obligation, 2nd ed., O
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
