What is CHAINLINK & How Oracle's work?
In recent years, we have seen massive adoptions of blockchain technology in various fields, especially finance. Even though bitcoin dominates, its lackings have led to the development of other blockchains that have other capabilities and can do more things (e.g. Ethereum). But these blockchains are designed to be completely isolated from one another and have no fixed ways to talk to each other, or to the outside world.
This is what Chainlink is attempting to solve, by building a framework that will allow all blockchains to have access to each other and to real-world data through oracle's.
What is a blockchain?
A blockchain is like a database or a ledger in its simplest form. But what sets it apart from a normal database or a paper record is that it uses cryptography to protect its data once it has been written. Therefore, a blockchain is an immutable ledger. For example, bitcoin is so innovative because it uses a blockchain to store the amount of bitcoin anyone owns. And copies of this blockchain ledger are stored and updated by thousands of computers across the world (“miners”).
These blockchains are 100% publicly accessible, and anyone can see how much bitcoin a certain wallet address owns. It can not be tampered with, even by the miners. This is because anyone can take the blockchain and check the entries with cryptographic hashes to see if the information has been tampered with. Hence, a blockchain solves the problem of trusting information storage.
What are smart contracts?
The bitcoin blockchain is only a read and writes database, you can not really perform decisions or calculations on the blockchain. But in Ethereum, you have “smart contracts” which are programs stored on the blockchain. These programs are also 100% transparent, so anyone can go and see what the program is. The programs can perform “If X then Y” types of logic. And this opens up a huge range of possibilities, because a smart contract is like a piece of code that is running on a decentralized network of computers, and once a smart contract is deployed, it can not be tampered with, just like other information on the blockchain.
Smart contracts have brought upon decentralized applications (dApps). These dApps are not like Google or Facebook, where you can’t see the code that is running on the server. dApps on platforms like Ethereum are 100% public and therefore the code is open source.
What is Chainlink?
Chainlink is a decentralized framework that allows blockchains of different platforms to communicate with each other and access real-world data. For example, bitcoin and Ethereum blockchains are completely separate, and each is designed with different programming languages. But what if an Ethereum smart contract wanted to access bitcoin blockchain data? This is what Chainlink solves.
Cross-chain interoperability protocol
Chainlink created this open protocol so that any blockchain can communicate with another, regardless of how the blockchain works. So, Ethereum smart contracts can now talk to the thousands of other blockchains using Chainlink. And when new blockchains are created in the future, Chainlink will still work for them because the protocol is an open standard.
Oracle's provide real-world data
Oracle is also a decentralized network of computers that provide accurate real-world data. The participants on the oracle network (“nodes”) are each held accountable for any inaccurate data they provide. For example, weather data is known as “off-chain data”, since weather data is not stored on blockchains. So, if a smart contract in a dApp needs to use make decisions based on off-chain data, it can do so using Chainlink in a trustworthy way.
What are 'on-chain' and 'off-chain data'?
On-chain data is the information stored directly on the blockchain e.g. the number of bitcoin that a certain wallet owner has. Off-chain data is not stored on the blockchain, e.g. no blockchain has any information regarding the price of other cryptocurrencies, whether it's a public holiday today or not, the number of coronavirus cases in the world, and so on. Hence, off-chain data is essentially all data in the real world. And Chainlink intends to provide these data to the blockchains in an accurate and tamper-proof way.
How Chainlink achieves accuracy
Since Chainlink is a distributed network, it doesn’t acquire real-world data from a single source. It gets the same data from multiple sources e.g. it will get weather data from APIs like Google weather API, Accuweather API, and so on. Then the network will compare all these data with each other and come to a consensus. The data that came from the majority of the participants will be finally sent to the blockchain. Hence, if there are many nodes, the risk of inaccurate data reaching the blockchain is negligible.
Chainlink penalties for inaccurate data
The nodes that provide the off-chain data are held accountable for the accuracy of the data. If they provide wrong data, they will be penalized using fines. These fines will be cut from a certain amount of currency that the participants have stored before they join the network. In fact, this amount of currency is quite large, and the whole amount can be deducted if the node is trying to tamper with the data. Thus, this provides a strong incentive to the nodes to provide only accurate data.
Hybrid Smart Contracts
Smart contracts were originally designed to only work with on-chain data. But using data from oracles, they can be turned into “hybrid” smart contracts. So, hybrid smart contracts use both on-chain and off-chain data. For example, cryptocurrency-powered crop insurance is an empowering application for farmers all across the world.
In the traditional insurance industry, insurance companies often don’t give you the money even when you pay every installment of your payment fully and the event happens. The risk of a traditional insurance company manipulating your insurance account is high in many cases, and fighting a big company in a legal battle is not feasible for an ordinary person.
Guaranteed real-world agreements and deals
However, in smart contract-based insurance, there is no room for insurance workers to manipulate the money you should receive. For example, the crop insurance smart contract will fetch weather data using the trustworthy oracles and send money to the farmer automatically if there was rain for more than a certain number of days. The smart contract is “set in stone”, it can not be tampered with once it has been published on the blockchain. Hence, even if the people running the insurance company wanted to, they will not be able to stop you from receiving the money from your smart contract-based crop insurance.
Decentralized finance applications
Similarly, there are many more real-world applications like this, most notably in decentralized finance (DeFi), where the traditional financial activities like loan lending and lotteries can now be done using hybrid smart contracts and there will be cryptographically guaranteed security backing it. In fact, DeFi aims to remove the tampering that traditional financial institutions do, so that bad actor within these organizations can not manipulate your money.
Cryptographically secured lotteries
Another useful feature of Chainlink is a verifiable randomness generator, which can use used in applications like cryptocurrency lotteries. In the real world, the organization running the lottery can easily manipulate the winner of the lottery. But in a smart contract-based lottery, a random winner can be picked and the randomness can be checked by anyone using Chainlinks VRF. Hence, this ensures fairness in many applications that use randomness. In fact, you will be able to verify the randomness when breeding and generating a dynamic NFT such as a crypto kittie!
In a world of ever-growing blockchains, Chainlink is linking these blockchains and creating new possibilities. In the coming years, we will see fields like DeFi growing exponentially and billions of more people will start using blockchain-based services. Hence, applications of Chainlink will only increase. It will be interesting to see what other innovative decentralized concepts emerge in the future.
Let us know in the comments what you think about this article, we read every comment!