What are Smart Contracts?
Smart contracts are getting more popular today than ever before. So what is a smart contract and what problem does it solve? Smart contracts are like regular contracts except they are completely digital and don’t require intervention or moderation by a physical third party.
Smart contracts were first introduced in 1998 by an American computer scientist Nick Szabo who also invented a virtual currency called Bit Gold that same year. This was a full 10 years before the invention of Bitcoin.
Smart contracts are computer programs stored inside a blockchain. This program works as the third party and holds the funds in a type of escrow between two people or groups that have an agreement with each other. Smart contracts work similar to a domino effect. As one action is made, a reaction occurs. After all required actions are completed, the contract will be complete and the funds released accordingly. If all agreements and actions are not met, the contract will be canceled and funds refunded.
An example of the concept of a smart contract could be like a vending machine. The bag of chips you want to purchase costs one dollar. You put your money in and the vending machine holds the dollar until you make your selection. Once the selection is made, the transaction is completed. The dollar is released to the vendor and your bag of chips is released to you. If you decide not to purchase the chips, the agreement is canceled and the vending machine will refund your money. Just as a vending machine requires no merchant to orchestrate your chip purchase – smart contracts can be used to orchestrate transactions big or small between buyer and seller, and can be configured to require actions that must be completed in order for the contract to conclude.
How Secure?
Smart contracts are stored on a blockchain and can never be changed. This means nobody can go behind your back and change any part of the agreement. It is also distributed and validated by everyone on the network – just as bitcoin transactions are validated. If an entity were to tamper with the agreement to release the funds too early, the rest of the network will see it is different and disallow it. This makes it nearly impossible for a smart contract to be altered in any way.
Where Used?
Smart contracts can be applied to many different things. Banks can use them to issue loans or set up automatic payments. Insurance companies can use them to process certain claims, and postal and delivery services can use them to keep track of their payments on delivery. The music industry can use smart contracts to help artists keep track of royalties and distribution of their music. These are just a few of many ways smart contracts can be useful. Public blockchain smart contracts enable parties to transact with any other party — whether that party is known or anonymous. Because public blockchains allow parties to transact without rules or legal framework constraints and central authorities, permissioned enterprise blockchains and anything that runs on them are more limited in value. These do not support the revolution of blockchain that eliminates central authority and they are not byzantine fault-tolerant.
Where to Start?
Right now there are a handful of blockchains that support smart contracts. The largest one is Ethereum. Ethereum was specifically created and designed to support smart contracts.
Bitcoin also supports smart contracts but is more limited as compared to Ethereum due to the underlying Script code used. Peter Wuille, a bitcoin developer, unveiled a new coding language specifically for using the Bitcoin blockchain for smart contracts. This “Miniscript” language will make it easier for programmers to write smart contracts for spending bitcoins. The “Multi-Sig” script that allows two or more people to sign off on a bitcoin transaction before funds can be moved, already exists. “Miniscript” builds on top of this programming language, improving it to be easier for developers to implement certain caveats – such as “allow A to take coins at any time; but allow B to take coins after “x” number of days.” The potential use cases will make it easier to implement complex scripts in-wallet, or possibly used for underpinning the Lightning Network. For those interested, Jimmy Song – well-respected developer – provides a great explanation of how it will work and the significance.
Challenges Ahead?
While smart contracts can automate and accelerate business transactions, it is important that all parties be aware of the risks associated with them and that these risks be mitigated by including proper controls into applications and processes. Since reversing the results of immutable transactions on blockchain ledgers is very difficult, every party involved needs to fully understand the benefits and the logic. In this same vein, hackers could trigger undesirable results also hard to correct, as could bugs or errors, because smart contracts can execute forever if there are no mechanisms in place to stop them. It is easy to understand that all parties must require clear, documented, mutually agreed-upon rules before engaging a smart contract. There will be companies that engage use of smart contracts inappropriately or that are unnecessary. Existing database technology should be used when there are no trust issues among contract participants, as there would be no requirement for a shared, immutable system of record. The use of “smart contracts” just because they are the latest thing will not be beneficial.