Compare Brokers

Vs.

Trading Guides Cryptocurrency

What is a Smart Contract?

By TheTradingBible.com, Updated on: Feb 15 2024.

A Smart Contract is a digital agreement that lives on the blockchain (everyone can see it and it’s on more than one computer). All the contract’s terms are written in the form of automated code which removes the need for any enforcement mechanisms and allows even anonymous parties to engage in a safe contract.

Table of contents:

For making it easier for you to understand Smart Contracts, let’s begin with the basics.

A Smart Contract is the advanced version of a normal Paper Contract, in simple words it’s “logic translated into code”. All terms and conditions are stored in the Smart Contract in the form of a little computer program. This code becomes law (cannot be adapted later on) and automatically enforces the rules.

Smart Contract

Think about it: The most common problem of traditional contracts is that somebody breaks his side of the agreement. With Smart Contracts, all commitments within an agreement are in code and this code cannot be broken – Problem solved, right? Wait a minute...

How is it guaranteed that rules cannot be broken? 

Simple answer: Blockchain Technology.

Blockchain technology makes it possible to create a chain of information that is distributed (lives on more than one computer) and immutable (cannot be changed).

If you’re wondering how it’s possible to ensure that the information cannot be changed, it’s very simple:

  • Block 0 contains information of a couple transactions and rules
  • Block 1 will contain a little piece of code that is based on the content of Block 0 and additionally other transactions or rules
  • Block 2 will contain another little piece of code based on the content of Block 1 and so the chain continues growing with a dependency on the previous blocks
Blockchain Technology

If you wanted to change some information on Block 7540, you’d need to find a way to rewrite all the previous blocks as for the chain to make sense, that little piece of code must continue matching the contents of the previous block throughout the whole chain. 

So, analyzing what we’ve just learned:

  • We’ve got a chain that has little blocks with information that depend on each other
  • The chain lives on thousands of computers all over the world

Both features mentioned above sound ideal to ensure unbreakable contracts right? Well, they do.

  • The contract cannot be lost - It lives on thousands of computers
  • The contract’s contents cannot be changed - They’re stored on the Blockchain

And to make the deal even sweeter, what about the contents of Smart Contracts?

They are rules transformed into code.

There is no optional way to interpret them, different subjective approaches, etc. A program is designed to be executed in a particular way and produce a particular outcome based on certain conditions, so no more feelings, opinions, etc. 

To conclude why Smart Contracts are unbreakable, here’s what you need to remember:

  • They live on thousands of computers
  • They’re stored on the blockchain
  • The rules are translated into code, there is no room for opinion

Where does a Smart Contract come from? 

In the early 1990s, a well-known cryptographer, Nick Szabo, came up with the term “Smart Contract”. He argued that for each commercial transaction there are too many ineffective procedures (such as reliance on credit history, agencies, face-to-face exchange, and more). In Smart Contracts, he found the solutions in many many problems by:  

  • Easing procedures
  • Minimizing bugs
  • Minimizing the need for (sometimes unreliable) intermediaries
  • Lowering costs (fraud loss, transaction costs, and more)

Imagine, already in 1994 Nick Szabo concluded “Smart contracts have the potential to greatly reduce the fraud and enforcement costs of many commercial transactions“.

Smart Contracts Vs. Paper Contracts

Smart Contracts Vs. Paper Contracts

Meanwhile, we know: Smart Contracts represent agreements between parties – Just like normal Paper Contracts. Now, you may be wondering if Smart Contracts are really better than Paper Contracts? Let’s compare them!

Smart Contract Paper Contract
Cannot get lost (Is digital and lives on many different computers) Can get lost
Blockchain operates cheaper Intermediaries cause costs (enforcement and transaction costs, fees)
No need for any enforcement mechanisms (it automatically enforces the rules) Jurisdiction possible (Costs for lawyer and court)
Unbreakable, no fraud possible Parties can break their obligation of the contract
Blockchain executes within seconds Execution can take up to days
Smart Contracts are reusable In most cases, contracts are not reusable

Smart Contracts have a fancy name already because of the word “smart”, yet they’re nothing more than a digital version of the Paper Contract. After all, the above comparison shows us: Smart Contracts have some major advantages over their traditional counterpart, operate in a much better system, and ensure better conditions! 

How Smart Contracts work

We already know that Smart Contracts are little pieces of code that live in the blockchain and contain rules that get executed automatically, right?

Well, this is done through a very simple “if statement” logic. In other words, the piece of code says: if “this” happens, please do “this” and if “something else” happens please do “that”.

Let’s take a look at an example of how this works:

Smart Contract Example 1

Thanks to the Smart Contract above, the landlord is able to guarantee himself that the rent is always a minimum of $1000. If Tom ever tries to pay less, the Smart Contract automatically kicks him out of the property. Notice how different this was compared to a paper agreement? We didn’t have:

  • Lawyers
  • Courts
  • Taxes

Disputes didn’t even get to exist, it was all handled electronically by this cool little piece of code. 

An example of a Smart Contract

In a real-world scenario, Smart Contracts live on a Blockchain. So, the first step to creating one would be choosing one, learning its programming language, paying some particular fees to create the contract, and start using it.

If you were to choose Ethereum, you’d need to learn their own programming language called “Solidity”.

For the sake of simplicity, we’re going to continue using abstract examples that help you better understand the subject without going too deep into programming languages or particular Blockchains.

The example below is going to be a little more complex than the previous one as our Smart Contract will require information from the outer world to make decisions.

Tom and Mark bet 300 USD about the Tesla Price: Tom is convinced that by the end of the day, the Tesla Price will be the same. Mark bets that the Tesla price will change. 

Smart Contract Example 2

From the moment the agreement is programmed (correctly and without bugs), no one can change it anymore (There is no way for Mark or Tom to negotiate the conditions anymore. If the stock’s closing price is the same at the end of the day, the Smart Contract will automatically send Tom 300 USD, and if the price falls or rises, Mark gets paid 300 USD). 

You may ask now: How can the Smart Contract know about real-world information? 

Smart Contracts communicate with the real world using Oracles. An Oracle is another piece of code that talks with external data providers to acquire information (such as Tesla price).

Smart Contracts and Oracles

In this particular case, the following happens: 

  • Tradingview says, there is a 1.5 % drop in Tesla stock
  • Oracle pulls information from Tradingview
  • Oracle provides the Smart Contract with this information

Consequently, the Smart Contract knows about the price drop, and executes the actions based on the programming code above. Meaning: The Smart Contract automatically pays Tom’s 300 USD. 

What about different Oracles?

Well, Oracles can be pretty much anything! For example:

  • A sensor on a dock that scans every time a boat enters the port
  • An electricity meter to measure the consumption of any building
  • A sensor that detects every time a plane lands successfully

You could even create an Oracle that measures every time someone raises the voice in your house and create a Smart Contract that automatically punishes the person with $5 every time they scream!

So far, this is looking interesting, right? Let’s see how this can play out in the real world.

Smart Contracts Use Cases

Use Cases for Smart Contracts are almost infinite – Let’s have a look into a few interesting ones. 

Smart Contracts Use Cases

Smart Contracts in Divorce

Have you ever had friends or even family members who were involved in a Divorce, who had conflicts about the money, the assets, or the kids? Who spent huge amounts of money for lawyers while wasting their time just trying to find a solution? Or even in the worst case, that someone left the partner with nothing?

Smart Contracts in Divorce

Well, exactly those problems can become solved by Smart Contracts. 

A couple can simply go and create a Smart Contract, predefine every possible outcome (how to split properties, money, and how to handle kids), and be one step ahead of an endless fight. In the case of a divorce, the Smart Contract handles the situation automatically as agreed. 

Thanks to a well written Smart Contract, there’s no need for:

  • Lawyers and their expensive legal fees
  • Lengthy negotiations that can take months
  • Emotional stress on all family members

Just thinking about the fact that the average divorce rate in America is 50 %, and in Europe even 60 %, Smart Contracts can improve and speed up this very complicated process for many many people. 

Smart Contracts in Real Estate

Maybe it even happened to you or some close ones of you: You were “closing” the deal for a property, signed the contract, sent the cash, and never got the property because it all was a scam. Or, you even were the owner of a house, transferred the ownership to another person as it seemed a “reliable” guy, and after all, you found out that the money you received was black money (if you even received your money).

Well, exactly those issues of not knowing if you can trust the other person can be solved by Smart Contracts.

Buyer and seller create a Smart Contract and define all terms of transferring the ownership of the property. As soon as the Buyer pays, the Smart Contract transfers the ownership from the Seller to the Buyer, and both payment and ownership are documented in the Smart Contract.

Smart Contracts in Real Estate

Besides solving the trust issues, here are other benefits of Smart Contracts used in real estate: 

  • Time-consuming paperwork
  • Expensive bills of lawyer and notary
  • Walks to local authorities to provide documents
  • Long time between the transfer of the property and the payment

As we can see: Smart Contracts can streamline the process in Real Estate massively, facilitate property ownership while also eliminating the risk of fraud.

Smart Contracts in Legal Agreements for Investors

If you’ve ever tried to become an investor in a company or startup, you likely felt any of the below pain points:

  • Fear of a hidden clause in a contract where you can get kicked out later on
  • Your shares get diluted and now your investment is worth very little or nothing
  • The company just disappears with all your money

Thanks to Smart Contracts, those issues can be solved easily as Smart Contracts can:

  • Store the terms of an agreement (Investment amount, shares in the company, dividend payments, investor responsibilities, company responsibilities)
  • Verify if each investor and the company fulfilled their responsibilities
  • Automatically arrange next business orders (such as: Paying out dividends, etc.)

There’s no need for enforcement mechanisms but rather allows more trust towards our business partner. So, with Smart Contracts, even Legal Agreements for Investors can be changed towards a more easy and handy way, while bypassing legal obstacles with almost no risk. 

Risks and Vulnerabilities of Smart Contracts

As with every new invention or innovation, there can come risks and vulnerabilities. Let’s find out together what those downsides are – Because once we know about them, we know how to best avoid them in our case.

Humans

Human Error

Once a Smart Contract is deployed on the Blockchain, no one can change the code. A single mistake in the initial setup of a Smart Contract’s instructions can lead to undesirable outcomes. So, if you ever decide to set up a Smart Contract, make sure that your developer or programmer is the best at it.

Performance of Oracles

As we learned before, Smart Contracts communicate with the real world using Oracles. Regarding this communication channel, there are some risks involved: 

  • No data available
  • Data with errors
  • False data

Let’s take a look at a few examples of the above issues together:

  • You’re not able to get data from the real world when there’s no Oracle
  • The Smart Contract transfers all your money to your ex-partner because the Oracle connected to the bank was provided with the wrong data
  • You lose a bet with a friend because someone messed with the Oracle and sent false data

So, the important thing for you to understand is that when Smart Contracts have an interaction with the real world, there can be issues.

Regulation

Regulation

Regulations and taxes could make it very unattractive for companies and individuals to use Smart Contracts. As Smart Contracts and generally Blockchain Technology are not mature yet we don’t know if strong regulations are possible, for example:

  • High taxes on cryptocurrency transactions
  • Banning of Smart Contracts

Conclusion

Now that you understand all the basics about Smart Contracts, you have one clear advantage over many others: 

Knowing how to appreciate value.

As an investor or trader your main concern is looking for high-value assets or opportunities, right?

Hoping that your answer was a clear “YES” then we can agree also that the only way to find good opportunities is by knowing the first place, so let’s use our Smart Contracts knowledge in an imaginary example to understand how can we benefit from all of this by discussing the purchase and sale of big airplanes:

  • Right now the share of one of the world’s biggest airplane makers, Boeing Company, is trading at $243.
  • Boeing makes an announcement that they will switch all their selling operations to a Smart Contract driven approach
  • After doing some research, you find out that previously every time that Boeing sold a plane, they needed to spend a couple hundred thousand dollars on paperwork to be able to execute the transaction
  • Thanks to their recent switch to Smart Contracts, you know that Boeing will be saving more than a hundred million dollars every year

Ask yourself the following question:

  • When a company finds a way to make more money for itself and its investors or shareholders, what is the usual behaviour of its stock price?

Well, usually under these scenarios it’s likely that prices go up, and do you know why you were able to detect this opportunity?

Because you took the time to learn about what the hell is a Smart Contract!

Now, you can apply all your gained knowledge to trading! Go, have some fun!