What is a "Blockchain Oracle"? What role does Chainlink play in it?

直子 真綾
直子 真綾
Computer science student passionate about Ethereum's future; 热爱以太坊未来的计算机科学学生。

Okay, no problem! Let's talk about this topic in plain language.


What is a Blockchain "Oracle"? What Role Does Chainlink Play?

Hey there! I see you're interested in this topic – it's a super important concept in the blockchain world. Don't be intimidated by the mystical-sounding name "oracle"; its principle is actually quite simple.

I. First, Let's Talk About the Isolation of Smart Contracts

To understand oracles, we first need to know what a Smart Contract is.

You can imagine a smart contract as an absolutely reliable "vending machine" sitting on the blockchain. As long as you insert the correct amount of money (meet the contract's conditions), it will definitely dispense the drink you want (execute the contract's terms). The entire process is automated; no one can cheat, and no one can interfere.

For example, we could write a smart contract for a football match bet:

"If Team A beats Team B, the bet money is automatically sent to Xiao Ming; if Team B wins, the money is automatically sent to Xiao Hong."

Once this contract is written and placed on a blockchain like Ethereum, no one can change it.

But here's the problem: This "vending machine" is "blind" and "deaf." It's sealed within the enclosed world of the blockchain, completely unaware of what's happening in the real world outside. How would it know whether Team A or Team B won? It can't watch TV, nor can it check sports websites for scores.

This is the isolation of smart contracts: they cannot actively obtain data from outside the blockchain.

II. Oracle: The "Messenger" for Smart Contracts

To cure smart contracts of their "isolation," the Oracle was born.

Simply put, an oracle is a bridge, or a messenger. Its sole job is to securely and accurately feed real-world data to smart contracts on the blockchain.

Continuing with the example above:

  1. The betting smart contract needs to know the match result.
  2. It will then send a request to an "oracle": "Hey, tell me the result of the match between Team A and Team B!"
  3. Upon receiving the request, the oracle goes to real-world sports websites (like ESPN, Sina Sports) to query the score.
  4. After finding the result, the oracle then relays this result (e.g., "Team A won") back to the smart contract on the blockchain.
  5. With this confirmed data, the smart contract has the basis for execution, and "ding," it automatically sends the betting money to Xiao Ming.