Defining and Scoping Smart Contracts

Much of the excitement in recent blockchain literature has been concerned with the potential for “smart contracts” executing autonomously on a blockchain, while (immutably) preserving transaction records. The first use of the “smart contract” term is generally credited to Szabo [Szabo 1997], [Szabo 2002]. [Gisler 2000] proposed requirements for electronic contracts to support legal aspects. Automated execution of electronic contracts predates blockchains and Nakamoto’s Bitcoin paper [Nakamoto 2008]. Automated trading systems were being discussed in the early 1990’s (see e.g., [Domowitz 1990]). Enterprise Resource Planning systems were being extended to detect actual and imminent contractual violations in the early 2000’s (see e.g., [Xu 2003]). XML proposals were made for capturing electronic contracts [Krishna 2004]. [Grigg 2004]’s Ricardian contracts proposal added parameters and prose beyond the code. A markup language for facilitating translating contracts from a human-oriented form into an executable representation for monitoring was developed by [Governatori 2005]. The availability of the solidity programming language in Ethereum [Buterin 2014] created additional momentum with a significant uptick in smart contract related publications starting in 2014 [Macrinici 2018].

The “smart contract” term, originally coined to refer to the general automation of legal contracts, seen a resurgence of interest due to the advent of blockchain technology. Given the variety of systems proposed and the complexity of the technologies underlying smart contracts it is difficult to evaluate many claims concerning their actual capabilities and real potential to change the commercial and legal landscape [Mik 2017]. Generally, smart contracts are computer protocols that implement the terms of a negotiated contract in a self-executing manner [Cieplak 2017]. Recently, the term is popularly used to refer to low-level code scripts running on a blockchain platform [Bartoletti 2017]. [van der Laan 2019] refers to smart contracts as applications that are deployed and executed on a blockchain’s decentralised infrastructure. [Rouhani 2019] considers the smart contract to be a programmable transaction that can perform a sophisticated task, execute automatically, and store on the blockchain. For [Di Angelo 2019a], smart contracts on a blockchain are programs running in a distributed, transparent, and trustless environment. Smart contracts for [Macrinici 2018], are essentially containers of code that encode and mirror the real-world contractual agreements in the cyber realm. Smart contracts are software programs featuring both traditional applications and distributed data storage on blockchains; acting as autonomous agents in critical decentralized applications according to [Praitheeshan 2019]. While the possibilities are endless, this does not help us decide whether a particular thing is or is not a smart contract.

More formally, [ISO 2019] recently defined a smart contract as a computer program stored in a distributed ledger system wherein the outcome of any execution of the program is recorded on the distributed ledger; noting, however, that a smart contract might represent terms in a contract in law and create a legally enforceable obligation under the legislation of an applicable jurisdiction. Some assets manageable by smart contracts (e.g., bitcoin) have been deemed commodities for regulatory purposes. Cryptocurrencies as blockchain applications also fit within this definition of a smart contract [Geirgat 2018]. A regulator [CFTC 2018] issued guidance on smart contracts describing them as fundamentally a set of computer functions, but also noted that they may incorporate elements of a binding (i.e., legally enforceable) contract. The International Swaps and Derivatives Association (ISDA) defines [Clack 2019] a smart contract as an automatable and enforceable agreement; automatable by computer, although some parts may require human input and control; enforceable either by legal enforcement of rights and obligations or via tamper-proof execution of computer code. Blockchain technology provides a platform for the decentralized execution of smart contracts. The class of programs executing in a decentralized manner and storing results in a blockchain includes smart contracts; not all such blockchain decentralized applications (dapps), however, are required to have any association with a contract; nor are autonomous programs executing legal contracts required to be decentralized. For the purposes of most technology-focused discussions, it would be less confusing to refer to dapps rather than smart contracts unless the dapp is envisaged as fulfilling some specific contractual function.

As computer code, a smart contract executes in the context of a particular virtual machine supported by a particular blockchain. Smart contracts can invoke other smart contracts executing in the same or other blockchains. Not all data sources for the smart contract are natively found in the environment of a single blockchain. A smart contract is an agreement that is automatically executed when certain conditions are met [Fournier 2019]. “Oracles” provide a mechanism for off-chain data to be made available for the smart contract executing in the blockchain. Many early smart contracts have been focused on financial applications. Off-chain financial data inputs to a smart contract might be prices of assets, or confirmation of trades from other blockchains, e.g. in an exchange between bitcoin and some other cryptocurrency. Hence, we can conclude that a smart contract executing in one particular blockchain environment may have input/output operations on its own blockchain or on an arbitrary number of other blockchains.

A key feature of smart contacts is the autonomous algorithmic execution based on a mapping of certain detectable states of nature to corresponding contractual actions [Bakos 2019]. With the advent of IoT blockchains, a broad range of cyber-physical data from sensors can become an input to smart contracts. To release their potential, it is necessary to connect the contracts with the outside world, such that they can understand and use information from other infrastructures [Guarnizo 2019]. Beyond financial applications, blockchains are also being proposed to control devices in the physical world [Lee 2019]. This implies that blockchain smart contracts could be used to control not just digital assets, but also physical devices.  A smart contract is not required by its definition to have physical I/O. hence smart contracts may have [0..n] inputs or outputs in the physical world.

All blockchains have performance limitations due to the computational and communication overheads of such decentralized systems. A blockchain execution environment, may not be the most suitable for all classes of workloads. The time for deployment and computation (including consensus) in blockchains may be significantly larger than in (non-blockchain) off-chain systems. Some blockchains also have an explicit cost for transactions (and computations) on chain (e.g., Ethereum gas). Computations on blockchains are reportedly cost two orders of magnitude more than regular cloud computing [Rimba 2017]. This has resulted in architecture proposals (e.g. [Eberhardt 2017], [Gudgeon 2019]) where the smart contract computation is moved off-chain and only the result is recorded in some transaction on the blockchain. Building on cloud computing concepts, Blockchain as a Service (BaaS) has been proposed to improve the productivity of application development, including support for smart contract design services [Lu 2019]; such an approach architecturally separates the smart contract from the underlying blockchain. In the typical case, the smart contract executes in the virtual machine of one blockchain. A “smart contract” executing entirely off-chain might be better referred to as an electronic contract; in general, such electronic contracts could execute in an arbitrary number of off-chain devices. A smart contract developed and deployed through blockchain as a service may be deployed and executed across an arbitrary number of blockchains.

Number of blockchains as I/O 1..n
Number of cyber-physical devices as I/O 0..n
Number of on blockchains where executing 0..n
Number of off-chain nodes where executing 0..n

Automation of trading functions and contractual obligations has been discussed in the literature for more than 20 years. The availability of blockchains with cryptographic transaction signatures and robust, immutable, decentralized transaction databases has given the topic additional impetus. General-purpose programming languages operating over blockchains have expanded the potential applications for blockchains. Flexibility can be helpful but also generates complexity in operation and administration. Not all dapps are smart contracts; code to automate and enforce an agreement does not always require an underlying blockchain. Smart contracts are not just algorithms, they can, and increasingly are, connected into our cyber-physical reality. Other computing systems have had such capabilities generating physical effects for some time. With smart contracts, these systems now have added contractual legal effects as well. 

References

[Bakos 2019] Y. Bakos, & H. Halaburda. “When Do Smart Contracts and IoT Improve Efficiency? Automated Execution vs. Increased Information.” Automated Execution vs. Increased Information (May 26, 2019). NYU Stern School of Business (2019).

[Bartoletti 2017] M. Bartoletti & L. Pompianu. “An empirical analysis of smart contracts: platforms, applications, and design patterns.” International conference on financial cryptography and data security. Springer, Cham, 2017.

[Buterin 2014] V. Buterin, “A next-generation smart contract and decentralized application platform.” white paper 3 (2014): 37.

[CFTC 2018] LabCFTC, “A Primer on Smart Contracts”, November 208.

[Cieplak 2017] J. Cieplak, & S. Leefatt. “Smart Contracts: A Smart Way to Automate Performance.” Geo. L. Tech. Rev. 1 (2017): 414-418.

[Clack 2019] C. Clack, & C. McGonagle. “Smart Derivatives Contracts: the ISDA Master Agreement and the automation of payments and deliveries.” arXiv preprint arXiv:1904.01461 (2019).

[DiAngelo 2019a] M. Di Angelo & G. Salzer. “Mayflies, Breeders, and Busy Bees in Ethereum: Smart Contracts Over Time.” Third ACM Workshop on Blockchains, Cryptocurrencies and Contracts (BCC’19). ACM Press, 2019.

[Domowitz 1990] I. Domowitz, “The mechanics of automated trade execution systems.” Journal of Financial Intermediation 1.2 (1990): 167-194.

[Eberhardt 2017] J. Eberhardt, & S. Tai. “On or off the blockchain? Insights on off-chaining computation and data.” European Conference on Service-Oriented and Cloud Computing. Springer, Cham, 2017.

[Fournier 2019] F. Fournier, & I. Skarbovsky. “Enriching Smart Contracts with Temporal Aspects.” International Conference on Blockchain. Springer, Cham, 2019.

[Geiregat 2018] S. Geiregat, “Cryptocurrencies are (smart) contracts.” Computer law & security review 34.5 (2018): 1144-1149.

[Gisler 2000] M. Gisler, et. al., “Legal Aspects of Electronic Contracts.” ISDO. 2000.

[Governatori 2005] G. Governatori,”Representing business contracts in RuleML.” International Journal of Cooperative Information Systems 14.02n03 (2005): 181-216.

[Grigg 2004] I. Grigg, “The ricardian contract.” Proc. First Int’l Workshop on Electronic Contracting, IEEE, 2004.

[Guarnizo 2019] J. Guarnizo, & P. Szalachowski. “PDFS: practical data feed service for smart contracts.” European Symposium on Research in Computer Security. Springer, Cham, 2019.

[Gudgeon 2019] L. Gudgeon, et al. “SoK: Off The Chain Transactions.” IACR Cryptology ePrint Archive 2019 (2019): 360.

[ISO 2019] ISO, “Blockchain and distributed ledger technologies — Terminology”, ISO/DIS 22739:2019

[Krishna 2004] P. Krishna, et.al., “An EREC framework for e-contract modeling, enactment and monitoring.” Data & Knowledge Engineering51.1 (2004): 31-58.

[Lee 2019] J. Lee, et. al., “A blockchain enabled Cyber-Physical System architecture for Industry 4.0 manufacturing systems.” Manufacturing Letters 20 (2019): 34-39.

[Lu 2019] Q. Lu, et al. “uBaaS: A unified blockchain as a service platform.” Future Generation Computer Systems (2019).

[Macrinici 2018] D. Macrinici, et. al., “Smart contract applications within blockchain technology: A systematic mapping study.” Telematics and Informatics 35.8 (2018): 2337-2354.

[Mik 2017] E. Mik, “Smart contracts: terminology, technical limitations and real world complexity.” Law, Innovation and Technology, 9.2 (2017): 269-300.

[Nakamoto 2008] S. Nakamoto,  “Bitcoin: A peer-to-peer electronic cash system.” (2008).

[Praitheeshan 2019] P. Praitheeshan, et al. “Security analysis methods on Ethereum smart contract vulnerabilities: A survey.” arXiv preprint arXiv:1908.08605 (2019).

[Rimba 2017] P. Rimba, et al. “Comparing blockchain and cloud services for business process execution.” 2017 IEEE International Conference on Software Architecture (ICSA). IEEE, 2017.

[Rouhani 2019] S. Rouhani, & R. Deters. “Security, Performance, and Applications of Smart Contracts: A Systematic Survey.” IEEE Access 7 (2019): 50759-50779.

[Szabo 1997] N. Szabo, The Idea of Smart Contracts, Nick Szabo’s Papers and Concise Tutorials   (1997)

[Szabo 2002] N. Szabo, “A Formal Language for Analyzing Contracts”, Nick Szabo’s Papers and Concise Tutorials   (2002)

[van der Laan 2019] B. van der Laan, et. al., “MUSCLE: authenticated external data retrieval from multiple sources for smart contracts.” Proc. of the 34th ACM/SIGAPP Symposium on Applied Computing. ACM, 2019.

[Xu 2003] L. Xu & M. Jeusfeld. “Pro-active monitoring of electronic contracts.” Int’l Conference on Advanced Information Systems Engineering. Springer, Berlin, Heidelberg, 2003.