Smart Contracts - Overview
Tags: blockchain, solidity, smartcontract, learning
Published: 2023-04-23 21:46:35

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](https://ethereum.org/en/) 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](https://www.youtube.com/watch?v=FGLekiFY5G0) to understand deeply.

## Why smart contracts?

Before the invention of smart contracts by [Nick Szabo](https://en.wikipedia.org/wiki/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](https://arbitrum.io/)
- 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).

- [Binance](https://www.binance.com/en)
- [ByBit](https://www.bybit.com/)
- [MEXC](https://www.mexc.com/)
- [HotBit](https://www.hotbit.io/)
- [Kucoin](https://www.kucoin.com/)
- [Coinbase](https://www.coinbase.com/) e.t.c

### 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](https://youtu.be/gyMwXuJrbJQ)

> 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.🤗