What are smart contracts in a simple explanation

 

What are smart contracts in a simple explanation

A simple and easy explanation of what smart contracts are, and their relationship to blockchain technology, is what we will present to you in this topic that complements the previous parts of what is a technology or blockchain technology. And with this, we will have completed all the explanation needed by people who are unable to understand everything related to the blockchain in a simple and uncomplicated manner about everything related to these modern technologies.


In the previous two parts we talked about the agreement and its relationship with the blockchain and how to learn the blockchain , in this article we will talk about smart contracts or the automated smart contract that is executed automatically. In simplified ways, they are easy to understand in theory.


Smart contracts or smart contracts

A smart contract is an algorithm used to control and generate property information that automatically secures the contract for the benefit of the direct parties without the intervention of any kind of intermediary. In short, a smart contract is a set of blockchain functions and data that has an address there.


The smart contract technology is that contracts are registered in encrypted form on the blockchain. Smart contracts facilitate the exchange of assets and do not require intermediaries. Smart contracts are also resistant to hacking and fraudulent operations, and they preserve property for the parties.


The story of the history of smart contracts before we delve into their evil

Smart contracts did not begin to be used in conjunction with cryptocurrencies and the advent of blockchain. Rather, a similar idea emerged in the distant 1990s thanks to Nick Szabo, the American scientist and cryptographer. Nick Szabo defines smart contracts as data transfer protocols that ensure that each party's conditions are fully met.


Since then there has been no environment that guarantees the existence of smart contracts, when the technology hour came only in 2008 with the emergence of Blockchain and Bitcoin technology that gave birth to the emergence of smart contracts.


So in 2013 the Ethereum platform was born, where smart contracts could prove useful. Developers can now build applications without having to run their blockchain across numerous blockchains ready to implement smart agreements that ensure the rights of the parties mathematically without human intervention.


The smart contract environment

The development of smart contracts, as well as the monitoring of smart contracts, requires the fulfillment of certain conditions:


  • It is necessary to use this electronic signature method as an asymmetric encryption.
  • Open databases are required for the transactions to be executed.
  • It is also essential that there is not the slightest human factor in the business (the best example of this is the Bitcoin blockchain).
  • Platforms for the decentralized execution of smart contracts. Examples: Ethereum, Codius, Counterparty, ChainLink.

How do blockchains and smart contracts work

There is an inseparable link between a smart contract and the Blockchain, as the code and algorithm must be registered somewhere.

For a smart contract to run:

  • It needs to perform a transaction and send it to the nodes (peer-to-peer computer network).
  • The smart contract verifies the signatures of both parties, as well as that each clause of the contract is fulfilled.
  • Moreover, the contract makes a decision based on the last paragraph.
  • The smart contract completes the transaction and distributes the assets between the parties. If the conditions are not properly met, the articles of association issue fines and restrict access to assets.

On the Ethereum platform, smart contracts are activated and executed with a certain amount of Gaz token as a commission for each contract execution required for the transaction.

How to write the smart contract and in any language

The language of smart contracts is programming either in Python, C, or C ++, JavaScript, and so on ..., and this requires basic knowledge of programming basics. If the person desiring did not have such knowledge, then it will be necessary to involve other developers in the work. Then you must choose one of the available blockchains.

Simple contracts are based on the logic of programming and talking to the computer “over If… then Then… otherwise, Else If…”. On the other hand, smart contracts work like existing ATMs, so you will find a programming example for a smart contract when you delve deeper into this topic in the remaining lines.


More simply, smart contracts:

It's an important part of blockchain technology, but first, let's do a quick summary of what we called programming magic in the previous topic to explain how blockchain works. A public blockchain can be visualized as follows:

  • A similar agreement is written on a bunch of enchanted documents
  • Anyone can participate in maintaining this Agreement by owning one of these documents
  • Rules describe the changes you are allowed to make to a document
  • Any valid change to one document is automatically made to all other documents
These characteristics lead to each participant in the blockchain or the authentication and editing of the agreement on an identical copy of the same agreement, even though the agreement is subject to continuous change every second... minute...

The magic analogy above describes one set of enchanted documents (blockchains) that follow one set of rules. Different sets of enchanted documents have different rules for what changes are valid. The original set of enchanted documents is called Bitcoin, and the rules for this set of documents are:


  • Each enchanted document contains a list of all accounts and balances.
  • People have accounts, and they can send their Bitcoin to other accounts.

In essence, these are the rules by which digital money is created. Here is an illustration of one of the Bitcoin enchanted documents. The number next to each account indicates the amount of Bitcoin in that account.

Another set of documents is called Ethereum. The enchanted documents that make up Ethereum follow very similar rules to Bitcoin:

  • Each enchanted document contains a list of all accounts and balances.
  • Account owners can send transactions to other accounts.

I noticed slight differences in the wording between Bitcoin 1 base and Ethereum second. The difference is that some accounts on the Ethereum blockchain are not controlled by people. Instead, the procedures for these accounts are controlled by a set of instructions on the accounts.

Below is an illustration of one of the documents for the Ethereum blockchain. In the illustration, accounts B, E, and G are controlled by instructions, not people.

When there is a set of instructions on one of these accounts it is called a smart contract. Instructions are just computer programming, based on logic only. A smart contract can:


  • Perform calculations
  • Storing information
  • Send transactions to other accounts

As mentioned, the programmed account is not controlled by anyone, the process is completely independent! The original code is written by a person, but once the smart contract programming is uploaded to the blockchain, only the programming logic in the account dictates the actions of that account via the blockchain that controls that nothing changes in the smart contract after its launch.

The name "smart contract" is a bit confusing because it is not actually a contract, at least not in the sense that it is anything that needs to be complied with or endorsed. A natural contract has legal consequences in the "real world". If the counterparty in the contract does not abide by its part of the agreement, the legal system can be used to hold it accountable. On the contrary, a smart contract is not endorsed by anyone, but rather a set of self-executing instructions. A smart contract does not have much precedence in the "real world". The smart contract is only software capable of sending transactions to other accounts on the blockchain without any interference from any central authority or by any third person, and any agreement with the smart contract in order for it to be a real agreement. The legal complex and legal texts about the blockchain agreement must be created and approved. Between countries externally and internally.

In smart contracts, code is the law:
When contracting via regular contracts, many factors play an important role in whether you trust what you sign. The most obvious part is understanding what is written in the contract. The contract specifies the terms and conditions of a legal agreement (lawyer language), which is what you are bound by. Therefore, it is important to understand this legal rule and how it is interpreted by the legal system. That is why you always carefully read the terms and conditions of the agreements on Spotify, Facebook, Twitter, etc. You will never sign an agreement that commits you to providing your first child as payment for using their service (... the law).

The terms and conditions stipulated in the contract are bound by a wide range of existing laws. This means that you cannot be sure how the contract will operate just by looking at the content of the contract. There are laws that prevent you from offering your first child as payment for a service, even if you agree to this. Therefore, it is important to understand how the legal context plays into the terms of the contract (... the law).

Often these contextual laws act as collateral, sometimes making contracts work as intended rather than what is written.

For example, in an event written by journalist Matt Levine as an article about GBMorgan, he is receiving a heavy fine, despite his compliance with the conditions stipulated in the contract. In regulating the electricity market, JP Morgan found a way to manipulate the contract. JP Morgan did not break the rules stipulated in the contract, he followed them carefully, but he broke the intention of the contract and they were held accountable for that.

Even if you were to introduce your firstborn to slavery to try to stick to your part of the contract, there is still a risk that it is not enough. You can sell all your property and sell your family, but it may not cover your obligations in the agreement because you simply do not provide what was written in the contract, because the second party did not get what was done in the contract (money). The risk of entering into a contract with someone who is unable to fulfill part of the agreement is called the counterparty risk, and it must be taken into account when entering into the contract.

Even if you understand the contract and the legal context you still need to have confidence in the rule of law. Sometimes, what is written in the law is contrary to what is actually applied. This is why you may be reluctant to enter into a deal with the president's son in Koroptland. Because the contract with him is not worth the paper on which it was written.


How do these factors compare to smart contracts? A smart contract basically consists of two components that need to be understood and trusted:


  • Code and how to interpret it
  • Blockchain scalability

Just as with regular contracts, it is important to understand the actual content of a smart contract when interacting with it. But unlike a normal contract, which is written in law and interpreted by the legal system, the content of a smart contract is written in software code on a computer and interpreted by a computer. So what is the smart contract symbol that looks like in reality? Here is an example, an excerpt from the smart contract. (You are not forced to understand what is in the following lines):


function payOut (address _recipient, uint _amount) returns (bool) {
if (msg.sender! = owner || msg.value> 0 || (payOwnerOnly && _recipient! = owner))
throw;
if (_recipient.call.value (_amount) ()) {
PayOut (_recipient, _amount);
return true;
} else {
return false;
}
}

The smart contract symbol is the terms and conditions that were agreed upon before interacting with the smart contract. As long as you trust the blockchain, the smart contract is based on it. The code will be executed exactly as it was programmed, so the agreement cannot be breached after agreeing on the terms within the blockchain. Also, it is important to note that the programmed work does not mean that it will work as intended if there are errors in the code.

Applications and employment of smart contracts

Smart contracts are a set of instructions whose terms are programmed into blockchain technology, written in computer code. This symbol can be written in an infinite number of ways, just like words defining the terms of a regular contract can be written in an infinite number of ways. But just like words in a sentence, there are an infinite number of ways to arrange the symbol in a smart contract that give us no meaning. But what is interesting is the way the logic is arranged. What does that mean?

Before we answer this question for smart contracts, let's take a step back and consider the potential applications that could be on blockchain.

After the original Bitcoin paper was published, people began to realize that other types of agreements could be maintained using the same underlying technology. People envision other agreements that define ownership of different types of assets and the rules for how the agreements are updated. Some of these other applications were:


  • Digital identities (such as websites)
  • Non-digital assets such as gold, oil and real estate
  • Country currency, and other new types of currencies
  • Financial instruments such as stocks, mortgages and bonds
  • Fair gambling and betting
  • Data Storage Market Rules
  • Computational Market Rules
  • Clearing
  • Healthcare
  • Logistics services
  • Trading
  • Islamic affairs and insurance for religious data
  • Data reference

Smart contract application

If you look at Deloitte's 2016 analysis, clearing is definitely a prime candidate for smart contracts. There are also other promising areas, including: healthcare, logistics and online shopping. Let's take a look at some areas, and how many smart contracts can be applied in:

Clearing


Clearing means a large number of different agreements made between banks, as well as legal entities and individuals. The clearing company is obligated to take into account all mutual settlements between its clients to reduce the movement of funds from one account to another, reduce the commission for making transfers and the third party, and manipulate prices and data.

Due to the fact that manual processing of transactions is expensive and time-consuming, companies use the Blockchain ledger, which independently takes into account the transactions and terms of the parties, after which the smart contracts will do the rest.

Healthcare


Secure medical records are created using Blockchain and smart contracts. Since this type of information is confidential, it is possible to impose restrictions on displaying multiple-signed records. For example, if both parties (the patient and their doctor) want to share the information with another specialist, they can do so by placing their digital signatures.

This consolidation of information will facilitate scientific research and anonymous surveys. If the researcher wants to thank the person who shared it with useful information, a smart contract is the best way to make the payment.

Logistics services


Due to the bureaucracy, which is necessary to adopt various forms in the competent authorities, the logistics also suffers. Therefore, fraudsters have an opportunity to make money while companies only incur losses. The use of the blockchain will help prevent such problems, because each participant has access to a completely secure system that controls both the execution and the payment of the work.

For example, Barclays Corporate Bank uses smart contracts to record property transfers and automatically transfer funds to other financial institutions.

Commercial Business 


Smart contracts allow you to keep track of the entire product supply chain.

For example, you placed an order in a product from an e-commerce platform. Blockchain records order payments, but funds are only transferred to the seller's account after receiving your product and confirming your satisfaction.

The challenge was that every blockchain is built with one application in mind. Each new application requires a whole new blockchain, and creating a new blockchain requires a lot of resources, because a group of peers needs to start maintaining an agreement again.

Smart contracts changed that. The magic rules that define a single blockchain function can be replicated in smart contracts on a blockchain based on a smart contract. This means that instead of building a new blockchain for every type of application, it is possible to add several types of applications to a single blockchain using smart contracts. Which basically you create many blockchains on the same as the original first blockchain.


For example, a blockchain that identifies ownership of different types of assets, a “magic document” is basically just a list describing who owns those assets. Instead of using a complete blockchain for this app, this information can be included in a smart contract. Like a blockchain, a smart contract will essentially be just a list of accounts and their ownership, with rules describing correct updates to this list.

Smart contracts have the same applications as blockchain

Smart contracts also allow you to create small niche agreements, which help us not create new blockchains. Imagine, for example, that you want to bet with some people you have met on an online forum, we can create a smart contract that reserves gambling money from the parties for a period of 10 days and the winner will be automatically paid. Without any fraud, the contract will work on what has been agreed upon and send the money to the winning party.

The power of blockchain and smart contracts is not entirely clear before you consider the value of interaction between different applications. For example, if you have two smart contracts, one for dollar ownership and one for real estate ownership, you can use a third smart contract as collateral, allowing for real estate purchases without a third-party intermediary.

There are many use cases that are built on the blockchain, and smart contracts are built on the same platform creating an ecosystem of applications that complement each other.


How do I create my own contract

It's not as complicated as you think, if you are a programmer, what you will use is the programming language on Ethereum which is called Solidity, and if you are a programmer it will be easy for you to learn it quickly.

As previously mentioned, Ethereum is the popular program for creating and executing smart contracts. Next, you should analyze how to create your own smart contract on this platform, after which the smart contract must be written and tested before launching it on the blockchain.

Of course, in order to create your own smart contract, you need to have the appropriate programming knowledge. Otherwise, you will have to find developers to work for you.

The differences between smart contracts and traditional contracts

It is worth highlighting the following differences between smart contracts and their traditional counterparts:


  • Where: The smart contract is a virtual document based on the programming language and the Blockchain is used to implement it, while a normal contract is concluded on paper and abandoned and its legitimacy is guaranteed by international and governmental authorities.
  • Storage. The smart contract is stored in the Blockchain, and the latter is based on law and legislation.
  • Language used: Smart contracts use computer language, while regular contracts use legal language.
  • Safety: Smart contracts do not require intermediaries and are secure, while the paper version is fraught with risks and needs middlemen.
  • Means used: In smart contracts, the cryptocurrency is used to pay for services, in regular contracts - regular money.
  • Transparency: Smart contracts do not allow the terms of the contract to be changed, while the paper copy can be rewritten.
  • Duration of the process: If each condition is met, then the exchange of values ​​upon the conclusion of a smart contract takes place immediately. When using regular contracts, be prepared for delays due to legal procedures.
  • Contract drafting: You do not need the help of lawyers to create a smart contract, but you do need great programming knowledge, but it is difficult to prepare a traditional contract on your own.


The advantages and disadvantages of smart fuel

Advantages of using smart contracts:

  • No need to search for a middleman or specialist to enter into the contract.
  • Complete security is ensured by storing the contract in the registry in encrypted form.
  • Reliability provided by multiple copying of documents in the blockchain.
  • No middlemen needed, only saving money.
  • There is no need to fill in the forms manually, which has its own risk of making various mistakes.
However, even this type of contract like blockchain smart contracts has its drawbacks. For example:


  • Smart contracts are far from perfect. After all, there is a possibility of errors in the code.
  • There is still no specific law regarding smart contracts.
  • It is not known what taxes will be levied on transactions made through the smart contract.
  • There is no possibility to change the information contained in the smart contract.
  • A large number of banks are not satisfied with sharing confidential data in open records.
  • There is an issue with the speed at which transactions are processed.

One of the main problems with smart contracts is Oracle (the external agents responsible for the accuracy of the information provided from outside). It could be an Oracle:


  • Measuring instruments (for example, a thermometer).
  • Network participants who provide services to the Blockchain system.
  • Decentralized systems that have their own consensus mechanism, which is created on top of the master record.

Sometimes Oracles integrate with Blockchain, which allows them to function as one mechanism. The user sends their requests as transactions, to which Oracle responds with a Blockchain transaction. Due to the fact that both the question and the answer never leave the record, other users can view and verify the information, which is what it does like ChainLink solutions.

Finally, there are good indicators of blockchain and smart contracts, which are that some banks are already experimenting with technology, as well as investing in projects in this area. An increasing number of country structures are implementing blockchain and smart contracts in order to improve business and accounting transparency.

What do you think of smart contracts?

Comments

Popular posts from this blog

What is Fintech, its future, and how does it work

What is Bitcoin Gold or BCG simple and easy explanation

Buy Bitcoin with Binance with MasterCard or Visa