Our introduction into crypto currency is usually through Bitcoin (BTC). This leads many of us to believe that cryptocurrency is simply decentralized digital money. But this certainly isn’t the case. The truth is that transacting in crypto is the tip of the iceberg. Beyond giving people the ability to exchange in a peer-to-peer way, without the need for banks or other third-parties, cryptocurrencies also offer smart contracts. And the financial use cases for smart contracts extend as far as the imagination.
To understand smart contracts, there are few key elements to know first: decentralization, blockchains, and tokens. For an in-depth analysis of these topics, you can read Blockchain Explained and What is Cryptocurrency? in the Crypto Education section.
While Satoshi Nakamoto may be said to be the inventor of decentralized blockchains through Bitcoin, Nick Szabo is attributed to first proposing smart contracts in a paper written in 1994 (it has even been suggested that Nick Szabo is Satoshi Nakamoto, which he denies).
Nick Szabo defines a smart contract as:
“A computerized transaction protocol that executes the terms of a contract. The general objectives of smart contract design are to satisfy common contractual conditions (such as payment terms, liens, confidentiality, and even enforcement), minimize exceptions both malicious and accidental, and minimize the need for trusted intermediaries.”
As you can see, long before Bitcoin, Nick Szabo was already envisioning a peer-to-peer network that gives us the ability to transact without a centralized authority (without a “trusted intermediary,” such as a bank, exchange, or other financial institution); however, at the time smart contracts were missing a key technology, which was decentralization.
By solving the problem of decentralized blockchains through Bitcoin, Satoshi Nakamoto set the stage for smart contracts to come into the world. And with the door now open, Vitalik Buterin—founder of Ethereum—introduced smart contracts on a mass scale on July 30th 2015, thus enabling decentralized smart contracts across the Ethereum network.
Smart Contract Use Cases
Finance is contractual in nature. Traditionally, anytime that we finance an item (or lend with the expectation of a greater return) an agreement is drawn up, signed by the parties involved, and the financial assets are distributed according to the rules within the contract. Whether this agreement is a mortgage, an auto loan, a credit card, or even a verbal contract with a friend, in each case there is an agreement, a contract, a verbal understanding, and an expectation that certain terms are to be met.
Smart contracts can fulfill such agreements digitally in an automated fashion. More importantly, they are able to do this without the need of a third-party arbitrator, such as a bank or lending institution, and without the need to have each contract legally reviewed. The code, or the logic behind the smart contract, will only comply with the contract’s design. In this sense, smart contracts are kind of dumb. They act mechanically according to a set of rules—like a washing machine at the laundry mat: you input four quarters and the machine begins to wash your clothes. Compare this to machine learning technology through Artificial Intelligence, which requires complex coding and super computers to run. But there is beauty in the simplicity of smart contracts: because smart contracts can eliminate the need for third parties, the resulting productivity enhancements are colossal.
Costly problems, intricate procedures and entire industries can be revamped with smart contracts. For example, banking institutions must comply with KYC (Know Your Customer) rules. This is expensive as it requires the bank to obtain, maintain and store identities in private and secure way. Conceivably, such identifying information can be secured through the blockchain and shared digitally by our own volition. Since the data will be secured through cryptography on the blockchain, a secure record will already be kept, thus alleviating the need for lending institutions to maintain and secure such records. A smart contract could be designed to secure this data and ensure that the data is only shared at our request.
Smart contracts are also revolutionizing the insurance industry. Insurance too is contractual in nature as the payouts occur when a given set of conditions are met. Let’s say that you wish to obtain insurance on a package is to be delivered safely by a certain date. The parameters for such a smart contract are simple. XYZ package is to be delivered by such and such a date. If the package is delivered on time without damage, there is no payout; in the event the package is not sent on time or was damaged—the payout would be automatically sent to the digital wallet of the customer who insured the package.
Financial services such as trading, broker exchange, custody, global payments—all of these industries right now are undergoing tectonic shifts by way of smart contracts.
How do Smart Contract work?
Though Ethereum is the most well known smart contact platform, they can be built on many other platforms, such as Cardano (ADA) and Polkadot (DOT), whose blockchains operate in a similar way to Ethereum. In fact, the Ethereum blockchain is undergoing a modification into Ethereum 2.0, whereby the platform will be supported by stakers rather than miners. On a side note, since Ethereum 2.0 will require stakers to hold at least 32 Ether (the native token to the Ethereum network)—questions are now being raised regarding wealth exclusivity: Is Ethereum 2.0 is now proof-of-wealth?
What differentiates platform blockchains like Cardano, Ethereum, and Polkadot from Bitcoin, is that Bitcoin was designed to be used primarily for transactions (as referenced in the Nakamoto’s introduction to the Bitcoin white paper); whereas Cardano, Ethereum and Polkadot were made to be decentralized virtual machines, computers for the world so to speak. They can perform all of the functions that we come to expect from the software services we are used to, yet with the added caveat that there is no central authority needed to conduct these transactions or computations. They are instead done through the blockchain.
Essentially, the smart contract is the logic running in the background determining what to do with our inputs. The contract doesn’t become actionable until a certain set of conditions are met. The criteria for these conditions are programmed into the contract and compared with key data points before the contract is administered. They are great for any programming parameters that follow if-then logic.
For example, let’s say you wish to create a smart contract to exchange your Tether (USDT) for Litecoin (LTC) when Litecoin’s token price reaches $300. The inputs would be the amount of Tether that you have available and a date source to alert the smart contract when $300 Litecoin price is met. The output would be the receipt of the Litecoin (LTC) once the contract is executed. Since smart contracts are peer-to-peer, there would have to be an entity willing to agree to the terms of the contract. You likely will never know who this entity or person is (in a trustless system there is no need to know the identity of the party who the exchange is being made with. In this case, the entity on the other side of the transaction will be the seller of Litecoin at $300 (the liquidity provider). Once you have agreed to the terms of the contract and provided the necessary Tether to enable the transaction, the network is then ready to complete the transaction, but it will only happen once Litecoin hits the $300 price point.
You may be wondering how will the smart contract know when the $300 price point is met? For that, you would need an oracle provided, such as Chainlink (LINK).
Chainlink, and similar projects, are essential in the development of smart contracts. The Chainlink blockchain offers a decentralized means of feeding reliable data into smart contracts. In our example, the price Litecoin must be accurate. The parties that have agreed to the terms of the smart contract will only be satisfied if they can be assured that the price of Litecoin, when it reaches $300, will be a reliable price at the time of execution.
To obtain that information in decentralized way, it cannot come from a single data source (as that, by nature would be a centralized source of data). Chainlink provides such trustworthy data through oracles. An oracle is essentially a collection of key data points from many different data providers to arrive at a consensus over a particular data point.
In our example, the oracle would provide the price of Litecoin to the smart contract through the contributory information of many different Litecoin price providers. These providers will receive the LINK token as a reward for providing the current price. And since the oracle is made of multiple data providers, this allows for a consensus to be reached on what the current price of Litecoin is. A data provider in the oracle for the Litecon price may be Coinbase (COIN); another data provider maybe Binance (BNB). In fact, there could be dozens of data providers collectively incentivized by the receipt of the LINK token. The oracle relays this price (arrived at by consensus) continuously into the smart contract. Once the price point of Litecoin at $300 is reached, the smart contract will automatically transfer the now purchased Litecoin into the participants crypto wallets.
The above actions do not only show how smart contracts work, but it also elucidates how decentralized exchanges work. This is much different than how traditional exchanges complete transactions. When you transact on Coinbase, for example, your crypto would have to be custodied by Coinbase for the trade to take place. In other words, Coinbase will be the trusted middleperson making the exchange.
Smart contracts, by enabling decentralized exchanges to function, as the logic behind the transfer of assets take out middleperson—the exchange. There is no need for a central Corporation, with all of its office space, departments, accountants, processors, auditors, etc. to ensure that custodied currency is transacted properly.
Decentralized exchanges is one of the brilliant examples of what decentralized finance can accomplish; they will save the world billions and billions of dollars in costs and countless hours of time, security, and infrastructure.
Since most of us are not programmers, creating smart contracts to automate our everyday needs are most likely not going to be completed by us. We prefer a simple interface to interact with, telling the computer what we would like to happen and then see the result once the conditions are met. Though smart contracts will be performing those tasks in the background, what we will see on the surface are decentralized applications (dApps). DApps will communicate with these smart contracts to get our requested tasks completed.
What are decentralized applications (dApps)?
DApps are the front-end interfaces that we use to tell the smart contracts what to do. They communicate to the smart contract the inputs that we provide. DApps function on the surface layer, much like the apps that we are used to seeing, yet with a couple of other benefits. DApps are permissionless, meaning anyone with access to a computer and a network can use the application. And just like their counterpart smart contracts, dApps too are peer-to-peer. Dapps interact with the smart contract logic that is running on the backend, which in turn is running on the blockchain. You are able to access a dapp through your web browser. And browsers now have wallet extensions like Metamask, which allows you to send and receive tokens through the dApps.
To sum up… the blockchain is the base layer; the smart contracts are the protocols that run on the blockchain providing the logic for an agreement between parties. And the dApp is the application that we engage with to provide the necessary information into the smart contract.
Are tokens smart contracts?
Tokens themselves are actually a form of smart contracts. ERC-20 tokens on the Ethereum network are created by following the ERC-20 protocol. The protocol itself is contractual because it is a set of rules by which the tokens are created. Programmers who follow this standard were able to create ERC-20 tokens on the Ethereum network. Some examples of ERC-20 tokens are Basic Attention Token (BAT) and Augur (REP). Tokens will also be available on Cardano. In fact, Cardano is deploying an ERC-20 conversion tool to convert ERC-20 tokens to run on the Cardano network.
NFTs (non-fungible tokens) are also another form of smart contracts. NFTs act like trading cards, except they are digitized. They can be exchanged for another, but there is no set value to card itself—in that sense, NFTs are non-fungible, meaning each NFT is unique in its own right. Essentially, they are unique digitizations that have value. And when you think of what can be digitized, it is basically anything—an image, video, blog post, tweet, instant message—but whether or not it has value depends on if someone is willing to pay for it. By the likes of the digital artist Beeple, who sold an NFT for $69 million dollars, the jury is in—NFTs can be extremely valuable.
Current and Future States of Smart Contracts
Smart contracts may have been slow to the start in its early days. But in 2020 and 2021, they have picked up steam. Sites like dappradar.com track the transaction volume and total value locked (TVL) into smart contracts and give us a sense of how rapidly they are being embraced by the market. You can see that there are now billions of dollars locked into dApps such as Aave or Pancake Swap. Currently, smart contracts are mainly hindered by the lack of network scalability.
Scalability refers to the number of transactions the network can handle per second at a reasonable price at the time of settlement. Scalable platforms like Cardano and Polkadot, will enable smart contracts this year. Ethereum 2.0 also solves the scalability issue, but its full roll out is not expected until Q1 of next year.
Smart contracts will allow for the full breadth of the internet to burgeon. In the broadest sense, they allow for decentralized computation—meaning anything that a computer can do, can be enabled through smart contract programming languages, and these interactions will be performed on a blockchain in a decentralized way. This is the vision—but until scalability issues are resolved, and programming languages are developed to the point to enable these benefits, we will be in a transaction state. But the transition may not be for too long. The productivity enhancements for businesses and individuals alike are unfathomable. These benefits will be a driver for rapid development and smart contracts will become a major disrupter for entire industries. In effect, the blockchains and software enabling the smart contract will empower us to conduct our affairs independently, without the need for an institution to monitor and authorize our dealings.