A smart contract is a computer program or a transaction protocol that is intended to automatically execute, control or document events and actions according to the terms of a contract or an agreement. [1] [2] [3] [4] The objectives of smart contracts are the reduction of need for trusted intermediators, arbitration costs, and fraud losses, as well as the reduction of malicious and accidental exceptions. [5] [2] Smart contracts are commonly associated with cryptocurrencies, and the smart contracts introduced by Ethereum are generally considered a fundamental building block for decentralized finance (DeFi) and NFT applications. [6] [7]
Vending machines are mentioned as the oldest piece of technology equivalent to smart contract implementation. [3] The original Ethereum white paper by Vitalik Buterin in 2014 [8] describes the Bitcoin protocol as a weak version of the smart contract concept as originally defined by Nick Szabo, and proposed a stronger version based on the Solidity language, which is Turing complete. Since Bitcoin,[ clarification needed ] various cryptocurrencies have supported programming languages which allow for more advanced smart contracts between untrusted parties. [9]
A smart contract should not be confused with a smart legal contract, which refers to a traditional, natural-language, legally-binding agreement that has selected terms expressed and implemented in machine-readable code. [10] [11] [12]
Smart contracts were first proposed in the early 1990s by Nick Szabo, who coined the term, using it to refer to "a set of promises, specified in digital form, including protocols within which the parties perform on these promises". [13] [14] In 1998, the term was used to describe objects in rights management service layer of the system The Stanford Infobus, which was a part of Stanford Digital Library Project. [1]
A smart contract does not typically constitute a valid binding agreement at law, [15] although a smart legal contract is intended to be both executable by a machine and legally enforceable. [16] [10] [11] [12]
Smart contracts are not legal agreements, but rather means of performing obligations deriving from agreements that can be executed automatically by a computer program or a transaction protocol, [15] such as technological means for the automation of payment obligations [17] or obligations consisting in the transfer of tokens or cryptocurrencies. Some scholars have argued that the imperative or declarative nature of programming languages would impact the legal validity of smart contracts. [18]
Since the 2015 launch of the Ethereum blockchain, [19] the term "smart contract" has been more specifically applied toward the notion of general purpose computation that takes place on a blockchain or distributed ledger. The US National Institute of Standards and Technology describes a "smart contract" as a "collection of code and data (sometimes referred to as functions and state) that is deployed using cryptographically signed transactions on the blockchain network". [20] In this interpretation, used for example by the Ethereum Foundation [8] or IBM, [21] a smart contract is not necessarily related to the classical concept of a contract, but can be any kind of computer program. A smart contract also can be regarded as a secured stored procedure, as its execution and codified effects (like the transfer of value between parties) are strictly enforced and cannot be manipulated; after a transaction with specific contract details is stored into a blockchain or distributed ledger, it cannot be changed. That's because the actual execution of contracts is controlled and audited by the platform, not by arbitrary server-side programs connecting to the platform. [22] [23]
In 2017, by implementing the Decree on Development of Digital Economy, Belarus has become the first-ever[ dubious ] country to legalize smart contracts. Belarusian lawyer Denis Aleinikov is considered to be the author of a smart contract legal concept introduced by the decree. [24] [ better source needed ]
In 2018, a US Senate report said: "While smart contracts might sound new, the concept is rooted in basic contract law. Usually, the judicial system adjudicates contractual disputes and enforces terms, but it is also common to have another arbitration method, especially for international transactions. With smart contracts, a program enforces the contract built into the code." [25] A number of states in the US have passed legislation on the use of smart contracts, such as Arizona, [26] Nevada, [27] Tennessee, [28] and Wyoming. [29] And in April 2020, Iowa's House of Representatives passed a bill legally recognizing smart contracts in the state. [30]
In April 2021, the UK Jurisdiction Taskforce (UKJT) published the Digital Dispute Resolution Rules (the Digital DR Rules) to help enable the rapid resolution of blockchain and crypto legal disputes in Britain. [31]
Similar to a transfer of value on a blockchain, deployment of a smart contract on a blockchain occurs by sending a transaction from a wallet for the blockchain. [32] The transaction includes the compiled code for the smart contract as well as a special receiver address. [32] That transaction must then be included in a block that is added to the blockchain, at which point the smart contract's code will execute to establish the initial state of the smart contract. [32] Byzantine fault-tolerant algorithms secure the smart contract in a decentralized way from attempts to tamper with it. Once a smart contract is deployed, it cannot be updated. [33] Smart contracts on a blockchain can store arbitrary state and execute arbitrary computations. End clients interact with a smart contract through transactions. Such transactions with a smart contract can invoke other smart contracts. These transactions might result in changing the state and sending coins from one smart contract to another or from one account to another. [33]
The most popular blockchain for running smart contracts is Ethereum. [34] On Ethereum, smart contracts are typically written in a Turing-complete programming language called Solidity, [35] and compiled into low-level bytecode to be executed by the Ethereum Virtual Machine. [36] Due to the halting problem and other security problems, Turing-completeness is considered to be a risk and is deliberately avoided by languages like Vyper. [37] [38] Some of the other smart contract programming languages missing Turing-completeness are Simplicity, Scilla, Ivy and Bitcoin Script. [38] However, measurements in 2020 using regular expressions showed that only 35.3% of 53,757 Ethereum smart contracts at that time included recursions and loops — constructs connected to the halting problem. [39]
Several languages are designed to enable formal verification: Bamboo, IELE, Simplicity, Michelson (can be verified with Coq), [38] Liquidity (compiles to Michelson), Scilla, DAML and Pact. [37]
Name | Description |
---|---|
Ethereum | Implements a Turing-complete language on its blockchain, a prominent smart contract framework [40] |
Bitcoin | Provides a Turing-incomplete script language that allows the creation of custom smart contracts on top of Bitcoin like multisignature accounts, payment channels, escrows, time locks, atomic cross-chain trading, oracles, or multi-party lottery with no operator. [41] |
Binance Smart Chain | A blockchain platform for smart contracts |
Cardano | A blockchain platform for smart contracts, using proof of stake |
Solana | A blockchain platform for smart contracts |
Avalanche | A blockchain platform for smart contracts |
Tron | A blockchain platform for smart contracts |
EOS.IO | A blockchain platform for smart contracts |
Tezos | A blockchain platform modifying its own set of rules with minimal disruption to the network through an on-chain governance model |
Processes on a blockchain are generally deterministic in order to ensure Byzantine fault-tolerance. [42] Nevertheless, real world application of smart contracts, such as lotteries and casinos, require secure randomness. [43] In fact, blockchain technology reduces the costs for conducting of a lottery and is therefore beneficial for the participants. Randomness on blockchain can be implemented by using block hashes or timestamps, oracles, commitment schemes, special smart contracts like RANDAO [44] [45] and Quanta, as well as sequences from mixed strategy Nash equilibria. [42]
In 1998, Szabo proposed that smart contract infrastructure can be implemented by replicated asset registries and contract execution using cryptographic hash chains and Byzantine fault-tolerant replication. [46] Askemos implemented this approach in 2002 [47] [48] using Scheme (later adding SQLite [49] [50] ) as the contract script language. [51]
One proposal for using bitcoin for replicated asset registration and contract execution is called "colored coins". [52] Replicated titles for potentially arbitrary forms of property, along with replicated contract execution, are implemented in different projects.
As of 2015 [update] , UBS was experimenting with "smart bonds" that use the bitcoin blockchain [53] in which payment streams could hypothetically be fully automated, creating a self-paying instrument. [54]
Inheritance wishes could hypothetically be implemented automatically upon registration of a death certificate by means of smart contracts.[ according to whom? ] [55] [56] Birth certificates can also work together with smart contracts. [57] [58]
Chris Snook of Inc.com suggests smart contracts could also be used to handle real estate transactions and could be used in the field of title records and in the public register. [59] [60] [61] [62] [63]
Seth Oranburg and Liya Palagashvili argue that smart contracts could also be used in employment contracts, especially temporary employment contracts, which according to them would benefit the employer. [64] [65]
Smart contract on block chain technology for smart villages [66]
The transactions data from a blockchain-based smart contract is visible to all users in the blockchain. The data provides cryptographic view of the transactions, however, this leads to a situation where bugs, including security holes, are visible to all yet may not be quickly fixed. [67] Such an attack, difficult to fix quickly, was successfully executed on The DAO in June 2016, draining approximately US$50 million worth of Ether at the time, while developers attempted to come to a solution that would gain consensus. [68] The DAO program had a time delay in place before the hacker could remove the funds; a hard fork of the Ethereum software was done to claw back the funds from the attacker before the time limit expired. [69] Other high-profile attacks include the Parity multisignature wallet attacks, and an integer underflow/overflow attack (2018), totaling over US$184 million. [70]
Issues in Ethereum smart contracts, in particular, include ambiguities and easy-but-insecure constructs in its contract language Solidity, compiler bugs, Ethereum Virtual Machine bugs, attacks on the blockchain network, the immutability of bugs and that there is no central source documenting known vulnerabilities, attacks and problematic constructs. [40]
Smart legal contracts are distinct from smart contracts. As mentioned above, a smart contract is not necessarily legally enforceable as a contract. On the other hand, a smart legal contract has all the elements of a legally enforceable contract in the jurisdiction in which it can be enforced and it can be enforced by a court or tribunal. Therefore, while every smart legal contract will contain some elements of a smart contract, not every smart contract will be a smart legal contract. [71]
There is no formal definition of a smart legal contract in the legal industry. [72]
A Ricardian contract is a type of smart legal contract.[ citation needed ]
Solidity is an object-oriented programming language for implementing smart contracts on various blockchain platforms, most notably, Ethereum. Solidity is licensed under GNU General Public License v3.0. Solidity was designed by Gavin Wood and developed by Christian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors. Programs in Solidity run on Ethereum Virtual Machine or on compatible virtual machines.
A cryptocurrency, crypto-currency, or crypto is a digital currency designed to work as a medium of exchange through a computer network that is not reliant on any central authority, such as a government or bank, to uphold or maintain it. It is a decentralized system for verifying that the parties to a transaction have the money they claim to have, eliminating the need for traditional intermediaries, such as banks, when funds are being transferred between two entities.
Nicholas Szabo is a computer scientist, legal scholar, and cryptographer known for his research in digital contracts and digital currency. He graduated from the University of Washington in 1989 with a degree in computer science and received a Juris Doctor degree from George Washington University Law School. He holds an honorary professorship at the Universidad Francisco Marroquín.
Ethereum is a decentralized blockchain with smart contract functionality. Ether is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capitalization. It is open-source software.
A decentralized autonomous organization (DAO), sometimes called a decentralized autonomous corporation (DAC), is an organization managed in whole or in part by decentralized computer program, with voting and finances handled through a blockchain. In general terms, DAOs are member-owned communities without centralized leadership. The precise legal status of this type of business organization is unclear.
A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. Since each block contains information about the previous block, they effectively form a chain, with each additional block linking to the ones before it. Consequently, blockchain transactions are irreversible in that, once they are recorded, the data in any given block cannot be altered retroactively without altering all subsequent blocks.
Hyperledger is an umbrella project of open source blockchains and related tools that the Linux Foundation started in December 2015. IBM, Intel, and SAP Ariba have contributed to support the collaborative development of blockchain-based distributed ledgers. It was renamed the Hyperledger Foundation in October 2021.
Joseph Lubin is a Canadian-American entrepreneur. He has founded and co-founded several companies including the Swiss-based EthSuisse, contributing heavily to Ethereum, the decentralized cryptocurrency platform. Lubin is founder of ConsenSys, a Brooklyn-based software-production studio.
A decentralised application is an application that can operate autonomously, typically through the use of smart contracts, that run on a decentralized computing, blockchain or other distributed ledger system. Like traditional applications, DApps provide some function or utility to its users. However, unlike traditional applications, DApps operate without human intervention and are not owned by any one entity, rather DApps distribute tokens that represent ownership. These tokens are distributed according to a programmed algorithm to the users of the system, diluting ownership and control of the DApp. Without any one entity controlling the system, the application is therefore decentralised.
A smart bond is a specific type of an automated bond contract that uses the capabilities of blockchain databases that can operate as cryptographically-secure yet open and transparent general ledgers. This is sometimes referred to as Distributed Ledger Technology (DLT). It is one of a class of financial instruments known as a smart contract, "a computerized transaction protocol that executes the terms of a contract."
Ethereum Classic is a blockchain-based distributed computing platform which offers smart contract (scripting) functionality. It is open source and supports a modified version of Nakamoto consensus via transaction-based state transitions executed on a public Ethereum Virtual Machine (EVM).
Cardano is a public blockchain platform. It is open-source and decentralized, with consensus achieved using proof of stake. It can facilitate peer-to-peer transactions with its internal cryptocurrency, ADA.
A cryptocurrency wallet is a device, physical medium, program or a service which stores the public and/or private keys for cryptocurrency transactions. In addition to this basic function of storing the keys, a cryptocurrency wallet more often offers the functionality of encrypting and/or signing information. Signing can for example result in executing a smart contract, a cryptocurrency transaction, identification, or legally signing a 'document'.
Gavin James Wood is an English computer scientist, a co-founder of Ethereum and creator of Polkadot and Kusama.
Distributed ledger technology law is not yet defined and recognized but an emerging field of law due to the recent dissemination of distributed ledger technology application in business and governance environment. Smart contracts, which are also enforceable legal contracts and were created through interaction of lawyers and developers, are called smart legal contracts.
A blockchain is a shared database that records transactions between two parties in an immutable ledger. Blockchain documents and confirms pseudonymous ownership of all transactions in a verifiable and sustainable way. After a transaction is validated and cryptographically verified by other participants or nodes in the network, it is made into a "block" on the blockchain. A block contains information about the time the transaction occurred, previous transactions, and details about the transaction. Once recorded as a block, transactions are ordered chronologically and cannot be altered. This technology rose to popularity after the creation of Bitcoin, the first application of blockchain technology, which has since catalyzed other cryptocurrencies and applications.
Decentralized finance offers financial instruments without relying on intermediaries such as brokerages, exchanges, or banks by using smart contracts on a blockchain, mainly Ethereum. DeFi platforms allow people to lend or borrow funds from others, speculate on price movements on assets using derivatives, trade cryptocurrencies, insure against risks, and earn interest in savings-like accounts. DeFi uses a layered architecture and highly composable building blocks. Some applications promote high interest rates but are subject to high risk. Coding errors and hacks have been common in DeFi.
ICON is a decentralized, open-source blockchain with smart contract functionality. ICX is the native cryptocurrency of the platform.
Colored Coins is an open-source protocol built on the Bitcoin 2.0 that allows users to represent and manipulate immutable digital resources on top of Bitcoin transactions. They are a class of methods for representing and maintaining real-world assets on the Bitcoin blockchain, which may be used to establish asset ownership. Colored coins are bitcoins with a mark on them that specifies what they may be used for. Colored coins are also considered the initial step toward NFTs built on top of the Bitcoin network.
Nervos Network is a blockchain platform which consists of multiple blockchain layers that are designed for different functions. The foundational layer is known as the Common Knowledge Base, whilst the native cryptocurrency of this layer is called CKB. This foundational layer uses a proof-of-work consensus model. Smart contracts and decentralized applications can be deployed on any layer.
Some distributed ledger technologies support an additional capability called a smart contract, which is similar to the concept of stored procedure in classical relational databases to some extent. Smart contracts allow the shared business processes within a business network to be standardised, automated and enforced via computer programs to increase the integrity of the ledger.
Firstly, that total quantity of BTC in a transaction's inputs must cover the total number of BTC in the outputs. That rule behaves similarly to a database stored procedure, except that it is impossible to circumvent. Secondly, BTC transactions use public-private key cryptography. That makes BTC act like a database with a publicly auditable per-row permission scheme.