HOME

TheInfoList



OR:

A smart contract is a
computer program A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components. 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 A contract is a legally enforceable agreement between two or more parties that creates, defines, and governs mutual rights and obligations between them. A contract typically involves the transfer of goods, services, money, or a promise to tr ...
or an agreement. 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. Smart contracts are commonly associated with cryptocurrencies, and the smart contracts introduced by
Ethereum Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether (Abbreviation: ETH; sign: Ξ) is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capita ...
are generally considered a fundamental building block for
decentralized finance Decentralized finance (often stylized as DeFi) offers financial instruments without relying on intermediaries such as brokerages, exchanges, or banks by using smart contracts on a blockchain. DeFi platforms allow people to lend or borrow funds ...
(DeFi) and NFT applications.
Vending machines A vending machine is an automated machine that provides items such as snacks, beverages, cigarettes, and lottery tickets to consumers after cash, a credit card, or other forms of payment are inserted into the machine or otherwise made. The fir ...
are mentioned as the oldest piece of technology equivalent to smart contract implementation. The original
Ethereum Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether (Abbreviation: ETH; sign: Ξ) is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capita ...
white paper A white paper is a report or guide that informs readers concisely about a complex issue and presents the issuing body's philosophy on the matter. It is meant to help readers understand an issue, solve a problem, or make a decision. A white pape ...
by
Vitalik Buterin Vitaly "Vitalik" Buterin (born 1994) is a Russian-Canadian computer programmer and founder of Ethereum. Buterin became involved with cryptocurrency early in its inception, co-founding ''Bitcoin Magazine'' in 2011. In 2014, Buterin deployed Eth ...
in 2014 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 Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher, and theoretical biologist. Turing was highly influential in the development of theoretical co ...
. Since Bitcoin, various cryptocurrencies have supported
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s which allow for more advanced smart contracts between untrusted parties. 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.


Etymology

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". 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.


Legal status of smart contracts

A ''smart contract'' does not typically constitute a valid binding agreement at law, although a '' smart legal contract'' is intended to be both executable by a machine and legally enforceable. Smart contracts are not legal agreements, but rather means of performing obligations deriving from agreements that can be executed automatically by a
computer program A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components. A computer program ...
or a transaction protocol,Mik, Eliza, Smart Contracts: A Requiem (December 7, 2019). Journal of Contract Law (2019) Volume 36 Part 1 at p 72 such as technological means for the automation of payment obligations 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. Since the 2015 launch of the
Ethereum Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether (Abbreviation: ETH; sign: Ξ) is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capita ...
blockchain, 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". In this interpretation, used for example by the Ethereum Foundation or IBM, 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. In 2017, by implementing the Decree on Development of Digital Economy,
Belarus Belarus,, , ; alternatively and formerly known as Byelorussia (from Russian ). officially the Republic of Belarus,; rus, Республика Беларусь, Respublika Belarus. is a landlocked country in Eastern Europe. It is bordered by ...
has become the first-ever 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. In 2018, a
US Senate The United States Senate is the upper chamber of the United States Congress, with the House of Representatives being the lower chamber. Together they compose the national bicameral legislature of the United States. The composition and po ...
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."Chapter 9: Building a Secure Future, One blockchain at a time
US Senate The United States Senate is the upper chamber of the United States Congress, with the House of Representatives being the lower chamber. Together they compose the national bicameral legislature of the United States. The composition and po ...
Joint Economic Committee, March 2018.
A number of states in the US have passed legislation on the use of smart contracts, such as Arizona, Nevada, Tennessee, and Wyoming. And in April 2020, Iowa's House of Representatives passed a bill legally recognizing smart contracts in the state. 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.


Workings

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. The transaction includes the compiled code for the smart contract as well as a special receiver address. 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. 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. 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. The most popular blockchain for running smart contracts is
Ethereum Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether (Abbreviation: ETH; sign: Ξ) is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capita ...
. On Ethereum, smart contracts are typically written in a
Turing-complete In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be used to simulate any ...
programming language called Solidity, and compiled into low-level
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
to be executed by the Ethereum Virtual Machine. Due to the
halting problem In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever. Alan Turing proved in 1936 that a ...
and other security problems, Turing-completeness is considered to be a risk and is deliberately avoided by languages like Vyper. Some of the other smart contract programming languages missing Turing-completeness are Simplicity, Scilla, Ivy and Bitcoin Script. However, measurements in 2020 using
regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s showed that only 35.3% of 53,757 Ethereum smart contracts at that time included recursions and loops — constructs connected to the halting problem. Several languages are designed to enable
formal verification In the context of hardware and software systems, formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal met ...
: Bamboo, IELE, Simplicity, Michelson (can be verified with
Coq Coq is an interactive theorem prover first released in 1989. It allows for expressing mathematical assertions, mechanically checks proofs of these assertions, helps find formal proofs, and extracts a certified program from the constructive proof ...
), Liquidity (compiles to Michelson), Scilla, DAML and Pact. Processes on a blockchain are generally deterministic in order to ensure Byzantine fault-tolerance. Nevertheless, real world application of smart contracts, such as
lotteries A lottery is a form of gambling that involves the drawing of numbers at random for a prize. Some governments outlaw lotteries, while others endorse it to the extent of organizing a national or state lottery. It is common to find some degree of ...
and
casino A casino is a facility for certain types of gambling. Casinos are often built near or combined with hotels, resorts, restaurants, retail shopping, cruise ships, and other tourist attractions. Some casinos are also known for hosting live entertai ...
s, require secure randomness. 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 and Quanta, as well as sequences from
mixed strategy In game theory, a player's strategy is any of the options which they choose in a setting where the outcome depends ''not only'' on their own actions ''but'' on the actions of others. The discipline mainly concerns the action of a player in a game ...
Nash equilibria In game theory, the Nash equilibrium, named after the mathematician John Nash, is the most common way to define the solution of a non-cooperative game involving two or more players. In a Nash equilibrium, each player is assumed to know the equili ...
.


Applications

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. Askemos implemented this approach in 2002 using Scheme (later adding
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the m ...
) as the contract script language. One proposal for using bitcoin for replicated asset registration and contract execution is called "
colored coins 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 ...
". Replicated titles for potentially arbitrary forms of property, along with replicated contract execution, are implemented in different projects. , UBS was experimenting with "smart bonds" that use the bitcoin blockchain in which payment streams could hypothetically be fully automated, creating a self-paying instrument.
Inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Officia ...
wishes could hypothetically be implemented automatically upon registration of a
death certificate A death certificate is either a legal document issued by a medical practitioner which states when a person died, or a document issued by a government civil registration office, that declares the date, location and cause of a person's death, as ...
by means of smart contracts.
Birth certificate A birth certificate is a vital record that documents the birth of a person. The term "birth certificate" can refer to either the original document certifying the circumstances of the birth or to a certified copy of or representation of the ensui ...
s can also work together with smart contracts. Chris Snook of '' Inc.com'' suggests smart contracts could also be used to handle
real estate Real estate is property consisting of land and the buildings on it, along with its natural resources such as crops, minerals or water; immovable property of this nature; an interest vested in this (also) an item of real property, (more general ...
transactions and could be used in the field of title records and in the public register. 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. Smart contract on block chain technology for smart villages


Security issues

A blockchain-based smart contract is visible to all users of said blockchain. However, this leads to a situation where bugs, including security holes, are visible to all yet may not be quickly fixed. Such an attack, difficult to fix quickly, was successfully executed on The DAO in June 2016, draining approximately million worth of
Ether In organic chemistry, ethers are a class of compounds that contain an ether group—an oxygen atom connected to two alkyl or aryl groups. They have the general formula , where R and R′ represent the alkyl or aryl groups. Ethers can again be ...
at the time, while developers attempted to come to a solution that would gain consensus. 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. Other high-profile attacks include the Parity multisignature wallet attacks, and an integer underflow/overflow attack (2018), totaling over million. 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.


Difference from smart legal contracts

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. There is no formal definition of a smart legal contract in the legal industry.Whitepaper: Smart Contracts and Distributed Ledger – A Legal Perspective
3.
A
Ricardian contract The Ricardian contract, as invented by Ian Grigg in 1996, is a method of recording a document as a contract at law, and linking it securely to other systems, such as accounting, for the contract as an issuance of value. It is robust through use ...
is a type of smart legal contract.


See also

* '' Code and Other Laws of Cyberspace'' *
Decentralized application A decentralised application (DApp, dApp, Dapp, or dapp) 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 tra ...
*
Ethereum Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether (Abbreviation: ETH; sign: Ξ) is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capita ...
*
Regulation by algorithms Government by algorithm (also known as algorithmic regulation, regulation by algorithms, algorithmic governance, algocratic governance, algorithmic legal order or algocracy) is an alternative form of government or social ordering, where the usa ...
*
Regulation of algorithms Regulation of algorithms, or algorithmic regulation, is the creation of laws, rules and public sector policies for promotion and regulation of algorithms, particularly in artificial intelligence and machine learning. For the subset of AI algorith ...
*
Ricardian contract The Ricardian contract, as invented by Ian Grigg in 1996, is a method of recording a document as a contract at law, and linking it securely to other systems, such as accounting, for the contract as an issuance of value. It is robust through use ...
(a design pattern to capture the intent of the agreement of parties) *
Loan In finance, a loan is the lending of money by one or more individuals, organizations, or other entities to other individuals, organizations, etc. The recipient (i.e., the borrower) incurs a debt and is usually liable to pay interest on that ...
*
Secure multiparty computation Secure multi-party computation (also known as secure computation, multi-party computation (MPC) or privacy-preserving computation) is a subfield of cryptography with the goal of creating methods for parties to jointly compute a function over their ...
* Transparency


References

{{Authority control Blockchains Computer law Contract law Cryptocurrencies Internet of things