What Are Smart Contracts And How Do They Work?

What are smart contracts & how do they work?

On a blockchain network, smart contracts ensure ultimate security and efficiency when executing a trade of value between buyers and sellers. Smart contracts essentially offer an element of trust on a completely decentralized blockchain network. With no central authority or enforcement, trust remains the most important aspect of any transaction over blockchain when dealing with multiple parties that are anonymous to each other. The terms and conditions of these smart contracts are written into lines of code that span across an entire distributed peer – peer system. The code instructs the system on how to execute the transactions in a manner that is both trackable and irreversible. Smart contracts are very useful for storing data transparently that enables trust through authentication based on the predetermined terms of the contract. While this might sound confusing, it doesn’t have to be; a simple analogy would be if you order pizza from a shop that promises less than 45-minute delivery or money-back guarantee. Upon order, the pizza shop would create a smart contract with you that includes the specified terms and your money would be held frozen, secured on the network. If the pizza is delivered within 45 minutes, then the funds are transferred to the pizza shop. If the pizza is not delivered on time, then the money is deposited back into your account. This example illustrates how smart contracts are able to ensure trust, security and no breach of the contract once it is created.

But how does the smart contract actually know if the pizza arrived on time?

The way in which the blockchain network is fed the proper information into which party should receive the funds is through a trusted, unbiased third-party service called an “oracle”. Oracles act as a bridge between smart contracts and the real world, allowing data from real world events to dictate the outcomes of smart contracts. In the pizza example above, a trusted oracle could be a doorbell camera. Or if two friends bet each other on the outcome of a sporting event, an oracle coded into the smart contract could be a trusted source like ESPN or The Score. In terms of larger wagers, people might not wholeheartedly trust an oracle source in which case the parties involved can agree to use many oracle sources to ensure the data is consistent.

How are smart contracts different from using lawyers and bankers?

The principle that funds are held frozen until the agreement is fulfilled with zero risk of a breach in the contract is quite revolutionary. Without the need of any legal framework authorized by a central authority, or the brokerage fees that accompany it, parties are able to save massively through the use of smart contracts. In addition, smart contracts can be applied to all types of agreements, no matter how miniscule; lawyers & bankers are typically only involved in larger scale deals. While there will always be a need for lawyers, it is likely that the technological innovation of smart contracts will change the landscape of legal contracts in due time.

Quick history of when smart contracts were first introduced?

In 1996 american cryptographer and programmer Nick Szabo first introduced the concept of smart contracts long before blockchain technology had been established. In his book “Smart Contracts: Building Blocks for Digital Markets” Szabo explains the origin by saying, “I call these new contracts ‘smart’, because they are far more functional than their inanimate paper-based ancestors. No use of artificial intelligence is implied. A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.” Unfortunately, at the time of his brilliant invention, the technology behind distributed ledgers did not exist yet. It wasn’t until the Ethereum ecosystem was founded in 2013 that made it possible to use smart contracts in practice. Other prominent blockchain systems in addition to Ethereum that enable smart contracts include: Cardano, Chainlink, Stellar, and EOS.

Bitcoin doesn’t support smart contracts?

The short answer to this question is yes, Bitcoin does have the ability to process smart contracts. Although, Bitcoin does not offer support for complex contracts containing many terms in an agreement. Moreover, the basic smart contracts that can be executed on Bitcoin’s blockchain are especially cumbersome to design compared to Ethereum’s or the other blockchains previously stated. It should be mentioned that Bitcoin’s network originally introduced smart contracts in 2020, whereas Ethereum’s has been developing for a much longer time.

How smart contracts enable asset tokenization, NFTs and stablecoins:

For starters, “tokenization” refers to the process of preparing real assets (cars, art, stocks, etc…) to be tradable on blockchain by representing them with “security tokens”. These tokens can then be traded on a secondary market. For example, if you desperately wish to invest in a large piece of commercial real estate, but you only have $20,000, you can obtain fractional ownership in the property by purchasing $20,000 worth of its tokens. The benefits of purchasing assets through a token economy, as opposed to traditional measures, is that transactions are cheaper, faster, more accessible, and there is much greater liquidity in the market. Transactions made in token economies are only made possible through the use of smart contracts as they securitize these ownership agreements.

In addition to security tokens, smart contracts also serve as a vital resource in facilitating the trade of Non-Fungible Tokens (NFTs). This type of token is a unique proof of ownership of a wide range of digital assets. To better understand the breadth of NFTs, some common examples include digital pieces of artwork, soundtracks, essays, videos, one-of-a-kind coupons, celebrity tweets and the list goes on. Typically, NFTs are digital versions of physical collectors items that ensure the originality of these assets. Ownership over these digital assets are safeguarded by the smart contracts they are traded on.

Smart contracts also play an integral role in transacting stablecoins. These types of coins are pegged to a nation’s currency, in the sense that you will always be able to purchase 1 stablecoin using $1.00. The way this is achieved is through controlling the supply of stablecoins so that the price constantly matches $1.00. When the price falls slightly below $1.00, a portion of these stablecoins are sold (removed from the market) in order to contract the coin supply. Oppositely, more tokens are supplied to the market when the stablecoin value rises above $1.00. Smart contracts enable stablecoin organizations to control their coin supply through setting terms in contracts. Stablecoins serve a purpose to provide stability in the volatile crypto space. Stablecoins are ideal for any sort of subscription, salary, rent, or loan payment. For example, using smart contracts, companies with employees all across the globe can automatically pay them at the end of each week without the third-party costs of exchanging fiat currencies from a bank account in Canada to a European bank account. Through the use of smart contracts, these types of transactions become less costly and incredibly faster than traditional measures.

Challenges with autonomous nature of smart contracts:

While the potential use for smart contracts is truly astronomical, there are still various challenges with the widespread adoption of these agreements that still need to be fine-tuned. Due to the autonomous nature of the smart contracts, there is currently no ability to alter the contract once it has been created. Specifically, smart contracts currently do not offer the flexibility for potential scenarios to be left unaddressed in a contract. This could become an issue if, for example, a global pandemic strikes out of nowhere and all of a sudden retail tenants cannot fulfill their rent smart contracts with their landlords. In the real world, many landlords would offer their tenants rent deductions because they feel some money is better than no money and trying to replace the tenant. In certain situations parties might agree to settle using the conventional route of traditional contracts because of the risks involved with smart contracts that still need to be resolved.

In conclusion, it should be evident by now that smart contracts are a groundbreaking tool that finally can be used in practice through the use of distributed ledgers. Smart contracts can pretty well be used to settle any type of transfer of wealth, but they need trusted oracles to do so.