Application of chainlink Oracle in cross chain interoperability


In the early development stage of blockchain, people generally believe that “single chain comes first”, that is, a blockchain contains all the functions required by dapps end-to-end operation. However, the prevailing idea is that a model contains multiple blockchain protocols, and each protocol has specific functions. The reason for this change is that people realize that the amount of data is too large, and the needs of developers are diverse, and the risk of relying on one platform to meet all the requirements is too high.

Therefore, a new problem arises: these Distributed Accounting Book Technology (DLT) protocols with different functions can neither interact nor connect with systems other than DLT. The interoperability protocol dominated by chainlink is becoming a standardized interoperability solution in the industry, which can realize secure disintermediation interaction between systems.

Isolated DLT stacks

There are many different types of distributed accounting books in DLT’s current infrastructure, each of which has specific functions, advantages and disadvantages. For example, bitcoin is widely regarded as the gold standard for storing value, so its advantages are high reliability and complete decentralization of transactions, but the disadvantages are single function and slow speed. Ethereum allows developers to add conditional expressions to realize state change to enhance the function of blockchain. However, in order to do this, it pays the price of replacing the simple programming language with a more complex language, which makes the learning process more difficult and the code more prone to errors. Both bitcoin and Ethereum are focused on accomplishing a particular task, so they are both successful.

Today’s trend is not to develop a blockchain that can cover all functions, but to focus on a specific function. This logic coincides with today’s Internet protocol stack. The Internet is not an all embracing, huge single protocol, but composed of various protocols, each of which is responsible for a specific function. The protocol stack is optimized by division of labor and cooperation, and reduces the attack strength of each layer of protocol, so as to reduce the risk.

Application of chainlink Oracle in cross chain interoperability

At present, there are many DLT protocols with unique and practical functions in the distributed protocol stack of Web3.0. Web3.0 is a decentralized Internet in which users can control their data, identity and experience. These protocols constantly optimize their core functions, but they cannot interact with each other in Web3.0 or outside the network.

The basis of the Internet stack is transmission control protocol and Internet Protocol (TCP / IP). These two protocols package data and transmit them back and forth between computers / servers. It’s a bit like a postal service that delivers mail. Although the blockchain also transmits data reliably within its system, there is no standardized protocol in the whole DLT ecosystem, so dapps cannot realize cross network interaction and off chain data interaction.

Another major protocol on which the Internet depends is HTTP and HTTP. The HTTP protocol allows web browser clients to send data requests to the web server. If the request is accepted, users can access the web page. This protocol defines the data format and transmission mode, and also defines what actions the browser should take when receiving a command. Blockchain needs TCP / IP protocol to realize data transmission at the bottom. Similarly, they also need a protocol to regulate the way of data transmission. The HTTP protocol is built on the existing TCP / IP stack and extends its functions to allow users to browse web pages. The emergence of this protocol makes the user interface more simple, and can realize large-scale data transmission.

If we want to develop decentralized applications that can be applied in the real world, developers need to implement data transmission between different systems and establish a standard protocol to standardize the data transmission mode. For DLT to be widely used, these protocols must make dapps development process as simple as drag and drop app development. Developers can select a blockchain (public chain or private chain, speed priority or decentralization priority, and specific application scenarios), connect to various data inputs (data, Internet of things, web API), and then use a variety of data output (payment system, cloud platform, other blockchains) for secure and reliable settlement. For example, a DAPP can use off chain IOT devices to trigger Ethereum smart contracts to pay both parties, one party paying bitcoin and the other using PayPal to pay French currency.

Establishing new TCP / IP and HTTP protocols

In order to realize and standardize data transmission, two main function problems need to be solved

– decentralized asset exchange – interoperability is a more focused feature of trading local assets between protocols. For example, someone can use bitcoin to pay Ethereum DAPP, or exchange bitcoin for letcoin. Tokens are data on the blockchain, so asset transactions are essentially closest to the TCP / IP protocol.

– decentralized message data exchange – another less important feature of interoperability is the transfer of message data between protocols. For example, devices on iota can transmit IOT data, trigger smart contracts on Ethereum, and finally trigger payment and settlement on the bitcoin blockchain. Data can be transmitted between two distributed accounting books, or between on chain smart contracts and off chain systems. For example, the off chain market data from Reuters triggers the on chain derivatives smart contract, and then triggers off chain French currency settlement through swift code. This function specifies how the message data in the system triggers the data transmission of the underlying blockchain or back-end system, which is essentially closest to the HTTP protocol.

Decentralized asset and data transactions all have a lot of focus and design methods. Before we talk about chainlink’s attempts in various patterns, let’s explore different solutions.

Implementation of on chain interoperability

One way to solve the interoperability problem is to use another blockchain as a communication bridge. In short, the third blockchain is built between two blockchains, and the transaction and message data between the two chains are recorded in a secure encryption way.

Hub and spoke mode: hub and spoke mode is the most common mode, and the parent black chain is the hub of other blockchains (also known as side chains). This model is also known as metachains. At present, Polkadot, cosmos and Ethereum have adopted this model in several side chain proposals (plasma, matic, loom). Although a decentralized asset exchange (such as plasma) can be established as a side chain, the main problem of most meta chains is how to realize cross chain message transmission among all side chains in the network. In addition, special bridges can be established to connect state machines outside the ecosystem, such as Polkadot and Ethereum.

Decentralized Finance: another way to achieve interoperability is to establish decentralized asset exchanges. Blockchains created by projects such as Wanchai and icon allow other blockchains to connect with it to establish decentralized asset exchanges. This model is similar to a decentralized bank that implements cross network transactions. Various protocols have been established on the blockchain, including 0x and kyber network, to realize decentralized token transactions and bring liquidity to the blockchain.

· universal bridge: another way is to build a universal bridge with blockchain. Aion project is building a one-way bridge to verify, record and store cross chain interactive data in books, and provide blockchain consensus with time stamp. For those blockchains that do not use hub and spoke mode or have specific requirements, this method is particularly practical.

Implementation of off chain interoperability

Another way to achieve interoperability between systems is to develop or use middleware off the chain. All parties in this model need to be carefully analyzed, because off chain data cannot be verified in a deterministic environment. However, if we find the right way, we can bring efficient, practical and equally safe solutions for users.

Atomic swap: atomic swap is the exchange of assets in a decentralized way, such as bitcoin for letcoin, without going through a centralized exchange. Atomic swap is similar to barter in the real world, in which both parties reach an agreement on the exchange of assets and then complete the transaction. Although this technology is still in the early stage of development, and can only be used for similar asset exchange protocols in most cases, Komodo and other projects have begun to try to launch atomic swap for heterogeneous asset exchange protocols, such as bitcoin for Ethernet.

· Oracle: a less concerned function of Oracle is to connect two blockchains as a universal bridge. This function can not only realize information exchange between blockchains, but also interact with any enterprise system. For example, transaction activity data on one blockchain is used as input to trigger a smart contract on another blockchain. Another example is to trigger the smart contract on the blockchain with cloud data, and then settle the settlement in the payment system under the chain. Oracle can realize all kinds of cross chain interaction modes that other modes can’t realize.

· state channel – another way to swap assets on the same blockchain is to establish an off chain state channel to trade assets. The state channel allows each party to trade and record the ownership of assets without any transaction on the chain until the final delivery. This method is very effective to expand the capacity and reduce the transaction cost on the chain. The upcoming expansion of plasma Ethereum is mainly aimed at utxo asset transactions between side chains, and the state channel can exchange state change information before state changes on the chain.

Chainlink: general information transmission standard

Chainlink is the first decentralized Oracle network, which is equivalent to HTTP protocol in function (equivalent to HTTPS in trusted execution environment), and realizes information transmission in protocol layer and application layer on and off chain. Chainlink nodes are able to package information and data from validated APIs into a format that smart contracts can read. It can be connected to any enterprise node such as chainlink, Internet of things or API. If a task is not supported by the chainlink core node, it is also easy to establish an external adapter to extend the node function. Chainlink can perfectly realize the data transmission between different systems, and can arbitrarily adjust the degree of decentralization and security level according to the actual application requirements.

· off chain resources: chainlink is the market’s leading solution for connecting off chain data to on chain smart contracts. This function is very important because many blockchains do not need to interact with other blockchain protocols, but need to connect to external APIs. It needs offline data to trigger the execution of smart contract, and trigger the off chain payment system and cloud platform for settlement. It is estimated that more than 80% of smart contracts need offline resources to some extent.

Hub and spoke mode: hub and spoke interoperability protocols can realize information exchange between side chains, but they still need offline data to trigger on chain behavior. Chainlink has announced cooperation with Polkadot and Ethereum to provide offline data for its network.

Decentralized Finance: many decentralized financial platforms can also build protocols through bridging to achieve cross chain interaction. However, if it is asset trading, the blockchain needs market data to trigger transactions. The chain has provided the world wide web with smart contracts.

Universal bridge: chainlink can realize the information exchange between protocols through external adapter. External adapters can trigger various on chain behaviors based on events occurring in other blockchains and systems. External adapters have been launched on aion, iota and zilliqa for developers to use when developing cross chain applications. Chainlink can also trigger asset transactions on the blockchain based on external data through one-way bridges, such as transactions in aion networks.

· enterprise blockchain: chainlink can safely connect public chain to enterprise blockchain, connect enterprise blockchain together, and transfer confidential information between various systems in trusted execution environment (TEE). In fact, the interoperability on the public chain is not suitable for the transmission of sensitive information in all cases. Because of the acquisition of town crier, chainlink has unique conditions to transmit confidential data under the premise of ensuring the integrity of system data.

· private keys and credentials: chainlink can process credentials in a trusted execution environment, which is critical for decentralized exchanges. The chainlink Oracle running in a trusted execution environment can log in to an individual account to verify whether an individual owns an asset or has sufficient funds to trade. Information can be safely transmitted to smart contracts to trigger or reject transactions. The chainlink Oracle can also process private key information and trigger transactions on the public chain. Since most of the accounts in the exchange come from the accounts with funds on the account, the trusted execution environment is very important for processing sensitive information such as private key. In trusted execution environment, there is no need to worry about fund theft or account information disclosure.

State channel: state channel is a good way to reduce cost and expand capacity under chain, but it needs fair trigger conditions to ensure that all parties abide by the rules of state channel and keep consistent settlement form in the chain and off chain. Chainlink Oracle allows data to trigger state channel transactions, and uses data to trigger transactions on the chain when certain conditions are met.

· atom swapping: because atom swapping is point-to-point, it is difficult for ordinary users to determine the effectiveness of atomic exchange scripts. The decentralized Oracle can verify the payload of atomic exchange and confirm whether the transaction is in accordance with the agreement. In addition, it can further encourage nodes to provide accurate information through collateral.

The first year of Internet consensus

Once the interoperability between blockchain and other independent systems is realized, it will open a new era for smart contracts. Application scenarios that were previously impossible to implement in Web 2.0 will become a reality, which will change the way consumers and businesses interact.

The TCP / IP protocol, which realizes cross network interaction, enables the transmission of information between networks, while HTTP enables web browsers to access data quickly. These protocols make up the Internet as we know it today. Interoperability protocol has brought the same change to DLT field, spawning cross chain applications, and extracting data from the chain to trigger state change. These protocols not only connect the originally isolated blockchains, but also connect the emerging DLT ecosystem to the current common infrastructure in the world.

The kernel of chainlink is a general information transmission standard, which can transmit data safely between different systems. When all protocols in the DLT stack can interact seamlessly, the era of smart contract 3.0 is really coming. In this era, smart contract will become an end-to-end solution for interconnection and will subvert many existing business models.

Welcome to the chainlink developer community

Application of chainlink Oracle in cross chain interoperability