Smart Contracts

in #blockchain2 years ago

What Is a Smart Contract?

I don’t just want to teach you about what is a smart contract, I also want you to remember the information given. So, to do that, I have highlighted three key points that you should read and try to remember what is a smart contract:

A smart contract is an agreement between two people in the form of computer code. They run on the blockchain, so they are stored on a public database and cannot be changed.

The transactions that happen in a smart contract are processed by the blockchain, which means they can be sent automatically without a third party. This means there is no one to rely on!

The transactions only happen when the conditions in the agreement are met — there is no third party, so there are no issues with trust.

How Does a Smart Contract Work?

Yes, just how do smart contracts work, then?

To find the answer, let's start by looking at how a smart contract can be used:

Let’s take this for example:

Imagine Michael wants to buy Alinwachukwu’s car. This agreement is formed on the Ethereum blockchain using a smart contract. This smart contract contains an agreement between Michael and Alinwachukwu.
Simply means that the agreement will look like this: “WHEN Michael pays Alinwachukwu 200 Ether, THEN Michael will receive ownership of the car automatically and immediately”.
This is called smart because it runs on the computer. Not your regular traditional contracts.
Once this smart contract agreement has been put into place, it cannot be changed — meaning Michael can feel safe to pay Alinwachukwu 200 Ether for the car 🚘.

Without the use of a smart contract in this scenario, Alinwachukwu and Michael would have to pay lots of fees to third-party companies. Including the customs. Using this medium trust and reliability is built.
Another great example is Alinwachukwu and Michael bets that Manchester will win Chelsea. Michael being on Chelsea’s side. 500 ether is placed on this, in the traditional system. In a scenario that Manchester loses to Chelsea, Alinwachukwu then refuses to pay up, there’s nothing Michael can do. But with smart contracts, immediately Chelsea loses, the 500 ether is automatically transferred to Michael seamlessly. The contract is irrevocable and irreversible.

Smart contracts are automatically executed once the conditions of the agreement are met. This means there is no need for a third party, like a bank, a broker, or a government.

How Is This Possible?

As mentioned before, we have the blockchain to thank. Because of blockchain technology, we are able to decentralize smart contracts so that they are fair and trustless. By decentralizing, I mean that they are not controlled by one central party (like a bank, broker, or government, etc.).

The blockchain is a shared database run by many computers (called 'nodes') belonging to many different people. Because of this, not one single person or company has control of it.

It means it's near impossible to hack it — the hacker would need to hack more than half of the nodes if they wanted to attack the blockchain or the smart contracts that run on it. Therefore, smart contracts can run safely and automatically without anyone being able to change them! Now you know even more about what a smart contract is!

What are Smart Contracts Currently Being Used For?

As I said earlier, Alinwachukwu & Michael’s car sale is not the only scenario in which smart contracts can be used. Smart contacts can be used for any type of transaction — it doesn’t have to be financial.

The possibilities are endless for smart contracts. They are already being used for financial trades and services, insurance, credit authorization, legal processes, and even for crowdfunding agreements (ICOs).

Let’s look at how smart contracts are already benefiting certain industries and how they will benefit other industries in the future…

Insurance Companies

Two insurance companies, Atlas Insurance in Malta and Axa in France, tested smart contracts in 2017. They had prototypes that compensated airline customers if their flights were delayed.

Let’s see an example:

Alinwachukwu is about to fly from Nigeria 🇳🇬 to Dubai . He sends $20 worth of cryptocurrency to the Axa Insurance smart contract and provides his flight number. Axa sends $180 to the smart contract. So, there is $200 in the smart contract.

If Alinwachukwu’s flight is on-time, Axa is sent $200 from the smart contract. But if the plane is late, $200 is sent to John from the smart contract. Everything is automatic.

This saves lots of time and money. It also means that John does not have to trust that AXA will pay him the agreed amount if his flight is late — he knows that if it is late, the smart contract will instantly send him his compensation ($200).

Health Systems

Health systems will use smart contracts to record and safely transfer data.

We can already see examples of smart contracts being used in the medical industry by the likes of EncrypGen. This is an application that uses smart contracts to transfer patient data in a secure way, allowing no access from third parties.

This way, the patients are in control of their own data. If researchers want to use patient data, they must pay for it. Not only that, but the patient has to choose whether or not they want to sell it to them.

Governments

For governments, smart contracts running on the blockchain can make voting systems completely trustless and much more secure.
Applications like FollowMyVote use smart contracts and blockchain technology to protect votes from fraud. When the voting transaction is written to the blockchain, it cannot be changed. When the voting is over, the smart contract will send a token to an address that represents the winner of the vote.

This way, voting is always fair, meaning the winner is always correct.

Business Management

Businesses can benefit massively from smart contracts. Instead of paying staff to run payrolls, they can use smart contracts.

Businesses can just set up a smart contract that says WHEN the date is 22.03.2022, the Business sends Alinwachukwu 200 ETH. This means Alinwachukwu will always be paid on time, and he will never be underpaid. The business benefits because it is all automated, saving them lots of time and money!

How are Smart Contracts Created?

Smart contracts can be built on multiple blockchain platforms, including Ethereum and NEO. As Ethereum is the most popular choice for developers, I will tell you about Ethereum’s smart contracts.

Smart contracts are developed using Ethereum’s original coding language, called Solidity.

If you want to learn Solidity, you can hit me up or buy courses online On Solidity tutorial! It’s a fun and friendly way to learn Solidity. In no time you will
Be creating your very own smart contracts!
F7C91BD1-2AE6-4B08-8700-F11B934534C8.png

4016B6F1-6357-4635-B948-2B0727134877.jpeg

Sort:  
Loading...

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64081.52
ETH 3398.85
USDT 1.00
SBD 2.62