Today we will talk about LINK, which ranks around 23 in market capitalization, currently valued at about 4 billion USD. It is one of the projects I find very exciting because it bridges the real world and the blockchain world, providing a bridge for the real world to access the blockchain world. This not only elevates the project in the blockchain world but at least raises it half a level. Later, I will specifically decode what it has accomplished.

First, let me introduce this topic, which may be quite extensive. Chainlink was launched in 2017 and is now online on the Ethereum mainnet and staking protocols. ChainLink provides middleware that allows the blockchain's smart contracts to call external data, offering a comprehensive database across the network, or what can be referred to as a reliable external database.

Opening its official website, its slogan is to connect the world to the blockchain. Its goal is to connect people, businesses, and data to the Web3 world with industrialized Web3 service standards.

Next, let's take a look at its white paper, which is the longest white paper I have read so far, over 100 pages. Here we need to mention why there is such a thing as an oracle.

We know that the blockchain is a closed system because every transaction is initiated by nodes in the network and then written into the blockchain ledger. This is certainly not a problem since the blockchain is decentralized, and there are many nodes maintaining this ledger; of course, the POW mechanism has also cost many people a lot to maintain it, so there is no double spending, no breach of contract, etc. Therefore, there is no counterparty risk in blockchain 1.0, which is the risk of a counterparty running away or failing to fulfill the contract.

However, with blockchain 2.0, smart contracts emerged, which require data (e.g., flight departure information) to execute commands, but most real-world protocols and data are not stored on the blockchain. Smart contracts cannot access external data because the blockchain acts like a black box, lacking inherent connections to the outside world. This means that asset prices, sports scores, IoT sensor data, web data, enterprise systems, and many other real-world datasets cannot be utilized on the blockchain, severely limiting the types of smart contracts developers can create. For example, how can you formulate a flight insurance agreement without flight data? Or if you specify a delivery contract, and someone delivers goods to you, you receive the goods and the payment is automatically transferred to the other party’s account, but how does the smart contract determine if you received the goods? Smart contracts are programming code and cannot interact with the real world, meaning they cannot access off-chain data. Therefore, the emergence of smart contracts also brings in competitor risks.

Thus, there is a need for something called an oracle machine, which can write off-chain data into the blockchain. In addition to the most widely used price data, it also includes weather data, sports match data, stock market data, traffic data, and even data such as presidential election results.

In addition to providing data, the broader function of oracles also includes providing random numbers and acting as triggers for executing smart contracts. These functions are all considered off-chain tools for interacting with on-chain contracts.

However, oracles also have a problem: oracles can be centralized or decentralized. If it is a centralized oracle, there is a significant risk of single point of failure. Users deploying smart contracts on the blockchain intend to rely on many nodes in the blockchain network to ensure the security and fairness of the contract. Given this premise, for external data, the data the contract relies on is input through a centralized service, which reduces overall security. Moreover, this is also not very blockchain-like, as there is no difference from centralized systems. Additionally, if the centralized oracle encounters network failures, it can lead to business termination, user data loss, and other severe issues.

So now we need a decentralized oracle, and that is Chainlink.

Chainlink is a decentralized oracle network designed to allow smart contracts to automatically transfer data between the blockchain and external systems in a highly secure and reliable manner. There are many oracle nodes in the network, each oracle node can obtain data through its own channels and then achieve consensus on the data obtained in a decentralized network. The consensus mechanism here is not in the sense of BFT, POS, or POW, but to obtain reliable data, such as taking averages; or similar to sports competitions, excluding the highest and lowest scores, taking the average or median of the remaining scores. Currently, Chainlink adopts a median consensus approach.

Chainlink avoids the risk of single point of failure through a decentralized network of oracles. Just like Ethereum nodes, when one node goes down or exits, it does not affect the security and availability of the entire network. Additionally, due to the use of multiple data sources, the data cannot be manipulated by a single source, fully utilizing the advantages of decentralization.

ChainLink has three key components: on-chain oracles, off-chain oracles, and ChainLink nodes.

On-chain oracles in ChainLink are smart contracts that connect information requests with the appropriate off-chain oracles. These contracts are used to aggregate data, check the credibility of oracles, and match the correct requests.

Off-chain oracles are responsible for providing information to the blockchain. They are analogous to validators/miners in other blockchains. These oracles stake LINK to act as oracles and earn LINK as a reward for providing this service. ChainLink maintains the honesty of oracles by mutually verifying data and penalizing oracles for erroneous data. It also sends information requests to multiple validators to ensure accuracy.

Chainlink has currently launched data feeds, VRF (Verifiable Random Function), automated contract execution, and other services.

1. In Chainlink Data Feeds, different oracle nodes obtain price data through their own data providers and then aggregate multiple data through the oracle network. For example, for a token price, A node quotes $400, B node quotes $399, and C node quotes $401. After consensus of all the quotes, the oracle node will relay the price median of $400 to the smart contract on the chain to complete this price feed.

Data Feeds business process

The business process of data feeds involves two parties: the first is the data provider, which uses its own data or obtains relevant data through third parties, and then inputs it into a node in the Chainlink oracle network. The other party is the oracle node, where each node can have one or more data providers. The data input by each provider will reach consensus in the oracle network, and then a node is randomly selected from the network to submit the data on-chain.

Use case

The most common application scenario is lending protocols, such as AAVE on Ethereum, Compound, and Venus on BNB. When a user deposits a BTC in AAVE and borrows USD, AAVE needs to know the exchange rate between BTC and DAI to decide how much USD to lend to the user.

The second application scenario is synthetic assets, such as Synthetix (SNX), which allows users to trade some mainstream assets, such as US stocks. When users synthesize assets, the protocol needs to know the asset price, which is obtained through Data Feeds.

The third application scenario is collateralized stablecoins. To issue collateralized stablecoins, corresponding assets need to be pledged. The stablecoin protocol needs to obtain the asset prices through Data Feeds to calculate the total value of the pledged assets, which determines the issuance quantity of the stablecoins.

The fourth is asset management and derivatives trading platforms. Platforms for options and futures trading are very sensitive to prices and require stable and accurate price data, which the data provided by Data Feeds perfectly meets their business needs.

2. Chainlink Keepers is a decentralized contract execution service that can automate the execution of on-chain contracts.

Development teams can register an UpKeep, which will check the monitored contract status in each block. If it meets the preset conditions, it calls the function, and of course, no preset conditions can also be set (equivalent to the condition judgment result always being True), calling a specific function in the specific contract based on time.

Chainlink Keepers can continuously monitor the state of smart contracts based on preset logic without requiring input. If the conditions are met, it executes; if not, it waits for the next check.

Use case

The first application is automated compounding. Many DeFi applications pay interest to deposit users. If users do not withdraw, it is equivalent to simple interest, simply put, depositing for a year earns a year's worth of interest. If users periodically withdraw generated interest and re-deposit for compound investment, they can maximize their returns. This withdrawal and deposit operation is a fixed operation determined by time and can be completed through Keepers, such as Beefy, Alchemix, SNX, and other projects that accomplish this type of compounding investment through Keepers.

The second application is liquidation of collateralized platforms, such as AAVE and B-protocol. When the price of the collateral assets in the protocol falls below the warning line, the protocol needs to liquidate the collateral to avoid further losses. In this scenario, the checkUpKeep function can write the liquidation price for the collateral auction, and performUpKeep writes the specific liquidation logic. When checkUpKeep returns True, Keepers automatically execute the liquidation of the collateral assets in performUpKeep.

The third application is DEX limit orders. The automated market makers (AMM) used in DEXs differ from the order book model of centralized exchanges, and there is no way to place limit orders. If you want to use a limit order, you need to write your own logic to buy or sell when the token price is below a certain threshold, using Keepers to write the judgment logic in checkUpkeep and the execution logic in performUpkeep.

The fourth application is liquidity management and cross-chain NFT minting. For example, minting an NFT on Polygon (because gas fees on the Ethereum mainnet are relatively high), obtaining the ID or feature attributes (whether it is rare or not), this value can be written back to the mainnet through a relay to help users achieve cross-chain NFT minting.

The fifth application is dynamic NFTs. Its logic is that NFTs on the blockchain change with changes in relevant attributes in the real world. For example, a weather NFT displays rain when it rains outside, and a sun when it is very hot outside. Data is retrieved from external sources, and changes are made based on the data acquired, frequently utilizing Keepers.

3. Chainlink's third decentralized product is the Verifiable Random Function (VRF). Before VRF appeared, the mainstream method of generating random numbers was to generate a hash based on the transactions in the current block, using this hash as a seed to generate random numbers, which introduced problems. Miners can selectively package transactions to obtain the random numbers they want, and although the cost is relatively high, when the profit return is high, the potential for miners to engage in malicious behavior increases significantly. The generation of random numbers is also an uncertain operation, as random number generation is unpredictable. Therefore, different nodes, when executing and obtaining random number algorithms, will yield different results, leading to inconsistency in transaction execution outcomes and thus failing to reach consensus.

By inputting verifiable random numbers through external oracles, the on-chain smart contracts can only accept and verify random numbers, ensuring the consistency of transaction execution. It can also achieve unpredictability of random numbers and provide proof of their security.

In Chainlink VRF, random numbers are generated by the oracle network. Users input a seed to the VRF contract, and the oracle VRF node uses its private key and the seed to generate a random number and proof, returning it to the VRF contract. The VRF contract verifies the validity of the proof of the random number, and if validated, returns the random number to the user. Unlike purely off-chain generated random numbers, Chainlink VRF generates random numbers that can be proven through proof to be calculated based on a specific elliptic curve algorithm, ensuring verifiability and uniqueness.

Use case

The biggest application scenario for Chainlink VRF is NFT minting. NFTs need to be created and distributed, and each NFT has a different rarity when created, and different users are allocated. Depending on business needs, a whitelist may also need to be set up, where holders in the whitelist are airdropped different NFTs. For example, in the Bored Ape Yacht Club project, serum is airdropped to holders, and the random airdrop of the serum uses VRF randomness.

Another application is lotteries. For example, in some IDO platforms, users purchase tokens and then stake them, with the platform offering whitelist participation in lotteries, where the rewards can be selected using VRF.

ChainLink is one of the most exciting blockchains because it bridges the real world and the crypto world. This is an excellent solution, especially as we emphasize IoT, so with the development of IoT and the blockchain industry, there may be more blockchain applications in our society in the future, such as decentralized lottery systems, decentralized insurance businesses, and decentralized second-hand car transactions, etc. So this track is indeed worth paying attention to. If you have listened carefully to this episode, you should know what to do. That's all for this episode.