What is a Smart Contract?

A Thread 🧡🧡 πŸ‘‡πŸ‘‡

1.

Yesterday, in the tweet below I stated that a Smart Contract is the building block or core component of a Decentralized Application.

Today, I will be giving an in-depth look at Smart Contracts; What they do, their features, how they work...

Let's go

https://t.co/GnmtEK5ikc
2.

Smart contracts are basically self-executing code hosted on the Blockchain.

In terms of being a contract, it a set of rules that executes when predefined conditions are met.

As for the part of being "Smart", It's not.

Take, for instance, let's look at an application like
3.

...GoFundMe(a centralized crowdfunding platform for donations, contribution) in terms of a smart contract.

The smart contract will be given the rules as follows:

"The benefactors will be required to send money to a particular public address(like an account number in terms
4.

of blockchain technology), then when the money gets to a particular amount let it be automatically sent to the beneficiaries' public address".

That's basically how smart contracts work even though there are more sophisticated applications.

So, what are some features?
5.

> Distributed
> Transparent
> Immutable

> Distributed

Since smart contracts are hosted on the blockchain which is decentralized, they are replicated and distributed in all nodes of the network.
6.

> Transparent

Since smart contracts are based on a public blockchain, their source code is not only immutable but also visible to anyone.

So, you could take the address of a smart contract to an explorer and the source code will be visible to you.
7.

> Immutable

As you may know, the blockchain is immutable so therefore anything hosted on the blockchain can't be changed.

How does a Smart Contract work?

Although there are other Blockchains that support smart contracts, I will be using Etherrum for this explanation
8.

Just as you may know from basic programming, every programming language needs an interpreter or compiler to run.

So, the Ethereum Blockchain provides the Ethereum Virtual Machine(EVM) which serves as an interpreter for the Solidity programming language and others.
9.

This EVM is present on every full node(a type of node that houses a full copy of the blockchain).

When the smart contract is deployed on the blockchain, it is given an address that will be used to communicate it and also view its code.
10.

These should give you a basic idea of how a smart contract works.

If you liked this thread, do well to like, retweet, and follow at @The_python_dev_.

If have any questions, feel free to come to my dm.

You May Also Like