Reading hybrid smart contracts in one article

803d3e78fad1b51442f626dff65f9ddc

Hybrid smart contracts include code running on the blockchain and data and computing resources under the blockchain. These resources are transmitted from the decentralized oracle network to the chain. Hybrid smart contracts can coordinate complex economic and social activities, have the characteristics of block chain tamper-proof, and can safely access the off-chain oracle service to achieve various innovative functions, such as scalability, confidentiality, and fair sequencing And access to any off-chain data source or system.

This article will clearly define the role of hybrid smart contracts in the blockchain trust model, and explain the various decentralized services provided by Chainlink oracles for hybrid smart contracts, and how this development will give birth to a new generation of hybrids Smart contract application. These hybrid smart contracts that connect off-chain resources will sweep almost all mainstream industries in the future and change the way the entire society cooperates.

How the oracle expands the way of cooperation on the blockchain

Blockchain is essentially a computing infrastructure that promotes trusted cooperation, which is its key function. With trust, participants will firmly believe that the partnership is reliable, true and effective. The most common way to build trust in cooperation is to sign a contract. The contract defines the legal and commercial obligations of the parties, as well as the rewards and punishments for their actions. However, today’s contractual obligation enforcement mechanism is full of loopholes. In some cases, a participant will have absolute advantages, such as manipulating and influencing the contract execution mechanism, learning more news than the counterparty, or having more time and capital to extend the arbitration process. Therefore, the current contract system has become: You must trust the counterparty’s brand endorsement in order to trust that the cooperative relationship between you is reliable.

The emergence of blockchain technology has transformed cooperation from brand endorsement to algorithm-based trust (math-based trust). The storage, execution and custody of the contract have been transferred to the code logic running in the decentralized network, and individuals cannot intervene and tamper at all. Blockchain is like a computer without internet connection. It has high credibility because it is a closed environment and can only implement several easy-to-execute functions, such as transferring between multiple addresses in a closed ledger. Pass. This setting is intentional. Although the block chain’s closedness and functional unity bring it tamper-proof modification and a high degree of certainty (this is also the most valuable part of the block chain), it also excludes any need to access off-chain data , Computing or functional cooperation.

Because users want to expand the feasible ways of cooperation on the blockchain, oracles and hybrid smart contracts have appeared one after another. The oracle provides a secure portal for blocks to link to the external world, allowing smart contract applications to verify external events, trigger operations based on external systems, and complete computing tasks that cannot be achieved on the chain.

As mentioned in the Chainlink 2.0 white paper, decentralized oracle networks (DONs) have greatly expanded the on-chain cooperation methods that can be realized by smart contracts. The rapid rise of decentralized finance (DeFi) is a good example. The Chainlink decentralized oracle network transmits financial market data to the blockchain, and supports various hybrid smart contract protocols such as the Aave currency market, Synthetix derivatives platform, dYdX leveraged trading market, and Ampleforth algorithm stable currency, thus accelerating DeFi Development.

The components of a hybrid smart contract

Hybrid smart contract applications consist of two parts, namely: 1) Smart contract-this is a code that runs exclusively on the blockchain; 2) Decentralized oracle network-this is a secure chain for smart contracts Next service. These two modules interact safely and seamlessly, forming a hybrid smart contract application together. Finally, the on-chain code has been enhanced in many unique ways, and a series of new application scenarios have been activated, breaking through the technical, legal or financial limitations of the previous on-chain code.

Hybrid smart contracts synchronize two completely different computing environments to create application functions that cannot be achieved by blockchain or oracle network alone, and combine the unique advantages of these two environments. The on-chain code runs in an extremely secure and functionally limited blockchain environment, and the attack surface is small. Therefore, users can obtain extremely high certainty when executing and storing. The code must be strictly executed, and the result will be stored forever. The chain cannot be tampered with. And DON runs off-chain, so it can implement more functions and access more data more flexibly.

It is worth noting that DON also has very high tamper resistance and reliability, which can be comparable to smart contracts, but the difference is that DON runs in a closed chain environment and uses a variety of security mechanisms. Each DON will provide a customized decentralized service for an application, which means that other smart contracts on the same blockchain have nothing to do with the performance of this DON, and the underlying blockchain consensus that guarantees the security of all smart contracts There is no risk to the mechanism. As an independent service, DON not only has advantages in security, but also has flexibility. It can verify and calculate more complex and open off-chain data.

For example, some smart contracts choose to access DON based on the level of decentralization and encryption economic security, while other smart contracts choose DON with high reputation and advanced encryption technology for verifiable privacy calculations. In these heterogeneous networks, thousands or even millions of DONs can be paralleled, and each DON will not depend on each other, and can provide specific decentralized services for specific applications. Users of the same DON can also share the service cost (for example, many DeFi protocols currently use Chainlink ETH /USD to feed the price oracle and share the cost). This framework is very important. It can provide services for all blockchains and applications at the same time, such as accessing off-chain data and ensuring privacy for applications running on high-speed blockchains. In addition, applications on the blockchain with a high degree of decentralization also need to access scalable computing resources.

How hybrid smart contracts combine on-chain and off-chain computing resources

In order to further understand the difference between on-chain and off-chain modules, we first define clearly for each module:

On-chain module: blockchain

  • Maintain the ledger, reliably custody user assets, and interact with private keys.
  • Handle irreversible transfer transactions between users and perform final settlement.
  • Resolve differences and establish a safety fence to ensure the normal operation of DON’s off-chain services.

Off-chain: Decentralized oracle network

  • Securely obtain and verify data from the off-chain API, and transmit it to the smart contract in the blockchain and layer-2 network.
  • Perform various computing tasks for smart contracts in the blockchain and layer-2 network.
  • Transmit the data output by the smart contract to other blockchains or off-chain systems.

7c2b91d32e141ac43852c6e7bc3bf002

Hybrid smart contracts combine on-chain code and off-chain centralized oracle network to realize more advanced blockchain applications.

Chainlink decentralized services escort hybrid smart contracts

After defining the hybrid smart contract, let’s discuss the various decentralized services provided by Chainlink DON for smart contracts. These decentralized services can be roughly divided into two categories, namely: off-chain data and off-chain computing.

Off-chain data

DON can build a bridge between various off-chain data and the blockchain, and enter the required data for the hybrid smart contract. The following are the data types that can be accessed initially:

  • Feeding price-asset price data aggregated from hundreds of trading platforms. The data is weighted based on transaction volume, and outliers and false transactions are excluded.
  • Proved reserves – on the most current data assets through evidence reserve balances, such as W BTC of Bitcoin dollar mortgage asset-backed assets, or the TUSD.
  • Any API-payment data from a password-protected API interface. The data types include weather forecasts, sports game results, corporate back-end data, and Internet of Things data.
  • Blockchain middleware-the abstraction layer of the blockchain, which enables the off-chain system to access smart contracts in any blockchain network and read and write data in both directions.

Off-chain computing

DON can perform a series of off-chain calculations on behalf of smart contracts, help smart contracts obtain certain data, or create functions that cannot be achieved on the native blockchain, such as privacy protection, scalability, and fair sequencing. The following are some of the DON calculation functions that have been implemented and will be implemented in the future:

  • Keeper network-an automated bot that maintains smart contracts for a specified period, starts the contract at an appropriate point in time, and performs key on-chain functions.
  • Off-Chain Reporting (OCR)-Aggregate the response data of DON oracle nodes in a scalable manner, and then send the aggregated data to the chain in a single transaction to reduce on-chain costs.
  • Scalable computing-to achieve high throughput and low cost for smart contract execution, using off-the-shelf layer-2 technology to regularly synchronize with the chain.
  • Verifiable Random Function (VRF)-securely generate verifiable random numbers, using encryption certification technology to prove the integrity of the process.
  • Data and computing privacy-The oracle computing function that protects privacy uses zero-knowledge proof (DECO), trusted hardware (Town Crier), secure multi-party computing, and a specific DON committee system to transmit sensitive data to smart contracts confidentially.
  • Fair Sorting Service (FSS)-Decentralized transaction sorting is carried out according to the pre-defined fairness principle to avoid preemptive attacks and miner extractable value (MEV).
  • On-chain contract privacy-untie the contract logic and settlement results to protect the privacy of smart contract transactions, such as transferring data between two parties through the Mixicles function of DON.

b68c8ebbc7ec370a3bdef3bec1a2ae02

Chainlink’s decentralized oracle network provides a series of rich services and expands the functions of hybrid smart contract applications.

The impact of hybrid smart contracts on various industries around the world

DON can implement an advanced hybrid smart contract framework, seamlessly connect different systems and independent entities on the blockchain, and achieve safe and universal automated interaction. Chainlink overcomes the technical barriers of smart contracts for developers. Developers can use the high certainty of the blockchain to achieve various key functions such as external connections, privacy protection, scalability, and fair sequencing through DON. Hybrid smart contracts not only create a more credible and efficient cooperation space for all participants in the network, but also connect the blockchain network to the traditional off-chain infrastructure without any modification in the back-end.

DON will provide the required privacy protection and scalability for many smart contract applications, and will cover most enterprise application scenarios and numerous gaming and financial applications, enabling them to achieve high throughput and real-time decision-making. Hybrid smart contracts will also activate a series of unprecedented new application scenarios, such as the realization of algorithm-based economic fairness and transparency through verifiable random numbers and decentralized transaction sequencing.

Some mainstream industries that have felt or are about to feel the impact of hybrid smart contracts:

  • Identity information-identity information can be automatically verified and information privacy is protected. Smart contracts can define required personal information and required operations. DON conducts calculations on these data, verifies the user’s personal information, and at the same time protects the information from being disclosed to the counterparty and will not be stored in the off-chain system.
  • Finance-an open financial market that is resistant to censorship, with no threshold for access and transparent information. Smart contracts can define transaction rules for buyers and sellers. DON can use off-chain data for pricing and settlement, and implement additional functions, such as hidden transactions, KYC verification, fair transaction sequencing, and high-speed off-chain processing. 
  • Supply chain-a multi-party transaction agreement that runs on a shared ledger, digitizes the product line, and automates operations across multiple systems based on verified data. Smart contracts can define contract obligations, payment terms and punishment mechanisms. DON can use private computing and IoT data to track transportation information, monitor quality control, verify customer identities, and trigger settlement payments.
  • Insurance-establish a bilateral prediction market based on predefined events, and create parametric insurance on this basis. Smart contracts can define premiums and claims procedures, and DON can connect the contract to off-chain data, obtain quotations and process claims applications. DON can also carry out risk assessment calculations, obtain complex risk assessment results from data sources such as cloud platforms, and verify user identities in a confidential manner.
  • Game-automatic distribution of game rewards, users can fully own the in-game assets through NFT, and provide authoritative certification, proving that all participants have the same probability of winning. Smart contracts can define game rules and reward distribution models. DON can provide tamper-proof random numbers to ensure that the fairness of the game can be verified, and the reward distribution process is fair. After the game dApp is connected to DON, it can also access a series of off-chain data sources such as augmented reality IoT sensors, and process some game functions off-chain to improve game performance.
  • Marketing-Marketing activities automatically issue rewards in real time based on various parameters and indicators. Smart contracts can define a tiered reward distribution model and set specific milestone goals. DON can verify whether the target is achieved, and carry out confidential calculations on customer data and market trends to more effectively evaluate marketing activities.
  • Governance-distributed communities can safely and fairly manage shared systems and capital pools. Smart contracts can define a complete governance framework. DON can provide off-chain data and computing resources, trigger various operations such as profit distribution, cost sharing, and identity authentication, effectively resist sybil attacks, verify the participation of members, or even achieve automation. Decision process.

In the end, DON can provide all the services that cannot be implemented on the chain, and bring stronger encryption security guarantees for existing data and systems to start the off-chain service ecosystem. The hybrid smart contract infrastructure can enrich the cooperation methods of decentralized systems, so that various blockchain and non-blockchain infrastructures can interact safely and reliably, and guarantee scalability, confidentiality, customization and universal connection Sex. Although the current scale of cryptocurrency assets has reached several trillion U.S. dollars, and the DeFi economy is approaching 100 billion U.S. dollars, the blockchain ecology is still in the early stages of development, and there is still huge potential unexploited, so hybrid smart contracts and Chainlink decentralization The oracle network has huge application space and potential.

If you want to start developing hybrid smart contract applications immediately and need to access off-chain data or computing resources, please check our developer documentation. You can also ask technical questions on the Discord channel or communicate with Chainlink experts over the phone.

 

Posted by:CoinYuppie,Reprinted with attribution to:https://coinyuppie.com/reading-hybrid-smart-contracts-in-one-article/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Like (0)
Donate Buy me a coffee Buy me a coffee
Previous 2021-08-20 12:08
Next 2021-08-20 12:10

Related articles