The story of how smart contracts are not really smart and how DeFi will gain more real-world traction through developer support

It was in the early 1990s when the idea of smart contracts was first conceptualized. By 1998, the Stanford Digital Library formalized the use of the concept as a rights-management service layer in The Stanford Infobus.

Smart contracts are “a set of promises, specified in digital form, including protocols within which the parties perform on these promises,” as proposed by Nick Szabo, a legal scholar, computer scientist, and cryptographer who was once speculated to be behind the “Satoshi Nakamoto” moniker. 

In essence, smart contracts are programmatic expressions of contractual agreements wherein the execution is implicit in the digital encoding of said contract. In simple terms: If X, then Y. To expand: If X, then transfer ownership of Z from user A to user B.

In practical terms, however, smart contracts are not so “smart” in the sense that they are disconnected from the real world. They do exist on the digital abstraction layer. However, without the proper technology stacks, there is no connection to real events that are happening, which are supposed to be relevant to the execution of such contracts. There is no way for the smart contract to determine X.

It was only in 2015 when development on smart contracts became more serious, with the rise of the Ethereum network — the blockchain platform whose main advantage over Bitcoin is its ability to execute scripts through its decentralized virtual machine.

The rise of Decentralized Finance

Interest and investments in decentralized finance or DeFi have been growing in recent years. It is during the coronavirus pandemic when the usage of DeFi products simply exploded. After all, digital transactions are deemed to be safer than physical transactions, and DeFi provides many opportunities for trade and investment.

On January 1, 2019, the total value locked in DeFi was at $276 million. By August 30, 2020, the DeFi market has skyrocketed to $8.933 billion, underscoring the growth in real-world relevance of these platforms.

DeFi platforms heavily depend on smart contracts for their utility and function. For example, to get a loan or to finance a purchase, you would traditionally borrow money from a bank. That bank then earns from the amortized payments, which come with interest from which the bank earns.

If you default, you can either pay penalties, or the bank can simply reclaim whatever collateral you have provided — such as the property. But where does the bank get its money in the first place? Its funds come from depositors, who also earn a small interest over their deposits.

Decentralized finance skips the concept of a centralized bank that manages these funds. Instead, lending and borrowing activity all occur through a decentralized platform — if we use an oversimplified example of bank loans.

Being a trustless ecosystem — meaning there is no centralized manager who makes decisions — the system relies on a set of smart contracts that define the parties to the transaction, how value is exchanged, when these are exchanged, and what triggers such exchanges.

It is the same case with other DeFi or smart contract applications: fractionalized ownership of a commercial property, or simple payment for the purchase of goods, or fulfillment of a commercial shipment through the supply chain, among many other applications.

Once a certain condition is met, then the transaction is executed.

There are a multitude of use cases for DeFi, and decentralized lending is only one of them. These solutions provide financial services to the underbanked, facilitate transparency in business transactions, and more.

Having no centralized manager, such as a bank, to determine the veracity of these exchanges, however, there needs to be a solution for the smart contract to know the real-world situations that will influence how the transaction is executed.

Therein lies the importance of the oracle.

Oracles: An all-seeing guide for the truth in decentralized transactions

As early as 2014, the concept of the oracle had been established in technical and academic circles — Chainlink, for one, had been an early adopter in building a decentralized platform for bridging data between blockchains and the real world.

An oracle is a means for a blockchain or smart contract to interact with external data. As a source of data, an oracle lies beyond the functioning rulesets of the system, in this case, a blockchain.

It is simply a provider of data. It delivers certain answers to questions about the real world. For example: Has condition X been met?    

Once that is confirmed to be true, then the smart contract executes Y as a result.

Some real-world examples would be using IoT sensors and RFID in order to track and verify the location of shipments. Once goods are confirmed to be received, the smart contract executes the transfer of ownership of funds as a condition of the contract. Other use cases can include the sale and transfer of in-game assets, ownership of property deeds, and so forth.

Without an oracle supplying such information from the real world, the blockchain or smart contract will have no way of knowing whether conditions have been met, and it will not be able to do its job of decentrally executing the agreement as designed.

One might think that this is similar to the centralized decision-maker as in the case of the bank. On the contrary, the oracle is merely a provider of information.

Thus, there is a need to establish a way to oraclize how data is delivered to the blockchain or smart contract. This is usually done through APIs — application programming interfaces — that can be used to programmatically pull data from other applications through a decentralized infrastructure.

The concern here, of course, is the so-called “oracle problem.” What’s critical is that the integrity of the oracle needs to be unimpeachable. If an oracle is compromised, then the entire smart contract falls apart.

Oracles like Chainlink and the Band Protocol serve as a sort-of “middleware” between smart contracts and data providers. Although the different oracle platforms attack the problem in different ways, the strategy is the same: perform independent and decentralized computations to verify the correctness and accuracy of data being fed into the smart contracts.

How reverse-oracles solve the inherent challenge of tracking on-chain data

For the most part, oracles go one way: they feed off-chain data into blockchains. Data is pulled from sensors or other real-world sources. It is verified. It is delivered to the blockchain or smart contract. There is a whole world of possibility that exists with having data move the other way around.

In 2019, PARSIQ launched as a platform for monitoring blockchain transactions, proving its worth by enabling mempool-level monitoring and alerts, meaning transactions can be monitored in real-time and forensically tracked even before they are confirmed by the blockchain nodes.

The use cases are immense, and the ability to track on-chain and cross-chain transactions has displayed a lot of potential in the realm of fintech, compliance, and platform security. 

In essence, this ability also makes PARSIQ a reverse-oracle. Whereas an oracle provides inbound data into a blockchain, a reverse-oracle will utilize data and updates from the blockchain and deliver it to real-world applications through notifications, alerts, and APIs.

As a platform, PARSIQ’s work starts when the job of the oracle of pulling data into the blockchain is done. This addresses the challenge that that data can be either inaccessible or difficult to obtain from within the blockchain. For example: a smart contract cannot know the events happening in other smart contracts, thus creating information asymmetry or inverted flow of data.

Oracles and reverse-oracles thus serve as a communications stack atop blockchain platforms and other technology solutions that developers can throw upon the decentralized network. PARSIQ, for one, is able to retrieve on-chain data and send it off-chain or cross-chain to other blockchain platforms for subsequent processing.

For example, there may be a need to do additional data computations or transformations, or even analysis of off-chain or proprietary events, in order to make it useful to a smart contract. 

On-chain processing requires resources such as gas (the Ethereum fee required to successfully execute a transaction). Doing this off-chain and subsequently delivering the result into a smart contract makes things more efficient and less costly.

Thus, by extension, a reverse-oracle can also be an oracle in itself, by delivering information on-chain or to a different blockchain altogether, after having the data processed off-chain.

How relevant can the process of reverse-oraclizing be?

Think of it this way. A smart contract can execute a transfer of digital asset ownership once a real-world event is verified by an oracle (such as transfer of physical goods, for example).

However, a reverse-oracle has the ability to conduct real-time audits on whether a blockchain wallet (or the owner thereof) actually has the assets to back the contract — what is known as proof-of-reserves. In decentralized finance, this equates to checking for a party’s collateral as claimed.

The applications of reverse-oracles in DeFi can also enable the platform to dig deeper into other factors, such as user risk thresholds, a sort-of “credit ranking” for DeFi borrowers, or source of funds for both parties.

By automating the process of data delivery from on-chain to off-chain, reverse oracles will also make real-world execution of the smart contract viable. For example: opening a lock or door once payment has been confirmed.

The stakeholder challenge for developers: The proof is in the pudding

At the start of the article, we claimed that oracles will play a big part in the success of DeFi. By definition, DeFi platforms are dependent on smart contracts to operate. And smart contracts are dependent on oracles and reverse-oracles to be effective.

All of this will be dependent on how the developer community can build upon decentralized platforms and protocols in producing applications that will be relevant to end-users. This means that developers will be looking into the easiest way to integrate oracles into their solutions, without having to reinvent the wheel.

It took half a decade for Bitcoin to gain traction among developers, enterprises, and consumers. The same can be said with DeFi if developers were to come up with solutions from scratch.

For instance, the Band Protocol itself has tried to establish both a blockchain and oracle from scratch. Even though the project is currently valued at a reported market cap of $166 million (vis-a-vis ChainLink’s $3.437 billion!), it is reported to be facing certain technical and practical challenges.

Solutions that are easily integrable into applications will be more impactful in the case of building real-world products. PARSIQ, for one, enables the reverse-oraclizing of data from on-chain to off-chain or cross-chain to other platforms, all through APIs that are already available to developers.

Such ease-of-integration can be a gamechanger when it comes to accelerating real-world applications of DeFi. Data is no longer difficult to retrieve. It’s a matter of utilizing the available tools to make products that are impactful.

The takeaway

The blockchain is a one-way superhighway of information, where transactions travel in cryptographically-linked blocks. Oracles are on-ramps that enable verified data to be introduced on-chain. Reverse-oracles are off-ramps or interchanges — available at multiple points of the highway — that enable applications to retrieve on-chain data in order to have an impact in the real world.

Decentralized finance relies on smart contracts that are supposed to automatically-execute upon certain conditions. The role of oracles and reverse-oracles will be in delivering data to and from the smart contract, in order to achieve the intended real-world effect.

Developers will need to take advantage of the easy onboarding opportunity that current oracle and reverse-oracle solutions are providing, in order to deliver impactful and relevant DeFi applications built upon smart contracts.

Image Credit: Sasha • Stories on Unsplash

RELATED ARTICLE

Responsive image

Krungsri becomes the first bank in Thailand offering real-time international funds transfer based on Blockchain’s Interledger for corporate customers

Bangkok (30 June 2017) – Approved by the Bank of Thailand, Krungsri (Bank of Ayudhya Pcl.) has developed financial innovations under the Regulatory Sandbox guidelines and becomes t...

Responsive image

Krungsri Finovate successfully leads Series B plus round in Omise

Bangkok — September 28, 2017, Krungsri Finovate, a subsidiary of Krungsri (Bank of Ayudhya) and member of the Mitsubishi UFJ Financial Group (MUFG), announced today the completion ...

Responsive image

KBank introduces world’s first blockchain-based LG service Targeting an increase in L/G issuance via electronic channel to 35 percent

KASIKORNBANK (KBank) has developed its Letter of Guarantee service in the LG market worth THB 1.35 trillion with introduction of the world’s first blockchain-based Letters of Guara...