Blockchain Basics// 7 min read

An Introduction to Ethereum Smart Contracts

An Introduction to Ethereum Smart Contracts

Understandably, the current hype around blockchain technology happens to be cryptocurrency, most popularly, bitcoin, followed closely by Ethereum. Everyone prefers to conveniently ignore the other use cases of this disruptive technology. About two months ago, Dr Garrick Hileman & Michel Rauchs published a Cambridge University sponsored research, which among other things, identified over 40+ use cases of blockchain.

The Distributed Ledger Technology (DLT), blockchain, found a way for parties carrying out transactions to interact without the need of a third (trusted) party acting as the middle-man. Through blockchain technology, you can sell your house without having to go through the stress, paperwork and costs of involving a realtor or lawyer.

My focus at the moment, happens to be Smart Contracts. In fact, smart contracts was my first interaction with the world of blockchain, when I came across an article that said it would bring about the end of lawyers. Is this true? What exactly is a smart contract? How is one created? Does it have any benefit? What can it be used for? Read on as you find answers to these questions.

What is a smart contract?

A little over two decades ago, Nick Szabo, a cryptographer and legal scholar discovered that it was possible to use a DLT like a blockchain to build a digital contract that self-executes itself. This new discovery was called Smart Contracts.

Smart Contracts are simply contracts turned into codes and able to have feedbacks such as the release of consideration (money) to one party to the the contract, when the condition of the required amount is met and then the release of the product or service to the other party, when the condition of payment is met. The primary aim of the smart contracts has been said to be the reduction of human errors.

Did you know your ATM cards work like smart contracts? Let’s assume you went shopping and now you’ve picked some items to your heart’s content. At checkout, you drop your ATM for the cashier to process payment. Here’s what happens: IF your account balance is enough to pay for the items, they are released to you, ELSE items are returned to the shop where your account balance is not enough to pay for the goods.

Another example that has been popularly used is that of vending machines. When you put your coin in the machine, it releases your drink. That means if you don’t put anything, you won’t get a drink.

It was however not until 2014, when Ethereum entered the scene, before the concept of smart  contracts started gaining popularity. Although smart contracts could be created on any blockchain, even the bitcoin blockchain, majority prefer the Ethereum blockchain because it has unlimited capacity compared to others.

Smart Contracts codes are stored on a blockchain to promote transparency, as neither party to the contract can change the terms without other participants becoming aware.

Download our Crypto 101 Guide

Receive exclusive content that you won't find anywhere else other than on my list. Not only that, but you'll be the first to access new content, tools and offers. that will help accelerate your knowledge of crypto.

Blockchains That Allow Smart Contracts

Bitcoin – It is largely successful for financial transactions rather than a smart contract. The extent the bitcoin blockchain can create a smart contract is to have two signatures execute a transfer.

Side-chains – It’s possible to create a smart contract on a sidechain so long as it is running parallel to the main blockchain or another sidechain.

Nxt – This is a public blockchain that has pre-programmed smart contracts. Unfortunately, they are not Turing Complete, that is, you cannot code from scratch, you can only use the already prepared general ones

Ethereum  – Founded by Vitalik Buterin has the best public platform for developing smart contracts. They support Turing Complete, thus you can create your own codes on the Ethereum blockchain. Our focus in this article will be Ethereum smart contracts.

How are Smart Contracts Created?

Smart Contracts are created using codes. The bitcoin blockchain uses C++ while Ethereum uses Solidity. A sample smart contract built on the Ethereum blockchain can be found on their site. Ethernet smart contracts are run on the Ethereum Virtual Machine. It’s possible for one to create their own tokens using the Ethereum blockchain. Once created, a smart contract cannot be altered. To create smart contracts, a background in programming is essential, especially java and solidity programming languages.

Challenges of Smart Contracts

Adoption – Wide adoption of Smart contracts will pose a challenge as physical items involved will need to have a chip in them for the smart contract to work.

Bugs – It’s code after all, so bugs being a challenge for smart contracts shouldn’t be surprising.

Jurisdiction – With global use of blockchain technology and smart contracts, parties could be anywhere on the globe. When a dispute arises from the contract, the laws of which jurisdiction will apply?

Regulations – Even where jurisdiction has been determined, which regulations will apply? Many countries are yet to legally recognize cryptocurrencies, thus at the moment there appears to be no legal framework. But things are looking to change soon.

Invariable – This not to say we no longer want immutability on a blockchain. However, the current inability to update a smart contract is a challenge. For traditional contracts, if one of the terms of the contract changes (before execution) due to no party’s fault, they can come together again and update it to current status. But with smart contracts, once they start running, there is literally no stopping them.

Privacy – While we all love the fact that blockchain technology promotes transparency, we have to be conscious of the other side of the coin which means it doesn’t promote privacy. There are some transactions where privacy is crucial, this might be difficult to do when everyone on the network can see participants activities. Some participants are working on using zero-knowledge proofs to protect users privacy.

Benefits of using smart contracts

Accuracy – The last time you bought a house or a car, can you remember the number of paperwork that had to be filled? The more the paperwork, the higher the possibility of errors. But with smart contracts, you can be sure of accuracy.

Affordable – Since you won’t be using all those intermediaries, remember you even have to pay for their services, you would be able to save on money that could’ve gone into paying for a lawyer, a government official, or a notary.

Backup – A few months ago, while working on a project with some friends, we’d almost completed the project when one day, my friend sent me a frantic message saying he had mistakenly deleted the document we were working on – you can imagine how loud I shouted “What?!!!” What saved the day was that we used Google docs for our collaboration, that means even though my friend had lost the document, I still had it and was able to bring him on board again.

If you’ve used Google docs before, you would easily understand this concept about how smart contracts provide backup in event of say, losing the ‘contract.’  Google Drive is similar to a blockchain in this respect, where anyone with access to a folder on it will also have a duplicate of all files in the folder. So it doesn’t matter if one of those with access loses his files, the others have got his back.

Free Will – With a smart contract, you can determine the terms of the contract yourself because you have control and won’t need the input of a third party like a lawyer, broker or any other intermediary who could probably be biased when making the agreements for you. Let’s recall our ATM story. Every month, your bank automatically deducts ATM services dues from your account. They actually have more control over your bank account balance than you do, as you’ll likely have to argue with them if more than required was deducted. On a blockchain, no single entity is in control. And as mentioned earlier, smart contracts are stored on a blockchain, thus manipulation by either of the parties or a third party is eliminated.

Safety –The immutability of blockchain technology means your smart contracts will be kept safe. While a blockchain is not 100% hack-proof, encrypting information on it using cryptography makes it near impossible to hack. Any smart hacker intending to attempt hacking a blockchain would need hundreds if not thousands of years and be ready to spend lots of money.

Speed – One of the most cited benefits of technology is that it gets things done faster than if done manually by humans. Imagine the difference between the time it takes to go back and forth with documents between you, a government official, banks, broker, and so on just to get a loan for your house. On the other hand, a smart contract would take just few hours or less to create and execute, while also automating the whole process involved.

Trust –Because a blockchain is a distributed ledger, it will be impossible for one party to try evading her obligations on the contract with the excuse of losing it. As a result, parties can trust, if not themselves, at least the blockchain since it self-executes. Centralized ledgers like that of your bank or government registry could be lost, say, through fire. I hope such doesn’t happen though, as that would be utter chaos. Unimaginable.

Real World Use Cases of Smart Contracts

Everyday, we see new use cases for blockchain technology, most of which also need smart contracts to achieve their aims. Industries from marine, supply chains, legal, healthcare, schools and even government can use smart contracts to improve efficiency and productivity.

At the moment, Dubai seems to be the only country intending to apply smart contracts on a grand scale. In fact, it aims to be a Smart City by 2020 with all its government and economy mechanism run on a blockchain through smart contracts.

DApps – Just see these as apps running on a blockchain and based on smart contracts. Decentralized Apps (DApps) can be used to help users gain control over how they use data. Imagine you wake up today and discover your twitter account has been blocked or a recent tweet deleted. There is absolutely nothing you can do because a third party is in control of that application. DApps remove third party control.

Intellectual Property – Now, creators of intellectual property can rest easy has smart contracts can be used to determine copyrights for things like music, artwork, books, etc. Ujo tried to implement this by selling artist singles on their platform. An artist would not have to worry about piracy and would receive royalty automatically for each download. No more label slavery.

Smart Registries – This is one way for government to improve efficiency in their registries by converting to a digital record. When ownership of a land changes, transfer can be done within seconds and save everyone time and money. Kumasi, in Ghana has such a project ongoing in collaboration with Bitland Global.

Voting/ Elections – Without a shadow of doubt, governments are the least adaptive to new technology. How else can one explain the fact that we have developed from carriages to driverless cars, cowries to digital currencies and yet we still vote by thumb printing?! Well, the government probably loves it that way, after all, it ensures they are in control. Follow My Vote, a blockchain voting company is set to change things with smart contracts.

Internet of ThingsIoT is making living a smart experience with smart homes, smart TV, smart TVs, smart fridges, smart washing machines, smart stoves, smartphones and so on. Imagine connecting all this together while also having smart contracts run in the background? That means, you would be able to pay your electricity bills each month without headache or lock a tenant out (or in) when rent is not paid.

Insurance – The long manual process our insurance companies seem to love can be minimized using smart contracts.

The world is fast developing and with blockchain technology becoming widely used, smart contracts will play a huge role.

Disclaimer: The content published on thecoinoffering.com should not be taken as investment advice. Please do your own due diligence before making any investment in any asset.

Written by:

Faith Obafemi is a digital lawyer, passionate about legaltech, blockchain technology, cryptocurrencies and smart contracts.

POST A COMMENT

Leave a Reply

Your email address will not be published. Required fields are marked *

*

loading