How smart contracts work

📃 Unique Smart Contract Information

By Stuart Hollinger | DeFiKnowledge | 1 Apr 2021


 a Study of Smart Contracts — Stuart


Smart contracts are those that are defined by “if-then” statements. By using a smart contract, you can execute an action automatically if a set of conditions are met. The most common use for smart contracts is to define the terms of a financial agreement, for instance, who will get paid when, and how much. The advantage of smart contracts is that they are enforceable — if you define your agreement in a smart contract, it cannot be violated.


1*tnAcoHQyZcDFeXdQCmL7jw.png

Brief History of Smart Contracts

  • The concept of smart contracts was first introduced by Nick Szabo in 1997. Szabo, a legal scholar, and cryptographer outlined how a digital contract could be created and enforced automatically by a computer.
  • In 2005, computer scientist and cryptographer, David A. Korn, published the first draft of KornShell syntax to implement smart contract functionality.
  • In 2013, blockchain technology was first introduced
  • In 2015, Ethereum was introduced, which allowed the development of smart contracts on a blockchain platform.
  • In 2016, the DAO (Decentralized Autonomous Organization), which was the first DAO, was introduced onto the Ethereum platform.
  • The DAO was hacked in June 2016, and a large amount of Ether was stolen. Following this hack, the Ethereum hard fork was introduced in order to retrieve the lost funds.
  • As of June 2017, the number of smart contracts being executed has increased exponentially. In 2015, only 2 million smart contracts were executed, while in 2016, there were 50 million executed smart contracts.

1*figwhAOvoyypiUSLoeVOlA.png

How do smart contracts work?

To define a smart contract, you need to first define the “if” and “then” statements. The “if” is an event or condition that must occur before the action is executed, and the “then” is the action itself. To give a simple example, suppose that two parties, Alice and Bob, are building a website. They agree to split the revenue 50–50, with Alice building the front end and Bob building the back end. If Alice completes the front end and Bob completes the back end, the smart contract could automatically give Alice 50% of the contract profits.

See below for a more formal definition of a smart contract, taken from Cornell University:

Smart contracts are computer protocols that facilitate, verify, or enforce the negotiation or performance of a contract, or that obviate the need for a contractual clause. Smart contracts aim to provide increased certainty and trust between contracting parties, which could reduce transaction costs and enable new types of automated relationships.

Smart contracts are not just limited to financial transactions. You can store data (such as how many times an article has been read) and, when conditions are met, invoke a function to process the data (such as sending an author 10% of the revenue). Why is it useful? Smart contracts can reduce costs, save time and make processes more transparent.


1*hB5E1eu_ISNY8_PB8Qd6wQ.png

1. Automating processes

Smart contracts can be used to automate back-end activities such as sharing revenue, trading, or verifying information. You can also use them to automate the execution of contracts when conditions are met. You might ask yourself: “If I automate everything, won’t I lose flexibility?” The answer is no. You can still customize your process, but you do it at the front end before the contract is executed. You don’t have to code a bunch of IFs and THENs to define your contract.

2. Creating complex conditional relationships

Smart contracts can create complex conditional relationships. For example, a smart contract can be used to make sure there are no conflicts of interest. Suppose that an insurance company wants to buy a piece of land. A real estate broker is paid a percentage of the profit to find the buyer. In a traditional system, the broker could just find his own client and pocket the fee. In the smart contract system, the broker would not be able to sell the land to himself — the contract would automatically reject the transaction.

3. Reducing transaction costs

One of the biggest reasons why businesses turn to online platforms is to avoid transaction costs. Smart contracts offer the same kind of benefit. Suppose that Carla and David are buying a car from a car insurance company. Carla is from Europe, David is from America. They want a car that can travel both in Europe and America. Most of the time, the insurance company will not be able to find the right car. It will have to deal with both Carla and David’s insurance providers separately, which can be costly. With a smart contract, the company can offer a car that will meet both Carla’s and David’s requirements. Carla and David can use a smart contract to access the car in European and American territories without additional insurance costs.


1*RSTofiU79yNsZPgrPQi02g.png

How are smart contracts used in blockchain?

Smart contracts are used in a blockchain system to validate or get rid of the intermediary in a transaction. They are various applications such as token contracts, crowdfunding, legal contracts, insurance contracts, game contracts, real estate contracts, supply chain management, and many more. In a nutshell, smart contracts are designed to facilitate, verify, or enforce the negotiation of a contract or transaction, in a transparent way, without third parties. It is based on an agreement of a set of terms of the contract that is built into a computer code, resulting in automatic acceptance/execution of those terms. It is a program that executes contract terms when predefined conditions are met.

If you read all of this, then I just want to say you’re amazing and I hope your life goes well! Thanks for reading :)


Follow me for my crypto / DeFi content to expedite your knowledge!

🤓 Hire me! 👉 DeFiknowledge.com

🟦 Twitter 👉 Stuart (@DeFiKnowledge) | Twitter

 

How do you rate this article?

89


Stuart Hollinger
Stuart Hollinger

https://www.youtube.com/@DeFiKnowledge https://twitter.com/DeFiKnowledge


DeFiKnowledge
DeFiKnowledge

Hey, I'm Stuart and I like writing about Decentralized Finance and Cryptocurrency related content :)

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.