What is Chainlink? an extraordinary feat of technology
Chainlink is a Decentralized Oracle Network (DON) which has positioned itself as a bidirectional communication layer between Blockchains and the world we live in, giving Smart Contracts and decentralized applications the ability to fetch external data, and the ability to push data to the outside. Chainlink has successfully solved the issue of Oracle Centralization and is used in a wide variety of contexts, such as Lending, Borrowing, Derivatives and Stablecoins.
It is rather difficult to contain one’s enthusiasm and admiration upon realizing what Chainlink has built and brought forth – the ability for Smart Contracts and Decentralized Applications to communicate with the real world and consume data provided by external sources.
Blockchain technology is autotelic by definition: when fetching data, it cannot do otherwise but target itself, the blockchain. It cannot natively speak to, or listen to, the world that we live in. This is a fascinating problem actually, from a technical and also from a philosophical point of view.
It is a problem that Chainlink, a Crypto Winter survivor, has been working on for many years, since its inception in 2017: how do we bring real-world data to a system (namely, blockchain) that is designed to be autotelic. And how do we do it in a way that doesn’t undermine blockchain’s Ethos of Decentralization?
Chainlink’s Architecture: A Work of Art
Smart Contracts are self-executing programs that live on blockchains. They behave in a predetermined manner when certain conditions are met (“if this, then that”). The execution of a smart contract might depend on information that is not readily available on-chain, such as the price of a real-world asset or even the current temperature. Decentralized Oracles feed Smart Contracts with the information they require for proper execution.
Chainlink is a layer-2 enabled Decentralized Oracle Network that allows Smart contracts and applications to “consume” data from the real world.
At its Core, Chainlink is a deep web of autonomous nodes that have the ability to fetch external data and route it to Smart Contracts that require such data.
Chainlink’s network of Oracles is always available, resistant to possible manipulation, and it provides accurate information even if certain Oracles are wrong (they are said to produce outlier results, which are immediately discarded) or outright misbehaving.
As a blockchain agnostic and bidirectional communication layer (Chainlink allows Smart Contracts to fetch data from the outside, and to push data to the outside), it has solidly positioned itself as middleware, as an interface between the world that we live in and the Blockchain.
There are two distinct types of Chainlink Nodes:
- Core Chainlink Nodes: these Nodes have the responsibility of reading Service Level Agreements (SLAs) and streaming all new data assignments to Chainlink Adapters.
- Chainlink Adapters: Adapters can store API keys and manage account logins securely. They enable Smart Contracts to retrieve information from any external device or API, including those protected by a passcode or credential.
Chainlink leverages on-chain and off-chain modules – these modules are interconnected, interchangeable and upgradable.
Today, Chainlink is used in a multitude of contexts:
- Derivatives: Blockchain-based derivative platforms, such as Synthetix, require the price of real-world assets in order to provide reliable on-chain valuations.
- Lending and Borrowing: Lending and borrowing platforms require a price feed to ensure the total value of collateral.
- Stablecoins: Platforms operators require a price feed to assert the value of the underlying assets.
- Asset management: Asset Management platforms need a reliable price feed for critical rebalancing of asset ratios.
A decentralized Oracle
Our readers know that Oracles can be either centralized or decentralized. In the case of centralized oracles, the main challenge with them is that, since they are the sole providers of information, they need to be trusted. This need to trust a centralized data provider undermines Blockchain’s decentralization ethos.
Decentralized Oracles such as Chainlink, also referred to as Consensus Oracles, increase the reliability of the information provided by not relying on a single source of truth.
How exactly is consensus achieved within Chainlink?
Every independent node in the decentralized Oracle Network retrieves information independently from an off-chain source and brings it on-chain. The data is then aggregated so the system can come to a determinate value of truth for a specific data point, which is then forwarded to a Smart Contract or a Decentralized Application, where it is consumed.
Chainlink’s Triptych of Smart Contracts
Three different types of Smart Contracts support Chainlink’s mission to provide quality, tamper-proof data:
- Reputation Contract: The Reputation Smart Contract records Oracle service provider performance metrics and checks its track record. Disreputable and unreliable Oracles are discarded and are blocked from the data provision marketplace.
- Order Matching Contract: The Order Matching Smart Contract logs a customer’s requirements, collects bids from oracle providers, and selects them according to the analysis provided by the reputation Smart Contract.
- Aggregation Contract: the aggregation Smart Contract collects all the oracle provider’s responses and computes the final collective answer to the original query.
Smart Contracts and Decentralized applications all have their own set of requirements, and it is essential for Oracles to be provided exact data specifications. The type of data required, where it should be fetched, at which frequency and for what duration, these are all parameters that need to be communicated clearly to data providers.
It is for this exact reason that prior to order matching (step 2 above), every customer has to draft a Service Level Agreement (SLA) that specifies their requirements.
Chainlink then uses the SLA to match the customer with Oracles that can provide the data. Once a customer has been matched with an Oracle or a set of Oracles, the user deposits LINK tokens in an order-matching contract, which accepts bids from Oracles. LINK tokens are used to pay Oracles that deliver information that fully satisfies the terms of the Service Level Agreement.
Once an Oracle (or a set of Oracles) has been selected, it will go to work and fetch the required data from an external source. The Oracle will process this data and route it via Chainlink. Chainlink will aggregate the data and assess its quality, determining the most accurate answers via consensus and discard outlier answers. It is fascinating to see here that ChainLink nodes determine the quality and the validity of data via Consensus.
The quality, the authenticity and the integrity of the data fetched by Chainlink nodes is of utmost importance. Each node’s performance is measured against the performance of other nodes. If an oracle pushes erroneous data, it is immediately punished by the network and its reputation is damaged – thus lowering the chances that it will be selected to provide data for a customer.
Chainlink customers can ask the Chainlink system to have their requests processed only by Oracles that have staked LINK tokens. LINK tokens are staked by nodes to show that they are economically aligned with and believe in the data they are providing. In the words of Nassim Nicholas Taleb, by putting down LINK as collateral, Nodes show to other Nodes and potential customers that they have “skin in the game”. If these Oracles ever produce outlier or clearly erroneous results, then their stake of LINK tokens will be slashed. This negative incentive is designed to keep Oracles in line – to encourage them to act in a way that benefits all Chainlink stakeholders.