Chainlink 2.0 brings off-chain compute to blockchain oracles, promotes adoption of hybrid smart contracts

A new whitepaper just released by leading blockchain oracle service Chainlink lays the foundation for new capabilities for application and smart contract developers.

The ability to write programs with money is as big a breakthrough as the ability to write programs with documents. It gives Wall Street's capabilities to anyone, without expensive lawyers or financiers.

This quote on the transformational potential of smart contracts belongs to Balaji S. Srinivasan, a well-known advocate of the transformational potential of crypto at large. Depending on where you stand on crypto, you may find it succinct or hyperbolic.

Chainlink and its co-founder Sergey Nazarov are clearly in the camp of crypto advocates. Chainlink provides an oracle service, enabling smart contracts to interoperate with the world. Today, Chainlink released a whitepaper outlining what they dub Chainlink 2.0ZDNet connected with Nazarov to discuss what this means.

ZDNet Recommends

Bitcoin mining 101: How to build a cryptomining rig

Interested in building a system for mining cryptocurrency? Here's all the hardware you need and what you need to know to get started.

Read More

What are hybrid smart contracts?

Smart contracts enhance blockchains (at this point, mainly Ethereum) with the ability to execute tamper-proof code, in addition to storing tamper-proof data, turning it into a "world computer."

Smart contracts promise to take execution of processes and agreements to the Ethereum global computer. There's just one problem: Smart contracts can't talk to the rest of the world. This is where oracles, and Chainlink, come in.

An oracle is a gateway between a blockchain and the real world. Oracles can get data off the blockchain and pass it on to smart contracts.

Chainlink is a decentralized oracle network, which means there are many nodes on which the service runs. Operations that run on blockchains are costly -- users have to spend tokens to run them. When each oracle node has to bring data onto Ethereum, this incurs a lot of ETH gas costs for the oracle node operators.

This is why Chainlink recently introduced what it calls Off-Chain Reporting. What this means is that data storage and computation is no longer performed on the Ethereum blockchain, but in a different decentralized network.


Chainlink, the leading blockchain oracle, just released a new whitepaper outlining the next step in its evolution, dubbed Chainlink 2.0

That was a first step towards what Nazarov calls hybrid smart contracts. Some of the initial smart contracts focused on tokenization, generating a token and moving it between different owners, or private key voting, which means people can vote on things using their private key or cast their votes using the token. Nazarov noted that now we see something he calls hybrid smart contracts:

"A combination of both the on-chain code that's tamperproof and operating in a smart contract platform like Ethereum, and an oracle, which is essentially a trust minimized, highly reliable connection and off-chain computation resource that provides the additional functionality that a hybrid smart contract needs to achieve its specific outcomes."

In the dominant categories of smart contracts today, such as decentralized financial products, lotteries, or decentralized insurance, over 90% of them are really hybrid smart contracts, Nazarov claimed. That means those smart contracts are made up of two equal components.

They're made up of some on-chain code that defines the contract itself, which is where the conditions of the contract are defined, where it receives payment from, where it sends payment, and where it proves certain things about the state of the agreement.

But then you also have decentralized financial products relying on data. They're relying on market data about the value of an asset or some kind of market event in order to actually determine what the decentralized financial product will do or what it will payout to the user.

Special feature

Special report: How blockchain will disrupt business (free PDF)

This ebook, based on the latest ZDNet/TechRepublic special feature, looks at how blockchain is shaking up the economy and changing the way individuals and enterprises conduct business.

Read More

Hybrid smart contracts means mixing and matching

Nazarov noted that Chainlink promotes hybrid smart contracts because they've seen a continuing trend in how developers build smart contracts. Developers want more and more advanced smart contracts, but a Blockchain due to its native security model isn't giving them all the features that they need, he went on to add.

Two of the primary features are around privacy and off-chain computation that can do computations, which can't be done on-chain for scalability or cost efficiency or other reasons, according to Nazarov. This, however, brings about an interesting dilemma.

If oracles can now not only store data, but also do compute, then how do developers choose which parts of their smart contracts they want to run on-chain, and which ones off-chain?

Nazarov thinks people will continue to need a smart contract on-chain, and they will also continue to need a suite of decentralized services run on various decentralized oracle networks to augment that smart contract. As to the "what goes where" question, the answer does not seem entirely clear-cut.

The answer will vary greatly between different smart contract use cases. It depends on the properties of the chains people are using, as well as decisions about how much they want to pay in fees and how much transparency they want to provide, Nazarov thinks. It will come down to being able to control value, he went on to add:

"What we're going to continue to see is a network effect in networks like Ethereum and maybe one or two others. There you end up seeing more and more value put into the network through various private keys holding value, and then putting that value in the crypto format into various smart contracts that then hold it as a decentralized financial product, as an insurance product."

There may be some similarities, but Chainlink 2.0 is not another blockchain -- it's a decentralized meta-layer, a large collection of decentralized services that are then combined. This is how Nazarov described Chainlink 2.0.


Secure off-chain computation powered by Chainlink Decentralized Oracle Networks. Image: Chainlink

Presumably, running off-chain compute will cost less than running the same compute on-chain, but it will still cost something. So a rule of thumb could be -- if you want maximum auditability and security, and you're willing to pay the price, you should do it on-chain. Otherwise, off-chain will do. And you can always mix and match.

A decentralized oracle network is its own focused service, and that's why there's thousands and eventually, there may be millions of them, claimed Nazarov. He sees each network as having its own specific goals.

For example, generating one piece of data about a single price pair like the ETH-USD price or the BTC-USD price. Then providing that one piece of data and arriving at a single consensus around what the accurate, reliable picture of the world is from the point of view of that one piece of data.

Then another type of oracle network will be a request model-based network. A kind of more of a bespoke, decentralized network, where you'll have somebody compose a network about a topic that other people might not find interesting. For example, getting IoT data and doing a computation to validate that a solar panel field is operating properly, then returning the result to an insurance contract.

A grand vision for hybrid smart contracts

In a different decentralized oracle network, the network may provide the price of electricity to that same insurance contract. One of the contract's parameters might be insuring against the drop in electricity prices, as well as whether the solar panel field is continuing to provide electricity.

Nazarov sees more and more advanced smart contracts in the future, where people utilize decentralized oracle networks that are growing in security as each additional user utilizes them.

Eight or seven years ago, the conception people had of a smart contract was a tamperproof digital agreement that could prove that an event occurred. It was only later that smart contracts came to define just on-chain code, he went on to add.

Chainlink's vision for hybrid smart contracts is to take their definition beyond what's possible with on-chain code. Nazarov referred to use cases such as decentralized insurance products that protect farmers in developing countries from the risk of drought, all the way to global trade and possibly even voting schemes.

The idea is to replace the trust issues of society in both the developed markets and the emerging markets with a set of cryptographically guaranteed systems that are immediately accessible globally through the internet.

That's a grand vision, and to come full circle, one that Srinivasan also makes a case for, specifically for India. It took Chainlink a few years to get from its inception to where it is today. It may take considerably longer to get closer to that vision.