Introduction
While humans invent several “smart” things to make our lives easier, there is continual debate on whether these items are dumbing us down. While using the term “smart” for describing meters, phones, homes, cities, etc., definitely increases their market value, their actual “smartness” needs to be assessed judiciously. Joining this bandwagon are smart contracts, which are inherent within blockchain technology.
Understanding Smart Contracts in Blockchain
The second generation of blockchain involved the invention of the Ethereum blockchain platform, which is a generic, fully decentralized, smart contract-enabled platform. The most significant advantage of Ethereum was the introduction of smart contracts, allowing incorporating business logic that is executed and enforced by all blockchain nodes to achieve distributed consensus. Smart contracts also represent the agreement between two or more parties on blockchain. This compelling feature allows for various use cases to be implemented on blockchain where both the data and the logic are decentralized. Currently, several public and permissioned blockchain platforms provide out-of-the-box smart contract capabilities.
Smart contracts have the following characteristics:
Analyzing the Smartness Quotient of Smart Contracts
Smart contracts are as good as the logic incorporated in them, which is true for any software application. The biggest strength of smart contracts is that the same version must be executed on multiple nodes of a blockchain network to achieve consensus and finalize the transaction. Thus, a smart contract automatically inherits the blockchain features of transparency and trust. Keeping the performance and scaling challenges of blockchain aside, smart contracts provide a definite advantage over traditional, centralized systems.
For incorporating intelligence into smart contracts, the corresponding business/application logic must be embedded into it. This logic can access and use data already on blockchain for validations and enforcing business rules. However, what if data outside of blockchain is required? Blockchain must rely on off-chain components to provide the data from any external system. But, unless the quality and integrity of the data provided are ensured, blockchain can very quickly become a “garbage-in, garbage-forever” system. Different techniques can ensure data quality and accuracy before relaying data to blockchain, but what if the last-mile check for data needs to be enforced in blockchain itself. Although smart contracts can help, these programs are not allowed to communicate with the external world.
Other scenarios are when smart contracts need time-sensitive data from the external world or information is required at a particular execution step of a business process. For example, if the latest currency conversion rates, payment confirmation, or national ID verification is required. How can smart contracts obtain reliable, authentic data?
It is quite evident that smart contracts need a bridge between the on-chain and off-chain worlds so that blockchain smart contracts can provide real value and cater to various use cases.
Smart Contract Oracles – Blockchain’s Window to the External World
Smart contract oracles is an approach where smart contracts can be supplied with external information and link on-chain smart contracts to off-chain data sources. Through oracles, smart contracts can exponentially increase the use cases blockchain can cater to. Smart contract oracles can be leveraged in the following ways:
Oracles are essential to realizing the full potential of blockchain smart contracts. Therefore, the reliability and trustworthiness of an oracle are very critical. If the oracle is compromised, then the data relayed to/from blockchain will hold no value; its usage will become counter-productive. Oracles can be classified into two types:
Synopsis
Smart contracts on blockchain cannot operate in isolation. One part of the outside world interaction is through the distributed applications that provide human and machine interface. To provide holistic business functionality and authenticated provenance, smart contracts need a gateway to obtain off-chain data inputs in a trustless manner. This capability is fulfilled via oracles, making smart contracts truly “smart!” As predicted by Gartner, smart contract oracles will be a mandatory requirement for any use case implemented using blockchain, and more innovative alternatives will be required in the near future.
Hitarshi Buch
Chief Architect, Distinguished Member of Technical Staff, CTO Office, Wipro
Hitarshi has more than two decades’ experience in IT architecture, consulting, design, and implementation using blockchain, API, SOA, BPM, and Java/J2EE technologies. He has led several IT transformation and modernization initiatives and has provided enterprise-wide SOA-based solutions to global clients. In his current role, he leads the Center of Excellence initiatives in the Blockchain practice.