What Is a Smart Contract: All You Need To Know

Olga Shirimova
December 24, 2019
What is a smart contract article featured image

A smart contract is one of the main concepts of blockchain. By now, many people have heard the term, but few can explain how smart contracts work. In this article, we will dig into this important issue.

Smart Contract Definition

A smart contract is a computer protocol that can replace a traditional paper agreement.

It is a self-executing contract that defines the terms of the agreement in computer code. A smart contract can save both parties’ conflict, time and money. It ensures the automatic performance of the agreement.

Smart contracts exist within a decentralized blockchain network. It implies that they are:

  • Immutable
  • Irreversible
  • Traceable
  • Transparent
  • Peer-to-peer
Smart contracts explained

Smart contracts explained in simple terms.

There are three basic things a beginner should know about smart contracts:

  1. They are agreements between two peers, stored in a distributed ledger. Like any other blockchain-based record, no-one can change or cancel smart contracts. No central authority controls them.

  2. Smart contracts execute automatically. All the transactions within your smart contract are processed by the blockchain. You don’t need any intermediaries to do this work for you for money.

  3. The trust is ensured by the system itself. You don’t need to know your partner to trust him or her.  Two anonymous users who are not familiar with each other can use a smart contract without trust issues.
A smart contract code on a black background

This is what a smart contract looks like for a programmer. Image courtesy of Code Zen.

Smart Contract Examples

Ok, let’s see how a smart contract works. We will look at two examples — the first for a person and the second for a business.

Example 1: Flight Delay Or Cancelation

If an airline cancels your flight you can get compensation. Usually, you will be looking at a lot of paperwork. You will need to collect proof, submit a claim on the airline’s website or use a third-party service. In the last case, they will do the work for you and take part of your refund.

But let’s imagine the airline website uses smart contracts. The program linked to the arrival/departure schedule will track your flight. If the trigger event like a cancelation occurs, the money will automatically go to your bank account. A smart contract will define the amount of compensation and all terms will be visible in the code.

Example 2: Optimizing Business Processes

No matter what kind of business you run, smart contracts may help you streamline processes and reduce costs. Just imagine: any agreement fulfills automatically and on time.

If your company has completed a project and managed to meet all the quality requirements, the payment comes right to your bank account. The same thing happens if a contractor does work for you. Forget the unnecessary paperwork. No more misunderstandings that might end up in court. No delays. Less stress, less money spent, fewer people involved.

Advantages Of Smart Contracts

To sum up the benefits, here are the main things smart contracts have to offer:

  1. Independencу and autonomy. You don’t have to rely on any authorized intermediaries to have things done. No central body controls it. Smart contracts enforce the agreement between two parties automatically.
  2. Trust. Smart contracts allow you to make an agreement even with a person you don’t know. Both participants outsource trust to the blockchain network, where the math ensures it. This leaves fraudsters no chance.
  3. Security and easy access to your data. If every record and agreement is a part of a smart contract, all the blockchain network nodes store a backup of it. Wherever you go, you have your information always at hand. It is protected by cryptography, multiplied across many computers and unhackable.
  4. Speed. How much time do you normally waste on paperwork if you do it manually? Most of us hate this stressful process and try to put it off till tomorrow. Smart contracts will save you a lot of time for the things you like. For businesses, the technology can speed up many processes in an office and make them friction-free.
  5. Cost reduction. Smart contracts save our money: we don’t need to hire any intermediaries like real estate agents, lawyers, and notaries. You don’t need anyone to make, check, verify and witness your transaction. You just need a piece of code and some amount of ‘gas’ to run it.
The main barriers which could prevent wider use of smart contracts

The main barriers that can interfere with the mainstream adoption of smart contracts. Image source ThisWeekInFM

Disadvantages Of Smart Contracts

The pros of smart contracts are balanced by several important cons. Or rather, challenges.

  1. Code bugs. Smart contracts are programs written by humans. This means that there is always a chance for something to go wrong. Some developers report, they analyzed almost 20,000 smart contracts and found over 40% of them buggy. Given that such agreements are immutable and irreversible, the risk seems too high.
  2. Regulation. If you make a traditional agreement it is usually considered valid by everyone. But how can we regulate a smart contract? So far, there are no laws that prescribe how such agreements should be treated legally. It means if something goes wrong (see #1), you will not be able to bring the matter to the court.
  3. Taxation. Right now, the smart contracts issue is a huge headache for tax authorities. There are various solutions to this problem — for instance, smart contracts may be linked to crypto exchanges. But still — there are no rules or laws to regulate this kind of agreement.
Smart contracts use cases

Smart contracts use-cases: voting, real estate, healthcare, and more.

How Smart Contracts Are Used

Most smart contracts exist on the Ethereum blockchain. It’s made possible due to Ethereum Virtual Machine and ‘gas’. The machine is sort of a virtual supercomputer that executes smart contract scripts. “Gas’, as the name suggests, is a fee unit, needed to fuel the execution of a contract. You can code any agreement in this way.

Now that we understand the basics, let’s see how different industries can use this technology.

Insurance

A smart contract for an insurance company would look like “If A happens, pay amount X to party B”. The most common application so far is flight delay compensation. The Swiss blockchain startup Insurtech strives to solve this issue.

There are other branches of the insurance industry that can be improved due to smart contract integration. For instance, health insurance companies currently face many problems. They are connected with false or misleading patient data.  Verified and unchangeable medical history, stored in the blockchain, can make things transparent. It leaves no room for fraud and facilitates the payment process.

Government

The biggest problem of modern government is the lack of public trust. In the US, less than 20% of the citizens said they believed their government was doing it right ‘about always’. The reasons for this disappointment are many, but the solution may be one. A smart contract system would leave officials with no opportunity to tamper with important data. It reduces the risk of corruption, promoting healthier relationships between people and governments.

Voting

Smart contract apps like FollowMyVote protect voting from fraud. If an election process happens as a blockchain transaction, neither of the parties are able to ‘correct’ the results in order to win. When the voting officially ends the winner gets a special token.

Healthcare

Smart contracts can also be applied in the healthcare sector. They address problems like poor data management and insurance fraud. A blockchain database that stores all this info would be a good solution. As a doctor, you will have access to your patient’s complete health history. As a patient, you will be able to control access to your sensitive personal data.

Another problem is that patients lack the motivation to follow their treatment plan. They lie to doctors about their previous health conditions. A smart contract app could trace and measure your progress through special wearables and reward you for sticking with a plan.

How smart contracts would work in a simple property sale

How smart contracts would work for property sale. Image source White & Case.

Real Estate

Smart contracts could be a solution to many data management issues in the real estate sector. This industry is one of the most outdated in terms of business organization. The databases stored by different companies are often inaccurate or outdated.
A client looking for commercial property would be happy to have access to a database. It would list all the important characteristics of a building.

You could save a lot of money if you don’t have to pay any intermediaries just to get access to the correct information. find and contact the owner, and do all the paperwork. A smart contract can also make a rental agreement, regulating your rights and responsibilities.

This solution would also cut the number of frauds. For example, no one will be able to sell a house that does not belong to them by providing fake documents.

Supply Chain Management

The security of any supply chain is very important, especially if we deal with pharma products. The EU pharma industry alone loses around €16.5 bln annually because of counterfeit drugs. It increases the price of authentic products. What is worse, it is dangerous for public health, as fake drugs are useless or even harmful.

Smart contracts will help to make various supply chains transparent and 100% traceable — from manufacturer to the store. It would be impossible to sell counterfeit drugs, or groceries, or diamonds. Therefore, the damage caused to society will be greatly reduced.

Crowdfunding

A smart contract is a perfect instrument for a crowdfunding campaign.

If you want to launch a new project and need money for it, use an ICO (Initial Public Offerings). Create a smart contract on Ethereum blockchain and a token. Define the value of your token and the minimum amount you want to raise (X tokens). Smart contracts will keep track of these conditions.

Smart contracts distribute tokens among investors in the right proportion. If you fail to hit a soft cap, the money automatically returns to the investors.

Want to learn more about cryptocurrency investing? Read our crypto investment guide for beginners.

The benefits of the technology

Smart contracts pros explained visually.

The Future Of Smart Contracts

It’s clear that the future of smart contracts largely depends on if these problems will be solved.

it’s a new technology, which has both supporters and enemies. The first is enthusiastic, the second focuses on the problems and challenges. For example, if smart contracts start managing everything there will be a loss of jobs.

The optimists argue that lawyers will not disappear as a profession. Instead, they will get new tools to improve their business.

We think that smart contracts will become a part of our daily life. As for the challenges, every technological breakthrough faces — and finally solves them.

Smart Contracts: FAQ


Smart contract and blockchain: how they are related?

Any smart contract is blockchain-based by definition. A blockchain network provides an environment and tools for the creation and execution of these agreements.


What is a smart contract platform?

A smart contract platform is any blockchain network that allows us to create and run smart contracts. The top 5 smart contract platforms are Ethereum, RSK, EOS, TRON, and Stellar.


What is a smart contract in the Ethereum platform and how does it work?

Smart contracts in the Ethereum network are created and run using the EVM (Ethereum Virtual Machine). They also use something called ‘gas’ — a payment unit in which people measure processing fees.

Smart contracts on blockchain: what are their benefits?

The main advantages of smart contracts are autonomy, accuracy, trust, speed, low processing costs, and security.


What are the main disadvantages of smart contracts?

Like any piece of code, a smart contract can contain bugs. Other big challenges are regulation and taxation issues that have to be solved.

Latest news