Introduction to Smart Contracts

Smart contracts, although not without their faults, are putting the power back into the hands of the individual.

Kyle Turnbull

January 31, 2022 · 4 min read

Intro to Smart Contracts

Intro to Smart Contracts

What is a smart contract?

A smart contract is a fairly simple concept to understand. It is a contract stored on a blockchain that executes when predetermined conditions are met. Smart contracts can complete more complex tasks, such as automating a workflow, once conditions are met, but for now, let’s keep it simple. 

Nick Szabo coined the term in 1994 and described smart contracts as a set of promises, specified in digital form, including protocols within which the parties perform on these promises. Most definitions refer to autonomous software or programs that have the ability to self execute. 

For more context about some of the foundational ideas around smart contracts check out:

👉 The idea of smart contracts - Nick Szabo

How does it work?

These contracts work by applying “if/when, then” logic statements to the blockchain. For example, if person A receives funds, then transfers ownership of assets to person B. Its users can be as simple as a regular contract, only it is stored entirely on the blockchain, making it immutable and tamper-proof. These actions could include releasing funds to the appropriate parties, registering a vehicle, sending notifications, or issuing a ticket.

Once the contract is triggered, the blockchain is then updated. That means the transaction cannot be altered, and only the entities that were given permission are able to see the results. 

Benefits of smart contracts 👏

  1. Speed, efficiency, and accuracy: Once a condition is met, the contract is executed immediately. Because smart contracts are digital and automated, there’s no paperwork to process and no time spent reconciling errors that often result from manually filling in documents.
  2. Trust and transparency: Because there’s no third party involved, and because encrypted records of transactions are shared across participants, there’s no need to question whether information has been altered for personal benefit. 
  3. Security: Blockchain transaction records are encrypted, which makes them very hard to hack. Moreover, because each record is connected to the previous and subsequent records on a distributed ledger, hackers would have to alter the entire chain to change a single record.

Risks to consider 

Our reliance on smart contract software is not without risk. Although the underlying blockchain remains secure, errors in the contract code can readily cause unintended consequences. This is especially bad if the smart contract is directly linked to the transfer of assets. Many people grant transfer access to a smart contract, which in the wrong hands, means complete loss of funds. 

Fraud and theft accounted for $10.5 billion in 2021, a sevenfold increase from last year. For the most part, these losses occurred due to the exploitation of vulnerabilities in different smart contract protocols. Smart contract protocols are becoming increasingly targeted by bad actors, as projects leave the door wide open with un-audited code. A DeFi project is only as safe as the smart contracts it is built atop. 

Another risk concerns exploitable bugs, those soft spots in the code that are susceptible to hackers. The smart contract’s strength is also its weakness. It is not able to discern the subjective intention of a legitimate user, from that of an attacker. It will execute provided that the correct inputs are provided. End of story. 

Coinbase created a blog article detailing the most common smart contract risks:

👉 Top 10 smart contract risks

How can you mitigate your exposure to such risks?

For you, the user, we would always encourage you to carry out significant due diligence before subjecting funds to smart contract-powered protocols, and only ever invest what you’re willing to lose. Furthermore, always ensure that any project has been certified by a reputable audit company.

Smart Contracts and DeFi

Smart contracts are the building blocks of the DeFi revolution. They have facilitated the growth of what is now an enormous part of the crypto-ecosystems, to the value of 189billion USD at the time of writing. 

Smart contracts, although not without their faults, are putting the power back into the hands of the individual. These trustless protocols are allowing people from all walks of life to further participate in the global lending ecosystem, and earn good money for doing so. Without the advent of the smart contract, DeFi could not exist. 

Join us next time as we discuss DeFi in more depth, as we tackle liquidity pools and yield farming!

Recommended reads:

👉 Intro to DeFi

👉 What is a DAO?

Stay up to date.

Subscribe to our mailing list to keep up to date with all things Divi including when we are available in your region

  • Guides

Kyle Turnbull

January 31, 2022 · 4 min read

Browse Categories

  • Guides

Similar read

Beginners guide to crypto exchanges

July 09, 2021 · 5 min read

How to buy Divi on Kucoin

July 10, 2021 · 2 min read

How to buy Divi on AscendEX

July 10, 2021 · 2 min read