Chainlink traces its origins back to September 2014, when its parent company SmartContract.com was founded to create a bridge between external data sources and public blockchains. The team eventually developed a product called Chainlink that allows smart contracts to connect to data feeds from any web API and data source.
However, SmartContract.com’s original oracle solution for public blockchains relied on centralized oracles, creating what is known as the oracle problem – the problem stemming from smart contracts’ reliance on trusted third parties for external data. In 2017, SmartContract.com attempted to address this problem with the Chainlink network, a new decentralized oracle network. In September 2017, SmartContract.com (SmartContract Chainlink Ltd) raised $32 million in ICO to build the project.
The Chainlink network seeks to bridge external data sources and public blockchains. It connects smart contract platforms to critical off-chain data from markets, events and payments through its decentralized oracle network. Anyone who has a data feed or any other API can join the Chainlink network and undertake jobs to retrieve and provide data to smart contracts. Node operators are paid in Chainlink tokens (LINK) for their services. Node operators will also be able to stake LINK to service certain smart contract requests that require collateral, when staking launches on mainnet.
Chainlink’s mainnet went live on Ethereum on June 1, 2019.
LINK is used as both a payments token and work token. As a payment token, LINK is used to pay Chainlink node operators for providing oracle services. As a work token, LINK can be staked by node operators as collateral to provide oracle services.
LINK’s staking function is optional and specified by smart contract creators requesting oracle services. Failure to provide adequate oracle services would result in a node operator’s LINK being deducted. The extent to which LINK is staked will depend on how willing contract creators are to utilize nodes without collateral.
LINK’s staking function is currently not live, but is expected to launch in 2020.
Chainlink consists of both on-chain and off-chain components. Off-chain, Chainlink consists of a network of oracle nodes that connect to public blockchains (initially just Ethereum). On-chain Chainlink consists of a series of smart contracts that provide an interface to requesting contracts demanding data feeds.
Chainlink’s off-chain component consists of a network of oracle nodes connected to the Ethereum blockchain. These nodes independently harvest responses to off-chain requests.Their individual responses are aggregated via a smart contract on Ethereum, weighted, then returned to a requesting contract. ChainLink nodes are powered by the standard open source core implementation which handles standard blockchain interactions, scheduling, and connecting with common external resources.
Chainlink’s on-chain component consists of of three main contracts: a reputation contract, an order-matching contract, and an aggregating contract. The reputation contract keeps track of oracle-service-provider performance metrics. The order-matching smart contract takes and logs proposed service level agreements (SLAs), which include details such as query parameters (which data feeds to use), the number of oracles needed by the purchaser, collateral required, and uptime requirements, and collects bids from oracle providers. It then selects bids using the reputation contract and finalizes the oracle SLA. The aggregating contract collects the oracle providers’ responses and calculates the final collective result of the ChainLink query. It also feeds oracle provider metrics back into the reputation contract.
The way this flows begins with a user smart contract. User smart contracts broadcast request contracts containing SLAs defining parameters for the data request. Node operators who monitor the Ethereum blockchain for these request, then bid to service them using the order matching contract, which both collects bids and logs the SLA parameters. Users can also select specific node operators manually through either the Chainlink core team marketplace or third party marketplaces for matching requests. Once matched with a request node operators, node operators return external data to the aggregating contract, which aggregates data from operators into a single weighted value, sends performance metrics to the reputation contract, and then reports the single weighted value back to the smart contract that requested it. In exchange for their services, node operators are compensated in LINK.
LINK is currently built on Ethereum, although it plans to integrate with all smart contract networks later on its roadmap.