Smart Contracts - Overview

Smart Contracts - Overview

Understanding the basics

In the world of decentralized finance, there are thousands of mechanisms and technologies used in building Web 3 products today. One of which I will be talking about in this article is "Smart contracts", I call it the "hook, line and sinker" of blockchain technology.

A constructive mechanism introduced by Ethereum with which blockchain transactions are performed securely. You might have come across this term several times without having any idea of what it is or even imagining yourself writing a smart contract. Maybe all you need to do is to be "smart"!😀 shall we?

What is a Smart contract?

A smart contract in this context is quite different from a smart legal contract in a physical setting but they are both carried out on the same motive which is "agreement".

A smart contract in clear terms is a computational agreement on a blockchain that self-executes as instructed by a few lines of code to seal transactions that are trackable but irreversible. It automates the terms of an agreement between two anonymous parties without legal authorities, a centralized body or external enforcement. An example of this is when you bridge stable coins to another coin or a token on a DEX(Decentralized Exchange) and all you have to do is to sign a digital contract with your wallet to record the transaction.

You can watch this video to understand deeply.

Why smart contracts?

Before the invention of smart contracts by Nick Szabo, contracts on the blockchain posed a lot of trust issues. Cryptocurrency back then was like throwing a hook into a river without a bait which lies on the probability of returning something or nothing. The existence of third parties or centralized bodies is a major factor that aided it.

For context "Mr. A has token Y and needs to buy token X while Mr. B has token X and needs to buy token Y, an order was placed by both parties but there is an external body or an "escrow" as it is known in crypto terms which accepts both orders, compare the values of both tokens in equivalence and approves the transaction.

The first breach of trust is an external body having full access to the tokens of both parties and can decide to defraud them.

Secondly, it can take a longer time to process this transaction which might not be a suitable option in cases of emergency.

Lastly, both parties might not get the equivalent value of the tokens placed on the order.

The invention of smart contracts revolves around solving this technical problem. It eradicates the chain of middlemen and allows transactions to take place on the blockchain anonymously between two parties by initiating a digital contract that is self-executable with few lines of code.

What blockchain uses smart contracts

  • Ethereum (It is inherent)

  • Bitcoin (after its Taproot upgrade)

  • Other chains built on ETH, like Arbitrum

  • Defi protocols and NFT projects also use smart contracts for e.g presales, public sales, mints, airdrops e.t.c

Examples of third parties

Third parties still exist, they are built in a more secure form. They are also called CEX(Centralized Exchanges).

Are you an aspiring blockchain developer?

There are numerous resources you can learn from if you are looking forward to writing and deploying smart contracts in the future.

I recommend this beginner course on freecodecamp

Note: you need to have a prior understanding of web development or programming languages like Python, Javascript or frameworks used in building user interfaces because that is what smart contracts interact with.

Conclusion

I'm glad you now understand what smart contracts are, how they work, why it was adopted and you have access to a resource that can teach you how you can start writing them too.🤗