What is a Smart Contract?

With the fast growth in blockchain implementation, one of the buzzwords that have been floating around a lot is Smart Contracts. It has grown popular with the development of Ethereum and it is quite a revolutionary concept that has taken blockchain implementation beyond its initial frontiers.

A smart contract is simply a software program or a line of code that can execute terms of the contract and is deployable on a blockchain platform. Nowadays the concept of Smart Contracts is intricately linked to blockchain but it actually precedes the technology.

The idea of smart contracts was first proposed in 1994 by a computer scientist, cryptographer and legal scholar called Nick Szabo. He had worked widely on digital contracts and digital currencies and came up with this concept where it could actually be possible to have a computerized transaction protocol that would be capable of executing terms of a contract to meet certain contractual conditions. Quite ahead of his time considering that this was before the age of blockchain technology and the widely popular Ethereum platform.

For more than a decade, Szabo’s concept was not realizable because the technology that would make smart contract implementation possible hadn’t been developed. The breakthrough came with the invention of blockchain technology by Satoshi Nakamoto and the modification of the Nakamoto consensus by Vitalik Buterin. Blockchain systems easily lend themselves to smart contract deployment because they are decentralized and secure systems that eliminate the need for middlemen.

So What Does All this Mean?

Fast forward to the 21st century and Bitcoin has been successfully launched. We are imagining that this is the only the possible blockchain application and then in a few years, someone is coming with a platform where users can develop applications in an environment “supervised” by blockchain and this presumably based on a system of smart contracts. For most people trying to get to terms with blockchain technology, it gets a lot hazier as you transition to new use-cases beyond the creation of cryptocurrencies. In spite of its widespread uses in numerous blockchain applications, few understand the concept of Smart Contracts.

We might not know it but we already had some rudimentary “smart contracts” that are based on an “if-this-then-that” condition that is hard-coded into the system in a way that makes the system autonomous. A good example is an ATM machine or a vending machine.

The main reason why smart contracts are creating such a buzz is that they are way smarter. Just like in your typical vending machine, the outcomes in a system based on smart contracts have been pre-defined in the contract. These outcomes are also based on the actions that parties in the smart contract will take.

Once all the parties in the smart contract have fulfilled their contractual conditions, the smart contracts know the course of action to take. Smart contracts go a step further and can allow you to add layers of properties/functionalities and security all of which is anchored on a transparent and immutable blockchain system. With a smart contract, you can have a fully automated system that executes transactions with high precision and where the risk of foul play is significantly reduced.

Through smart contracts, you are able to not only automate complex processes but also streamline various kinds of operations. The versatility and robustness of smart contracts mean they can lend themselves to very diverse applications ranging from financial services to software application development and audit trails. By leveraging blockchain technology, it permits the creation of autonomous and secure platforms that can function perfectly without the need for intermediaries. All the records are stored on a public ledger thereby giving users a transparent audit trail of all the transactions that have been performed on the platform. It is a trustless system.

How Does a Smart Contract Work?

The smart contract is simply a piece of software with a set of rules and regulations that are used in negotiating the terms of a contract. The smart contract is completely autonomous and does not rely on a centralized or third-party intermediary. If there is an event, the software will automatically verify the contract and execute based on the contractual terms that have been coded into the software.

Trust Systems

When executed on a blockchain platform, the smart contract becomes fully decentralized. Traditional people-to-people or people-to-machine interactions rely on trust systems. For example, before you make an online purchase, you have to establish that the website is secure, trusted and has lots of reviews by other users who have used the service.
A recurring feature in most human interactions is trust. People want to be sure that whoever they are dealing with can be trusted and that there are incentives for the party to stay honest.

Let’s take an example of a customer buying a football ticket either online or over the counter. When you are doing it over the counter, the sales clerk wants to be sure that you have handed over real cash and you want to trust that the sales clerk has handed over an authentic and relevant ticket for the match. Both parties in a face-to-face transaction want to be sure that they have gotten the value they wanted in the exchange.

In online purchases, the trusts systems are mostly digital systems. As a buyer, you want to be sure that you are buying from a genuine website and not a fake or phishing website so you will go through some validation processes to ensure you are dealing with an authentic website such as verifying the domain name, checking if site is secure and has an SSL certificate, reading online reviews and checking out the store’s social media profiles. On the other hand, the store has to establish that you are using genuine credentials to make the purchase and not stolen credit cards.

All transactions rely on these trust systems and most of the time, we take them for granted. In face-to-face interactions, our highly complex brains process this information very fast and we are able to quickly establish trust. Sometimes our intuition (another complex subconscious pattern recognition process) fails us and we get it wrong. In real life, these interactions always run smoothly because human beings have a good deal of trust between one another. People don’t want to ruin their reputations and there are accountability systems that you can fall back on if you find yourself dealing with a dishonest person. The incentive to cheat is considerably diminished in real life.

But have you ever thought of how the minutiae of these trust systems can be implemented digitally where there is no face-to-face interaction and no intuition and the natural trust between people?

When purchasing an item such as a ticket, you are generally confronted by two main problems:

  • The validity problem: How can you be sure that the ticket you are buying is valid and not a random number that someone just made up?
  • The double-spending problem: Even in cases where the number is valid, how can you be sure that the ticket hasn’t already been sold to someone else?

This is the conundrum that smart contracts solve. Through a smart contract, you can write a set of instructions that will self-execute under certain conditions. A smart contract should have the following characteristics:-

  • Immutable
  • Self-executing
  • It must be auto-enforcing
  • Must eliminate third parties or escrow agents
  • Self-verifying
  • Should be cost-effective

How a Smart Contract can be Implemented on a Blockchain Network

Developers can write the smart contract lines of code using the native language of a blockchain system. In Ethereum, developers use the Solidity native language. The contract codes can be used in various kinds of applications such as transferring money when certain sets of conditions have been met.

Once the code has been written, it is uploaded into a runtime compiler or a browser that will execute the smart contract code. In Ethereum, a code will be uploaded to the Ethereum Virtual Machine-EVM. After the code has been uploaded, it will be uniform across all the nodes in the blockchain network because it is operating in a decentralized peer-to-peer network. Each and every node will attempt to execute the code to determine whether the conditions or contractual requirements have been met.

Contracts on a smart contract system are generally powered by a digital asset. After the contract has been successfully executed, the digital asset is distributed or redistributed according to the terms that have been stipulated in the contract.

Benefits of a Smart Contract

There are several reasons to trust a smart contract:

  • Trust, Speed, and Automation: Smart contracts eliminate the intermediaries or third parties and the information is therefore processed a lot faster.
  • Security: Smart contracts leverage the security features of blockchain networks. The smart contract is available in all the nodes in the network so for someone to hack to a smart contract, they will have to simultaneously hack all the nodes or computers in the network. This makes these systems extremely secure.
  • Backup: They have the same immutable feature as other blockchain systems. The data is stored in all the computers in the network so even if some computers crash, there is zero net loss in records.
  • Cost-Effectiveness: Thanks to their efficiency, smart contracts are considerably more cost effective. They not only simplify and streamline but also cut down the cost of transactions.
  • Precision: The contracts are validated by networks of computers and are extremely accurate.

Uses of Smart Contracts

There are numerous use-cases for smart contracts. It extends blockchain technology to an unimaginable range of real-life applications. Some of these include the following:

  • Intellectual property rights: Smart contracts can be used by musicians, artists, and other creators to disseminate content and collect royalties and payments.
  • Supply Chain Management: Implementation of your supply chain management on blockchain using smart contracts can eliminate the challenge of fraud, theft, and mutability of transactions.
  • Real estate and land rights: Smart contracts can be used in the representation of mutual agreements that are self-enforcing and self-executing.
  • Internet of Things
  • Crowdfunding
  • Digital Identities
  • Auctions
  • Derivatives
  • Prediction Markets

Conclusion

Smart contracts are still a work in progress but they are expected to revolutionize transactions processing by introducing the advantages of blockchain systems such as immutability, transparency, security, automation, and precision. They eliminate the intermediaries thereby reducing processing time and cutting down costs for users.

With bigger investments in blockchain, we are certainly going to see smart contracts breaching into some of the “mainstream” industries that govern our lives which means smart contracts will pretty much be a ubiquitous feature of modern processes. Our lives will literally run on Smart Contracts in the near future.