0Pricing
Web3 & DApp Development Fundamentals · 강의

Chainlink 기초

탈중앙화 오라클 네트워크인 Chainlink의 아키텍처와 스마트 계약에 신뢰할 수 있는 데이터 피드를 제공하는 방식을 배웁니다.

Chainlink 기초은(는) CoddyKit의 무료 Web3 & DApp Development Fundamentals 강의입니다. 이것은 3개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Web3 & DApp Development Fundamentals 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Web3 & DApp Development Fundamentals 강의에는 총 3개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Bridging On-Chain and Off-Chain Worlds

Welcome! In the previous lesson, we learned about the "oracle problem" – how smart contracts on blockchains are isolated and can't access real-world data directly. This is where Chainlink comes in!

Chainlink is a decentralized oracle network that acts as a secure bridge, connecting smart contracts to external data, APIs, and traditional payment systems.

Why Blockchains Need External Data

Remember, blockchains are designed to be secure and deterministic. This means they can't natively "look up" information from the internet, like the current price of Bitcoin, weather data, or election results.

  • Smart contracts need external data to make informed decisions.
  • Without a reliable bridge, DApps would be very limited.

The Power of Decentralized Oracles

An oracle is essentially a data feed that brings information from the outside world onto the blockchain. But a single oracle can be a single point of failure or manipulation.

Chainlink solves this by being a decentralized oracle network. Instead of one source, it uses many independent data providers and validators to ensure data integrity and reliability.

How Chainlink Connects Everything

Chainlink's architecture involves several key components working together:

  • Data Providers: Sources of off-chain information (e.g., exchanges, weather APIs).
  • Chainlink Nodes: Independent operators that fetch data and deliver it to blockchains.
  • Requesting Contracts: Smart contracts that ask for data.
  • Aggregators: Contracts that combine data from multiple nodes.

The Backbone: Chainlink Nodes

Think of Chainlink Nodes as the workers of the network. These are independent servers run by various operators around the world.

Their job is to:

  • Listen for data requests from smart contracts.
  • Fetch the requested data from specified off-chain sources.
  • Format the data and send it back to the blockchain.

They are incentivized to provide accurate data.

Ensuring Trustworthy Data

To prevent a single node from providing incorrect data, Chainlink employs data aggregation. When a smart contract requests data, it often receives responses from multiple Chainlink nodes.

These responses are then aggregated (e.g., by taking the median) to produce a single, highly reliable data point. This makes the data tamper-proof and robust.

Fueling the Network: The LINK Token

The LINK token is the native cryptocurrency of the Chainlink network. It plays a crucial role in its operation:

  • Payment: Smart contracts pay Chainlink node operators in LINK for their data services.
  • Staking: Node operators can stake LINK as collateral, providing a financial incentive to behave honestly.

It's the economic engine that secures the network.

Essential Data: Chainlink Price Feeds

One of Chainlink's most widely used applications is its Price Feeds. These provide highly reliable and decentralized price data for cryptocurrencies, commodities, and more.

Decentralized Finance (DeFi) applications heavily rely on these feeds for:

  • Accurate asset valuation.
  • Calculating loan collateral.
  • Executing liquidations.

Reading Price Data in Solidity

Smart contracts can easily consume data from Chainlink Price Feeds. Here's a simplified example of a Solidity contract reading the latest ETH/USD price from an existing feed.

This contract uses an interface to interact with a deployed Chainlink Aggregator contract.

pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract PriceConsumerV3 {
    AggregatorV3Interface internal priceFeed;

    constructor() {
        // Rinkeby ETH/USD Price Feed address (example)
        // (Use appropriate address for your network)
        priceFeed = AggregatorV3Interface(
            0x8A753747A1Fa494EC906cE90E9f37563A8dC4C99
        );
    }

    function getLatestPrice() public view returns (int) {
        (
            uint80 roundID,
            int price,
            uint startedAt,
            uint timeStamp,
            uint80 answeredInRound
        ) = priceFeed.latestRoundData();
        return price;
    }
}

Chainlink's Core Function

Chainlink is crucial for enabling smart contracts to interact with the real world securely and reliably. Let's test your understanding.

Summary: Connecting Blockchains to Reality

Great job! In this lesson, you've gained a fundamental understanding of Chainlink and its vital role in the Web3 ecosystem.

  • Chainlink solves the "oracle problem" by connecting smart contracts to real-world data.
  • It uses a network of decentralized nodes and data aggregation to ensure data reliability.
  • The LINK token incentivizes node operators and secures the network.
  • Chainlink Price Feeds are a key application, providing essential data for DeFi.

Next, we'll dive into how to fetch this off-chain data in more detail!

자주 묻는 질문

“Chainlink 기초” 강의는 무료인가요?

네 — “Chainlink 기초” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Web3 & DApp Development Fundamentals 강의 전체를 잠금 해제할 수 있습니다. Web3 & DApp Development Fundamentals 강의에는 총 3개의 강의가 포함되어 있습니다.

“Chainlink 기초”에서 뭘 배우나요?

탈중앙화 오라클 네트워크인 Chainlink의 아키텍처와 스마트 계약에 신뢰할 수 있는 데이터 피드를 제공하는 방식을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Web3 & DApp Development Fundamentals을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Web3 & DApp Development Fundamentals을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Web3 & DApp Development Fundamentals은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 3개 중 2번째 강의입니다.

“Chainlink 기초” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Web3 & DApp Development Fundamentals 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Web3 & DApp Development Fundamentals 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 오라클 문제
  2. Chainlink 기초
  3. 오프체인 데이터 가져오기
← Web3 & DApp Development Fundamentals(으)로 돌아가기