What are smart contracts?
A smart-contract is a program that fulfills agreements concluded between two or more parties, as a result of which, when certain conditions are met, specific actions take place.
When a previously programmed condition is activated, the smart contract automatically executes the corresponding offer. If we consider a regular contract and a smart contract, then we can say for sure that both of them are agreements in which two or more parties agree to comply with some conditions. Their fundamental elements are the same: the voluntary consent of all parties, the object of the contract (product or service) and one thing. However, both differ in three factors: the way of writing, its legal consequences and the method of compliance.
History of smart contracts
The term “smart contracts” was firstly mentioned by software scientist Nick Sabo, probably in 1993, to explain the goal of incorporating into the development of protocols what he called the “highly developed” stage of contract law and related business practices in e-commerce. Sabo, inspired by researchers like David Chaum, also believed that developing smart-contracts through the implementation of cryptographic protocols and other digital security mechanisms could be a significant improvement over traditional legal contracts. Sabo used the word "smart" in quotes and said that artificial intelligence would not be involved. He gave a classic example of a smart contract: this is a vending machine. If the conditions of the "contract" suit the buyer (i.e., he puts the money in the machine), the engine automatically observes the terms of the unwritten agreement and provides the purchase. Currently, several formal languages have been developed that have been proposed to define the terms of the contract. At the moment there are many working groups specializing in smart contracts that contribute to the continuation of this study in the future. Before the advent of the blockchain, no platform could make smart contracts a reality, so it was defined only conceptually.
How do smart contracts work?
Smart contracts are entirely digital and written in a programming language. In addition to setting commitments and consequences in the same way as in a regular physical document, the code can be executed automatically. Consequently, it can receive and process information relating to the negotiations, already taking action by the rules of the contract.
Bitcoin is limited in the use of coins for financial transfers. The Ethereum platform replaces the more limited Bitcoin language (a scripting language numbering about one hundred) and replacing it with a language that allows developers to set their scripts. Ethereum allows developers to program their smart contracts. The language is “Turing complete,” which means that it supports a broader toolkit of computational instructions. The Ethereum platform was used to distribute decentralized applications (DApps) based on Blockchain technology. In fact, instead of multiple applications managed by many protocols, Ethereum allows you to manage all applications using a single protocol. Ethereum is a platform that allows developers to create any program and run it on the essential functions of Blockchain technology, using smart contracts to automatically perform their actions, using the predefined conditions built into the algorithm. In case the requirements are met, the specified function is automatically terminated without the need to take any action.
Advantages of smart contracts
Using smart contracts, it is no longer necessary to resort to the help of a third party, for example, a lawyer or a notary, who, in addition to being prone to mistakes, entails considerable expenses. The blockchain can protect information in an encrypted network that can be accessed from anywhere in the world, so speed and security are apparent.
The most important benefits of contracts are:
- Autonomy. These contracts are always concluded between one or several natural or legal persons but without intermediaries. To confirm the contract does not require a lawyer. Therefore, the parties reduce and may even eliminate any extra person who does not participate in the contract.
- Cost reduction. Since contracts are independent of third parties, costs are reduced. Less human intervention leads to lower costs.
- Speed. Smart contracts use software code to automate tasks that would otherwise be performed manually. Therefore, they increase the speed of business processes and are less prone to errors.
- Security. Establishing contracts on the Ethereum blockchain, they cannot get lost. Everything is unchanged. Nothing and no one can make them disappear, and you always have access to them. The decentralized control process eliminates the risk of manipulation, since execution is controlled automatically by the entire network, and not by a separate part.
Disadvantages of smart contracts
On the other hand, programs of this type also have certain disadvantages. The main thing is in the use of technologies that it uses: IoT and blockchain. Although IoT can provide connectivity to assets, the truth is that it still has a long way to go in security. IoT devices are easy to hack. Blockchain, on the other hand, is more than safe, but it is immutable. Once the conditions are agreed, they can not be subsequently changed, which is undoubtedly unprofitable for one of the parties.
How to create a smart contract?
The contract is designed in a specific language (Solidity, Serpent or Mutan), compiled into EVM and, with some exceptions, complies with the standard ERC20 interface. Solidity is a language that is based on JS, Python and C ++. So, to approach the creation of a smart contract, you need to know Solidity. Also, as paper contracts are created by people who know the entire legal environment around them, in smart contracts you need to know a computer code called Solidity. Smart contracts have two “levels”: the smart contract platform (SCP), which is the infrastructure that allows you to create and manage them on the blockchain, and the smart contract management system (SCMS ). This protocol is added to this infrastructure to make it easier for the user to interact with contracts. That is, it is a graphical interface. The contract is executed online, within the Ethereum virtual machine (EVM). This performance is not free but is paid in the form of "gas," a small amount of broadcast currency contributed by one or more parties to the contract. An important detail is that the execution is decentralized and is performed in all nodes of the network. This is one of the reasons EVM is so slow and can only process about 15 transactions per second.
Legalization of smart contracts
The current legislative position is elementary: it has never been discussed in legislative bodies. The reason is that this discussion is preventive, since contracts are not publicly available, even though there is a beta version of the software to demonstrate the technological concept.