What are smart contracts?
A smart contract is an electronic protocol written using computer code. Its purpose is to transmit information and ensure compliance with the terms of the contract by both parties. It is also called a smart contract.
Features of a smart contract
Smart contracts make it possible to safely exchange money, shares, property and other assets directly, without the participation of intermediaries.
In order to conclude any transaction, you need to contact a notary or lawyer, pay for the documents and wait for them to be processed. Often, many clauses of these documents contain references to legislative articles that can be interpreted to suit one’s own needs or circumvented. If the terms of the deal are not met, in real life people have to go to court, again spend money on the process and prove their case. When concluding such transactions, there can be no talk at all about the trust of the parties to the contract.
Let's consider this using the example of a transaction: you-to-me, I-to-you. Let's say you want to buy a mobile phone second-hand on an online trading platform. But there is no way to see reviews, and the seller asks for an advance payment. He asks because he is afraid that if he sends the parcel by cash on delivery, you will not pick it up and he will lose money for delivery there and back, that is, he will receive losses. You, for your part, are afraid that the seller will turn out to be a fraudster, will steal your money and will not send the goods or will send the wrong thing.
For this purpose, a program has been developed that monitors the fulfillment of the obligations of both parties specified in the contract, and also automatically charges fines for violation or failure to comply with the terms of the transaction. Smart contracts ensure transaction security and are free from the risk of ambiguous interpretation of conditions, due to the fact that they are based on cryptography. These are more profitable deals in financial terms, since a person does not need to pay lawyers, intermediaries, or sue if the contract is not fulfilled. Moreover, the terms of the transaction are fulfilled automatically with minimal costs for their support, without the involvement of third parties (intermediaries).
When and why did the smart contract appear?
In 1994, cryptographer and legal scholar Nick Szabo realized that electronic, self-executing contracts could be created using a decentralized ledger. They can be written in the form of code. The execution of contracts will be ensured by a network of computers that is controlled by a blockchain. Thus, people will be able to transfer money to each other and receive goods and services. It was only in 2008 that the idea of smart contracts was put into practice, thanks to the advent of blockchain technology.
In 2013, smart contracts began to be put into practice thanks to the creation of the Ethereum project.
Examples of using smart contracts
Spotify: Spotify has bought blockchain startup Mediachain Labs to leverage a decentralized database that will better connect artists and licensing deals.
IBM: Blockchain integrated into supply chains provides transparency through a shared record of transactions across the network. By incorporating smart contracts and blockchain into its supply chains, IBM can track materials and orders in real time without the risk of error.
Food. The complex supply-buyer pathways in the food industry make it difficult to trace the source of foodborne illnesses. Blockchain will improve the ability to determine where in the supply chain food has been contaminated.
Banking Smart contracts have many applications in the financial world. For example, smart contracts can automate the interaction between a lender and a borrower to obtain a loan. Additionally, smart contracts can seamlessly execute transactions between buyers and sellers in the stock market.
Mortgage The mortgage industry will be reformed using blockchain and smart contracts. Buyers and sellers will be easily connected automatically on the blockchain network. Smart contracts will regulate all characteristics of a real estate transaction. This will eliminate the need for lawyers and realtors. This change will make these types of transactions more efficient, saving money and time for both parties.
Escrow The escrow industry is worth billions; for example, when holding real estate, a fee of 2 percent of the value of the (purchased) property is charged to hold and provide funds for the purchase until the terms of the transaction are met. This is a service that can be directly replaced by the implementation of smart contracts. Instead of using escrow when purchasing real estate, the new system will look a little different. The buyer will buy virtual tokens (Ether or Bitcoin) and send them to the blockchain network. The tokens remain at this address until the smart contract programmed on the computer confirms that all the necessary conditions of the transaction have been met. These conditions may include: entering transaction information, or uploading a pdf home inspection certificate or signed transaction contract. When a transaction has all the required elements that are specified in the smart contract, the funds are automatically transferred to the seller's side, who can exchange them for actual currency. The convoluted escrow process and the need for an intermediary in real estate transactions are disappearing and becoming automated with the implementation of smart contracts.
Medical Research For physicians actively conducting research, sharing data freely and openly, and collaborating between different hospitals, it may be beneficial to create smart smart contracts. New discoveries can be easily reported without revealing the personal information of the subjects who took part in the study.
Financial Trading Smart contract changes the way international goods are traded by improving and optimizing the exchange of funds in a transaction. Smart contracts help make international trading more efficient by allowing two parties to enter into direct agreements with each other, eliminating the need for one party to place its money with a third-party intermediary. It is easier for two parties to trust each other because a smart contract makes the transaction unbreakable.
Insurance Smart contracts will make relationships between insurance companies and clients transparent. Using smart contracts, both parties enter into agreements without the need for verification by lawyers or notaries. This elimination of labor will save billions, and these economic benefits will ultimately be passed on to the consumer. This system will reduce the likelihood of fraud and make court decisions much more transparent.
Online Advertising The manager of an online store or other type of website can enter into a smart contract that automatically pays marketers if their advertising is successful. For example, a marketer who has published an advertisement for an online store will create an Ethereum or Bitcoin account with an amount of funds in it and link it to a smart contract signed with if/then conditions. For example, if an internet browser encounters an advertisement and clicks on it, and that click results in a sale in an online store, then the Ethereum account will pay a set fee (up to a certain amount) to the marketer's account.
New Industry: Smart Contract Service With the exponential growth of blockchain and smart contracts on the horizon, a whole new market and type of startup is beginning to develop. The business of creating smart contracts for other people/businesses is a new idea, but many programmers are pursuing it. Companies wishing to implement smart contracts for their transactions can hire third-party coders to code their own smart contracts.
How smart contracts work
Smart contracts are based on blockchain technology. This is a distributed registry, which is a decentralized system that exists thanks to many computers connected to one network. Blockchain allows users to carry out transactions, transfer information and material value without banks or intermediaries.
Smart contracts are essentially programs that are created based on computer logic and transmitted as code. That is why the participants in a transaction or agreement can be sure that all the terms of the contract will be observed, and none of the participants will be able to change the terms or interpret them to suit themselves. Code is the law of smart contracts.
How blockchain and smart contracts work
- You want to make a transaction. This transaction is forwarded to a computer network of peers (called nodes).
- The network of nodes confirms the transaction and user status.
- A transaction is considered to be the transfer of funds in cryptocurrency, the transfer of information, including contracts.
Cryptocurrency is digital money that is created and stored on a blockchain. The most famous cryptocurrency is Bitcoin. Cryptocurrency has no intrinsic value (it cannot be exchanged for gold), exists only in electronic form and is stored decentralized on the network (that is, it is not issued by a central bank).
- Once confirmed, the transaction is combined with other transactions and forms a new block of the digital ledger, which occupies a unique place in the blockchain chain and cannot be changed. Then the transaction is considered completed.
That is, the smart contract code is executed at the moment when a transaction or message arrives. This can be done from your account by sending a transaction or through another smart contract that sent the message. The code does not have access to the Internet and is also limited in access between smart contracts.
Smart contracts only respond to transactions. The founder of Ethereum explains how smart contracts work this way: an asset or currency is transferred to the program, after which it begins to monitor the fulfillment of the terms of the contract. Once they are completed, the seller receives the money and the buyer receives the goods. The work of smart contracts can be compared to a vending machine. You throw a coin and receive the goods without intermediaries, without the help of third parties.
Example smart contract code
This is a sample code that is written on the Ethereum blockchain platform. Ethereum provides unlimited opportunities for writing and working with smart contracts. Although there are other platforms where you can write a smart contract. Who writes the code for smart contracts? Any network member can volunteer to write code for a small fee (Gas). You can write contracts yourself, but to do this you will have to study for a long time and understand the computer languages Script and Turing (for Ethereum).
Where is the smart contract concluded?
Smart contracts are concluded on various blockchain platforms. These include:
- Bitcoin is the first cryptocurrency, but the ability to write smart contracts on it is very limited;
- Side Chains - in this blockchain, the possibilities for smart contracts are more expanded than in Bitcoin;
- NXT is an open online platform with a limited number of smart contracts that are written using blockchain templates. It is not possible to create a unique contract;
- Ethereum is an open online platform in which you can write any smart contract, but you need to pay for it with the cryptocurrency of this blockchain;
- You can also order the development of smart contracts from professional programmers.
Disadvantages of smart contracts
Smart contracts cannot be called an ideal tool for building relationships between people. They also have several disadvantages. Among the disadvantages:
- legal status - for the operation of smart contracts, cryptocurrency is used, but it is not yet accepted as an official financial instrument;
- errors - to draw up a smart contract, you need to specify all sorts of conditions and options for the development of transactions; the more complex the process, the more difficult it is to create a smart contract;
- lack of understanding - most users still have little understanding of what smart contracts are.
Despite the above disadvantages, smart contracts have a high potential to gain a foothold in our lives in the future. They will become increasingly used as things become connected to the internet.
How to use smart contracts?
The simplest example of using smart contracts is multisignature. With the help of such a signature, the parties to the agreement can freeze a certain amount of coins on the blockchain so that if it is necessary to spend it, the signatures of more than half of the participants will be required. This condition of the contract ensures the security of funds invested in the project. In case of failure, the funds will be returned to the investor automatically. If the collection of the declared amount was successful, then the multisig participants activate their keys, confirming the integrity of the project in which they are investing.
Smart contracts can be used for any financial actions in the field of insurance, registration or transfer of property, and lending. The most widespread use of smart contracts is observed in the business sector, where payments and actions based on payments are expected.
The Chamber of Digital Commerce has released a so-called “white paper”, which describes 12 areas in which smart contracts can be implemented.
- Digital identity. Smart contracts give you the opportunity to control your data, digital assets and reputation. Decide what data can be disclosed to counterparties and what cannot.
- Smart contracts have the potential to digitize and codify the Uniform Commercial Code, as well as automate its updating and future compliance with record destruction rules.
- Smart contracts allow you to bypass intermediaries in the securities supply chain. At the same time, dividends are automatically paid and liabilities are managed.
- Smart contracts are convenient to use for international payments. They provide a faster letter of credit, that is, payment of a trade transaction with a guarantee. The liquidity of a financial asset increases - this is the ability to quickly convert it into cash without significant financial losses.
- Smart contracts simplify post-trade trading processes. The contract specifies the terms and verification of the transaction. That is, the product’s compliance with the rules, standards and certifications that are specified in the contract. In case of low-quality goods, the seller does not receive money, and he is charged a fine for delivery of low-quality products.
- Financial institutions can use smart contracts to maintain records of financial data. This will help consolidate all data into one register and simplify the exchange of information between organizations. This will reduce audit costs and improve financial reporting.
- Smart contracts can be used to automate the processing of mortgage payments.
- Smart contract technology ensures the transfer of property without fraud.
- Thanks to smart contracts, you can track the entire supply chain of goods in real time. Via the Internet, you can record the movement of goods from the workshop to the supermarket shelf.
- In the car insurance industry, a smart contract can store an insurance policy as well as a driving history record. You can send requests to the Internet of Things, which can be installed in a car, after an incident, and thus quickly determine the cause of the accident.
- Smart contracts can improve clinical patient research by automating patient data and transferring information between clinics.
- Smart contracts can facilitate the dissemination of cancer data while protecting patient privacy.
Who uses smart contracts and how are they better than traditional ones?
The solution runs on a managed blockchain. The blockchain system will process direct debit transactions, in which the payment is initiated not by the sender, but by the recipient of the funds. The platform will allow you to track complaints between participants thanks to a decentralized corporate network - this will facilitate the exchange of messages and make the process transparent.
In addition to the Central Bank of Argentina, the system is being tested by financial organizations, clearing companies and leading commercial banks. The regulator and the development company are confident that a network of smart contracts can become the basis for an alternative clearing system.
In world practice, smart contracts are used not only in the financial market, including banking and insurance, but also in government administration, retail, healthcare, initial coin offering (ICO), etc.
According to Dune Analytics, the number of new smart contracts on the Ethereum network in March reached almost 2 million - this is a record 75% more than in February. The growth occurs against the backdrop of a decrease in the cost of placing a smart contract: now it takes an average of about $11,600 to issue it. This is due to the scaling of the technology and the implementation of Ethereum 2.0 (the Ethereum 2.0 Topaz test network was launched in April). It should be a decentralized blockchain platform that supports thousands of transactions per second, the processing of which is cheap and does not require huge energy costs.
What are smart contracts? Tatyana Zharkova, General Director of the FinTech Association (AFT), spoke about the principles of operation, areas of application, strengths and weaknesses of smart contracts.
The idea of a smart contract was first proposed in the 90s by an American scientist in the field of computer science, cryptography and law, Nick Szabo. He described a smart contract as a digital representation of a set of obligations between parties, including a protocol for the execution of those obligations.
Smart contracts are used to carry out various operations on the blockchain. These are computer algorithms that automatically monitor and verify data recording and ensure the fulfillment of obligations assumed by the parties to the contract. In this case, all terms of the transaction must be formalized and translated into the appropriate program code. Automatic execution of smart contracts using distributed registry technology allows reducing financial, administrative and time costs for participants when concluding and fulfilling the terms of a transaction.
Often, the execution of the terms of a smart contract depends on information that is located in third-party information systems - outside the distributed registry system, where the smart contracts themselves are recorded and stored. To obtain data from external sources, intermediary services—oracles—are used. For example, an oracle can provide exchange data on securities and currency rates to execute the smart contract logic for moving assets between participants in a trusted network or track the fact and dates of cargo delivery for further payment to the counterparty or imposing sanctions for non-fulfillment of obligations.
The creation and subsequent execution of a smart contract, as a rule, follows a certain pattern:
1) agreeing and consolidating the terms of the transaction between the participants, concluding/creating a smart contract;
2) connecting the smart contract to internal systems (systems of banks, financial or other organizations) and external systems - oracles;
3) waiting for the events described in the contract and the smart contract’s assessment of its status at a certain point in time (to what extent certain conditions have been met by both parties);
4) self-execution of the smart contract when participants fulfill the established requirements.
There are several types of smart contracts from the point of view of execution of agreements:
· control of property relations - ownership and conduct of transactions with digital assets (including cryptocurrencies and tokens);
· financial services - trading on the stock exchange, participation in auctions, trade financing, etc. (large platforms allow banking transactions to be carried out on the blockchain);
· credit obligations - execution of agreements on various forms of banking credit products (for example, the Masterchain platform provides accounting and storage of mortgages in a decentralized depository system);
· social services - insurance processes, voting and election procedures (for example, elections using the Polys blockchain platform in Saratov, electronic elections to the Moscow City Duma and the Moscow polling system “Active Citizen”);
· management of the delivery and storage of goods (for example, the Dixie network has established communication with suppliers using blockchain).
One of the most promising areas of application of smart contracts is the automation of the provision of banking services, such as supply chain financing, mortgage lending and small business lending. Smart contracts will automate payments and reduce uncertainty and credit risks.
The use of smart contracts immediately gives users a number of advantages.
Firstly, this is the transparency of the contract: the parties to the transaction can monitor its execution at all stages and make sure that the counterparty has fulfilled its part of the contract.
Secondly, the smart contract provides mechanisms for enforcing the fulfillment of obligations, such as fines and sanctions.
Another advantage of smart contracts is their verifiability, which allows you to determine the participants and the sequence of their actions, forming an audit trail. Also, the value of smart contracts lies in the security of their terms and data from third parties. The privacy of a smart contract isolates it from external influence, and liability is limited to the parties to the transaction.
But, despite all the advantages, working with smart contracts has its own difficulties associated with technical features, as well as the relative youth of the technology. Let's look at the main ones.
Automatic execution of a smart contract. On the one hand, this is an obvious plus. But in the world of living people and objective factors influencing business processes, this same item may receive a minus sign. It is impossible to “agree” with a smart contract. With automatic self-execution, he will not take into account arguments about a shortage of goods, a flood or everyday troubles, and a fine will inevitably follow for violating the terms of the deal.
A wary attitude towards new technology on the part of traditional, hard-to-rise enterprises, accustomed to working the old fashioned way. Such a counterparty may refuse to conclude a deal in a new way or, since he is accustomed to constant postponements, will violate the regulations established by the smart contract.
So far, in global legislative practice there is no officially established status of a smart contract. In some cases, this may make it difficult to resolve disputes if the terms of the deal are violated. In addition, the question of jurisdiction to resolve such issues remains open. Among other things, smart contracts are concluded within the framework of cross-border relations - and here difficulties in the field of substantive and procedural law may arise.
For example, the European Central Bank released a report in 2020 in which it highlighted several challenges associated with the use of smart contracts:
· the difficulty of determining the legal status of the program code, which is the basis of the smart contract;
· the code may contain errors, which will be more difficult to eliminate due to the interconnection of various elements within the distributed registry;
· execution of a smart contract is tied to external events, about which incorrect or unreliable information may be received.
But all these issues are being studied and gradually resolved, both in world practice and in Russia.
In our country, the FinTech Association (AFT) is actively involved in the development of distributed registry technology, together with the Bank of Russia and key participants in the financial market. At the AFT site, Masterchain was created - the first FSB-certified platform that uses Russian cryptography standards and meets all information security requirements.
Three projects are being implemented on the Masterchain platform - “Digital Bank Guarantees”, “Digital Letter of Credit”, “Electronic Mortgage Accounting” - which are based on a system of smart contracts. It implies that transactions can be self-executing, that is, a transaction (for example, a transfer of funds) can be carried out automatically when conditions are met. In this way, fraud is completely eliminated, and the process of concluding transactions becomes much simpler, faster and safer.
In general, the popularity of smart contracts and their ease of use are growing: the IT industry is working to improve the technology, and more and more companies from different industries are implementing blockchain. Currently, the main ways of developing smart contracts include the standardization of cryptography and templates, the creation of visualization tools for generating the logic of smart contracts from ready-made blocks, as well as the development of a legal and legislative framework regulating work with smart contracts.
Examples of smart contracts in real life
- You and a friend are playing betting on the outcome of a football match. You enter bets into the blockchain in the form of transactions, which are stored there until the end of the game. When the match ends, the smart contract checks the outcome on one of the sports sites and automatically transfers all funds to the winner.
- You ordered a product through an online store. Your payment for the goods is recorded in the blockchain and only after the courier service confirms that you have received the goods and are satisfied with its quality, the money is received by the seller.
- Also, with the help of smart contracts, you can settle a rental agreement. For example, the contract states that payment must be made from the 1st to the 5th of each month. In case of non-payment, the front door lock is blocked and you cannot enter the apartment.
- Regarding loan agreements. For example, you took out a loan for a car from a bank. If you have not made your monthly payment, the car is blocked.
- With the help of smart contracts, you can avoid illegal actions of intermediaries who want to make money from you. For example, you decide to rent out an apartment. You took the photo yourself and posted it on the site. Real estate agents copy your photos and put up the same ad to get a commission for listing your home. You can upload photos to the blockchain and sign them with an electronic signature in the Strampery service. This way your property will be protected.
- Mobile operator companies provide a service that is regulated by smart contracts. In case of loss or theft of a mobile phone, it is blocked, photographs the thief and transfers his photo to the mobile operator company. The phone also transmits the location of your phone. This way, you can guarantee the return of your mobile phone or reimbursement of the cost of your phone for a small fee per month.
- Smart contracts also provide personal identification. What is being considered in the future is the possibility of holding elections in the country through blockchain voting.
- You can also make a will using a smart contract. The system checks the existence of a death certificate for a specific person and automatically executes the will specified in the contract without intermediaries. In the future, smart contracts will likely become an integral part of our lives. Instead of paper contracts with a bunch of pages and unclear terminology, people will write smart contracts that save time, money and nerves. This will make it possible to structure and secure many areas of life without complications, mediation and bribery.
Advantages and disadvantages of smart contracts
Smart contracts have the following advantages:
- Saving money and time, since you no longer need to resort to the services of intermediaries to conclude contracts or transactions;
- Security is ensured, since the written terms of the contract are stored in a distributed registry, and no one can change them;
- The absence of intermediaries allows contract participants to work on more favorable terms and save money on lawyers, notaries, audits and intermediaries;
- Smart contracts provide faster resolution of issues. Once the terms of the contract are met, the parties immediately exchange assets. Of course, smart contracts also have their drawbacks :
- Like any computer program, they are subject to bugs and may not work correctly due to programmer errors;
- Creating a smart contract is not easy; it must take into account all the conditions and options of the transaction;
- Most users do not understand what smart contracts are and how to use them, which greatly reduces the number of participants;
- Protecting the user's device is the weak link in information security. The device itself and the record with the keys can be lost, then the person will not be able to access the system;
- Smart contracts are not flexible. If you can come to an agreement with a person, explain the situation, why you did not pay, for example, the rent, then everything is clear in smart contracts. Violation is a fine or punishment.
- If there is a need to consider a smart contract in court, it will be difficult to establish when the contract was drawn up and whether it was drawn up at all. Whether obligations were violated or not.
- Regulatory oversight will be needed in any case to resolve controversial issues. And interpreting smart contract code will require incredible regulatory skills.
- All smart contracts include code that does not always function correctly. Transit data may be damaged, private keys may be compromised. The developers continue to work to resolve these issues. Despite the shortcomings, smart contracts are increasingly gaining a foothold in the market in many countries around the world.
Advantages of smart contracts
If we consider smart contracts when used in different spheres of life, we can highlight a number of important advantages. Among the advantages:
- independence - you no longer need to resort to the services of intermediaries to conclude transactions;
- security - the smart contract is located in a distributed registry, its terms cannot be changed;
- savings - by getting rid of intermediaries, the parties to a smart contract can cooperate on more favorable terms;
- no costs - if the terms of the contract are fulfilled, the parties immediately exchange assets.
Differences between smart contracts and regular contracts
“Dumb” contracts are contracts that rely heavily on the actions of other people for functionality. This is why they need a trusted third (legal) party. It is easy to mislead or deceive people with such a contract. Comparison table between smart and dumb contracts:
Smart contract | Regular contract |
This is a program or transaction protocol that uses blockchain in its work. | Paper version of documents |
Code based | Based on law and legislation |
Written in computer language | Written in legal language |
The terms of the contract cannot be changed | Contract terms can be changed, rewritten or interpreted differently |
The terms of the contract are fulfilled automatically by all participants in the process | The terms of the contract may not be fulfilled or performed poorly |
If the terms of the contract are violated, the punishment, fine or sanction specified in the contract automatically occurs. | If the terms of the contract are violated, you must go to court |
All transactions are carried out without third parties and intermediaries | Transactions are carried out with many intermediaries. You need the help of a notary, a lawyer and contacting government services |
Transactions are carried out using cryptocurrencies | Transactions are carried out in foreign currency through banks |
When the terms of the contract are fulfilled, the exchange of values occurs instantly | Value exchange occurs with delays |
All data about counterparties is stored in the blockchain, and the person himself determines what information will be publicly available | Information about counterparties can be found only on the condition that he provides extracts and certificates from government bodies |
A contract can be concluded with a person from anywhere in the world without personal presence | The contract is signed only during a personal meeting of the two parties or their authorized representatives |
Transaction security is guaranteed | There are no guarantees. Any law can be circumvented |
When concluding a contract, all conditions are strictly observed unconditionally, otherwise a fine or refund of money to the buyer is imposed. | Conditions can be changed, negotiated |
Scams and scams excluded | The likelihood of deception, bribery, bribery is very high |
It is quite difficult to create a smart contract yourself in order to take into account all the possibilities and conditions of the transaction | To draw up a regular contract, you need the help of lawyers |
Smart contracts
As in the case of Bitcoin, you can use smart contracts without knowing the smallest details of the technology. In essence, this means that the code is stored on a blockchain (that is, a registry that records information about all cryptocurrency transactions), which guarantees compliance with the contract between the parties. The code is based on laws of logic (such as simple if...then constructs familiar to many from programming), conditions (which can interact with autonomous devices such as Internet of Things sensors) and cryptography tools such as public and private keys (this is a little more complex , but the functions are similar to telephone numbers and passwords).
Ultimately, we end up with an inviolable digital contract in which all possible outcomes are covered, and there is no possibility of deception if both parties to the contract fulfill their obligations.
This sounds promising, but it may not be entirely clear to some how this will change the business climate outside of a few special situations. Thanks to innovators and developers exploring the possibilities of these new tools - such as the user community of Ethereum (the most famous smart contract blockchain platform) - there are already ways in which blockchain has the potential to change the world.