Chainlink Developer Documentation

repository·main·Indexed 19 days ago

https://github.com/smartcontractkit/documentation

Source for the official Chainlink developer documentation hosted at docs.chain.link. It provides resources for smart contract developers and node operators to integrate Chainlink's decentralized services, including the CCIP Directory API (v1) and CCIP Tools API (v2). The repository includes a versioning system for API references, SEO metadata implementation for search engine visibility, and tools for link checking.

Tokens
253.8K
Snippets
656
Records
1K
Agent score
68%

What's inside chainlink-docs

  1. Overview of AWS CRE Price Feeds & Proof of Reserves

    main

    This project demonstrates how to use the Chainlink Runtime Environment (CRE) to bridge AWS serverless APIs with Ethereum smart contracts. It combines AWS reliability with decentralized trust to enable:

    • Price feeds for DeFi protocols: Low-latency, tamper-resistant pricing data for lending, derivatives, and AMMs.
    • Proof-of-reserves monitoring: Continuous verification that stablecoins and wrapped assets are fully backed by underlying reserves.
    • Custom data feeds: Configurable, multi-source data feeds for tokenized assets.
  2. Overview of the Prediction Market Demo

    main
    The Prediction Market Demo is an end-to-end automated, AI-powered system built using the Chainlink Runtime Environment (CRE). It demonstrates how to create binary (Yes/No) prediction markets where users stake USDC, and CRE orchestrates a workflow that uses Google's Gemini AI to perform automated fact-checking and settle market outcomes on-chain. Settlement data is persisted in Firebase/Firestore for auditing and displayed via a Next.js frontend.
  3. Overview of the Giveaway Manager Quickstart

    main

    The Giveaway Manager is an intermediate-level proof of concept designed to demonstrate provably-fair giveaways using Chainlink Automation and VRF (Verifiable Random Function).

    It supports two primary giveaway modes:

    1. Static Giveaways: Transparently picks winners from a participant list provided in a CSV format. Participant IDs (such as emails or addresses) are hashed before being stored onchain to ensure privacy.
    2. Dynamic Giveaways: Allows participants to register themselves onchain via transactions over a set period. Winners are then selected using VRF Direct Funding.

    Note: This application demonstrates the selection process only; fulfillment of prizes is not included. The provided code is an un-audited template intended for educational purposes and should not be used in production without independent audits.

  4. Overview of Chainlink Data Feeds on Solana

    main

    Chainlink provides data feeds on the Solana network using Offchain Reporting (OCR) to aggregate data from multiple providers.

    Key Architectural Differences: Unlike EVM-based chains, Solana separates storage (Accounts) from logic (Programs). A Solana 'Program' is stateless and contains the logic, while 'Accounts' store the state. To use Chainlink products, your program must be deployed on a supported Solana cluster.

    Performance Note: Price Feed performance is dependent on the underlying blockchain. High network congestion may impact the frequency of updates. Monitor Solana status for system performance updates.

  5. Overview of VRF Subscription Balance Monitor

    main

    The VRF Subscription Balance Monitor is a quickstart tutorial designed to show how to automate the process of funding Chainlink VRF subscription balances. By using Chainlink Automation, you can deploy a manager contract that monitors multiple VRF subscriptions and automatically tops them up with LINK when they fall below a certain threshold, ensuring continuous availability for randomness requests.

    Key Details:

    • Products used: Chainlink Automation, Chainlink VRF
    • Difficulty: Intermediate
    • Estimated time: 30 minutes
    • Prerequisites: A wallet with gas tokens (ETH) and ERC-677 LINK.
    • Core Functionality: Monitors existing VRF subscriptions and performs top-ups only when necessary (e.g., when a subscription is underfunded).
  6. Overview of the Tokenized Asset Servicing Template

    main

    This template demonstrates how to use the Chainlink Runtime Environment (CRE) to orchestrate off-chain data for tokenized real-world assets (RWAs). It integrates CRE's LogTrigger and HTTP Ability to bridge on-chain Ethereum events with off-chain AWS services.

    Core Workflow

    1. On-Chain: An Ethereum smart contract manages asset lifecycles (Register, Verify, Transfer, Redeem).
    2. Event Capture: LogTrigger captures events emitted by the smart contract.
    3. Data Transformation: Extracted event data is parsed and converted into a structured HTTP payload.
    4. Off-Chain Dispatch: The HTTP Ability sends this payload via a RESTful API request to an AWS Lambda function.
    5. Persistence: The Lambda function stores the processed asset data in an AWS DynamoDB table.

    This architecture allows regulators, auditors, and investors to query asset states via off-chain storage without relying on inefficient direct blockchain queries.

  7. Prerequisites for Passing VRF Costs to End Users

    main

    Before implementing the VRF direct funding method, ensure you have the following tools and credentials ready:

    • Foundry: Installed via foundryup.
    • make: Installed on your OS.
    • git: Verified via git --version.
    • Etherscan API Key: Required for contract verification. Create an account and key at Etherscan.
    • RPC Endpoint: An account with Infura or Alchemy, or your own testnet client.
    • Wallet: Must contain gas tokens and ERC-677 LINK.
  8. Verify Data Streams reports on Solana

    main

    To ensure data integrity, you must confirm that a Data Streams report is signed by the Decentralized Oracle Network (DON). On Solana, there are two primary integration patterns:

    1. Onchain integration: Verify reports directly within your Solana program by using Cross-Program Invocation (CPI) to call the Chainlink Verifier program. This is the method covered in this tutorial.
    2. Offchain integration: Verify reports client-side using an SDK. This is suitable for applications where verification does not need to happen within a smart contract execution.

    Both methods provide the same security guarantees and use the same underlying verification logic; the only difference is the execution environment (onchain vs. offchain).

  9. Understand the Chainlink Local documentation structure

    main

    The API documentation for each version of Chainlink Local is organized into several key functional areas. When navigating the documentation, you can find detailed information regarding:

    • CCIP Components: Documentation for the Router and Simulator.
    • Data Feed Contracts: Details on available data feed implementations.
    • Token Implementations: Information on how tokens are handled within the framework.
    • JavaScript Utilities: Helper functions and tools for JS-based testing.
    • Testing Helpers: Specialized utilities to assist in writing tests.
  10. Component Overview for Production Cross-Chain Tokens

    main

    The production implementation consists of the following components across two different blockchain environments:

    • Ethereum Sepolia: Deploys an ERC20 token paired with a CCIP BurnMint pool. In this tutorial, the authority is EOA-controlled.
    • Solana Devnet: Deploys an SPL token utilizing dual-layer governance via Squads and SPL multisig.
    • Cross-Chain Transfer: Enables bidirectional token transfers through autonomous operations managed by the Pool Signer PDA.
  11. What is Chainlink CCIP?

    main

    Chainlink Cross-Chain Interoperability Protocol (CCIP) is a secure protocol that enables developers to build applications capable of transferring tokens, arbitrary data (messages), or both across different blockchains.

    CCIP is designed with a defense-in-depth security model including:

    • Decentralized Architecture: Uses multiple Decentralized Oracle Networks (DONs).
    • Rate Limiting: Allows owners to configure and enforce policies for Cross-Chain Tokens on both source and destination chains to mitigate risk.
    • Timelocked Upgrades: Security-critical changes must pass through a Role-based Access Control Timelock contract, allowing a review/veto period.
    • Sybil-Resistant Node Operators: Secured by globally distributed, independent organizations.
  12. What is the Cross-Chain Token (CCT) standard?

    main

    The Cross-Chain Token (CCT) standard is a framework within Chainlink's Cross-Chain Interoperability Protocol (CCIP) that enables seamless token transfers across multiple blockchains.

    Key benefits include:

    • Self-service Deployment: Developers can deploy and manage token pools in minutes via a simple interface.
    • Zero-Slippage Transfers: The amount of tokens sent via the CCIP OnRamp on the source chain is exactly the amount received via the CCIP OffRamp on the destination chain.
    • No Liquidity Pools Required: Instead of managing fragmented liquidity pools, CCT uses audited token pool contracts to handle burn/mint or lock/mint mechanisms.
    • Programmable Transfers: Supports simultaneous token and message transfers in a single transaction (e.g., transferring tokens and immediately staking them on the destination chain).
    • Security: Leverages Chainlink oracle networks and configurable transfer rate limits for defense-in-depth.