Smart Contracts are very popular nowadays and are being used to solve a lot of key problems as the large-scale adoption of cryptocurrencies takes place fully into effect, but the key question on everyone’s mind is what are these smart contracts and which problems do they solve?
The term smart contract was first used by Computer Scientist, Law Scholar and cryptographer Nick Szabo in 1997 long before Bitcoin was formed who was trying to create a distributed ledger to store contracts.
Smart contracts are just like contracts in the real world, with the only difference being they are completely digital. In fact, a smart contract is a tiny computer program which is stored inside a blockchain. Let’s take an example of a smart contract to understand how it works.
Smart Contract Example
Suppose you are a group of developers working on creating a new app but require funding and you decide to raise the money by crowdfunding on kickstarter.
Kickstarter usually works by connecting the supporters who would like to invest in the app being developed by the developers and in case the app gets funded the supporters will want the money to be passed on to the developers and in case it fails they want their money returned back to them. For all this to happen both the developers and supporters need to trust kickstarter to be sure that their money is safe and available when they want.
Smart contract is a better way to perform crowdfunding without having to trust a third party like Kickstarter. A smart contract is created by programming it so that it holds all the received funds until a certain goal has been reached.
The supporters of the project can now transfer the funds to the smart contract, if the project gets fully funded the smart contract automatically passes the money to the creator of the project and if the project fails to meet these goals the money gets returned back to the supporters. Also, since smart contracts are stored inside a blockchain everything is completely distributed, with this technique no one is in control of the money.
However, this begs the question that why should we trust the smart contract?
This is because a smart contract is embedded inside a blockchain it inherits certain properties from the blockhain meaning they are immutable and distributed.
Being immutable means that once a smart contract is created it can never be changed again so no one can go behind your back and tamper with the code of your contract.
Being distributed means that the output of the contract is validated by everyone on the network, so a single person cannot force the contract to release the funds because other people on the network can spot this attempt and mark it as invalid.
Smart Contract Use Cases
Tampering with smart contracts becomes almost impossible which is why they can be applied on different things and not just on crowdfunding.
- Banks for example can use smart contracts to issue loans or offer automatic payments.
- Insurance companies can utilize smart contracts to process claims.
- Postal companies can use smart contracts for payment on delivery.
So now you may wonder where and how can i use these smart contracts. Well right now there are a handful of blockchains that support smart contracts but the biggest one is Ethereum. It was specifically created and designed to create these smart contracts who used a special programming language called solidity to program smart contracts. This language was specifically created for Ethereum and resembles Java Script.
It is also worth noting that Bitcoin also has support for smart contracts although it is much more limited as compared to Ethereum.
Smart Contracts and their Reliance on “Off-chain” Resources
Many smart contract-proposed use-cases assume that the smart contract will receive information or parameters from resources that are not on the blockchain itself—so-called off-chain resources. For example, assume a crop insurance smart contract is programmed to transfer value to an insured party if the temperature falls below 32 degrees at any point. The smart contract will need to receive that temperature data from an agreed source. This presents two issues.
First, smart contracts do not have the ability to pull data from off-chain resources; rather, that information needs to be “pushed” to the smart contract. Second, if the data at issue is in constant flux, and since the code is replicated across multiple nodes across the network, different nodes may be receiving different information, even just a few seconds apart. In our example, Node-1 may receive information that the temperature is 31.9 degrees, while Node-2 may receive information that the temperature is actually 32 degrees. Given that consensus is required across the nodes for a transaction to be validated, such fluctuations can cause the condition to be deemed “not satisfied.”
Contracting parties will be able to solve this conundrum by using a so-called “oracle.” Oracles are trusted third parties that retrieve off-chain information and then push that information to the blockchain at predetermined times. In the foregoing example, the oracle would monitor the daily temperature, determine that the freezing event has occurred and then push that information to the smart contract.
Future of Smart Contracts
It is fascinating to know that smart contracts were first developed in the late 1990s and are still still evolving in order to be widely adopted in our society and given their level of complexity there needs to be more resources to be made available to people from a non-technical background to be able create and use these contracts on a daily basis.
There is enough reason to be optimistic about this new technology given the fact that it may have an impact to revolutionize the reward and incentive structure that shapes how parties contract in the future. Hence, when thinking about smart contracts, it is important not to simply think how existing concepts and structures can be ported over to this new technology. Rather, the true revolution of smart contracts will come from entirely new paradigms that we have not yet envisioned.