2 min read

Smart Contracts- What are they? How it works?

Smart contracts are simply software programs that are executed when predetermined conditions are met.
Smart Contracts- What are they? How it works?
Photo by Romain Dancre / Unsplash

One of the core concepts behind block - ‘Decentralisation’ has opened doors for many use cases where the need of the third-parties can be eliminated. This will save money, time and these are considerably faster, cheaper, and more secure than traditional systems. Smart Contracts are developed based on these core concepts.


What are Smart Contracts?

Smart contracts are simply software programs that are executed when predetermined conditions are met. These are computer protocols to digitally facilitate, verify, or enforce the negotiation or performance of a 📜 contract. 📝 Smart contracts not only define the rules and penalties around an agreement in the same way that a traditional contract does, but also automatically enforce those obligations so that all participants can be immediately certain of the outcome, without any involvement of a 🏢 third-party.

Such contracts written in code exist in ⛓️ blockchain networks where all participants of the network can view the smart contract but it is not possible to modify the contract. As a result, people can rely on the contract and the underlying blockchain technology without any third-party.

Just like bitcoin, where money is transferred between parties without any intermediaries like a bank, Smart Contracts make it possible to securely automate and decentralize virtually any kind of deal or transaction, no matter how complex they are.

Key properties of a Smart Contracts are:

  • Executed by self
  • Verified by consensus
  • Immutable

History of Smart Contracts

The term “smart contract” was first introduced by computer scientist and cryptographer Nick Szabo some 20 years ago as a graduate student at University of Washington. According to Szabo:

New institutions, and new ways to formalize the relationships that make up these institutions, are now made possible by the digital revolution. I call these new contracts “smart,” because they are far more functional than their inanimate paper-based ancestors. No use of artificial intelligence is implied. A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.

The classic example of a smart contract offered by Szabo is a 🏪 vending machine. Once a purchaser has satisfied the conditions of the “contract” (i.e., inserting money into the machine) the machine automatically honors the terms of the unwritten agreement and delivers the snack

How Smart Contracts Work?

As mentioned earlier, Smart Contracts work on blockchain technology. Smart contracts work by following simple 🤷🏻“if/when…then…” statements that are written into code on a blockchain which are executed when predefined conditions are met and verified.

  • Smart contract is written using a programming language
  • Store in the blockchain allowing any interested party to inspect the contract’s code and current state to verify its functionality
  • Each computer in the network copies the contract along with the transactions happened in the network
  • When input is received, code in the Smart Contract is executed to reach consensus about output
  • Pay for the fees specified in the contract to execute smart contract (In Ethereum, this is called as gas fee)

I think this has given you a brief on what smart contracts are and how they work. In the next post, I’ll explain to you how these smart contracts are beneficial and how these are getting used in practical scenarios. Till then... keep reading...keep commenting...Vijayeebhava...

Source:

Nick Sazbo : “Smart Contracts: Building Blocks for Digital Market”