♈
Bootcamp-2024
  • Intro
  • 1. Blockchain & Wallet Fundamentals
    • Blockchain Introduction
    • State Machines
    • Cryptography
    • Distributed Networks
    • Game Theory
    • What is Web3
    • MetaMask Wallet Installation
    • Transferring Tokens with MetaMask
  • 2. Smart Contract & Solidity Fundamentals
    • Using Remix
    • Create, compile and publish your first smart contract
    • Interact with already published smart contracts
    • Blockchain Explorer
    • Verify source code on Etherscan
  • 3. Oracles, ERC20 & Chainlink Data Feeds
    • Oracles
    • Create & Deploy ERC20
    • Data Feeds
  • 4. Cross-Chain Tokens With Chainlink CCIP
    • Setting up MetaMask
    • Getting USDC Testnet Tokens
    • Create Smart Contract In Remix
    • Compile and Deploy
    • Approve USDC
    • Send LINK to your Contract
    • Send USDC from Fuji to Sepolia
    • USDC on Sepolia
  • 5. Mentoring Session
  • 6. NFTs & Chainlink Automation
    • NFT Basics
    • Dynamic NFTs
    • Creating an NFT Smart Contract
    • Deploying Your Dynamic NFTs
  • 7. Chainlink CCIP & Cross-Chain NFT dApps
    • Create and deploy CCIP NFT Contracts
    • Mint on Source Chain
    • Fund Contract
    • Mint On Sepolia From Fuji
    • Mint from Destination 2 - Base Sepolia
  • 8. Random Numbers with Chainlink VRF
    • Introduction to Chainlink VRF
    • Hands On Game Using VRF
  • 9. Off-Chain Data with Chainlink Functions
    • Chainlink Functions Playground
    • Setting up MetaMask
    • Remix
    • Functions Subscription
    • Creating The Functions Consumer Contract
    • Sending a Request from Remix
    • City Weather and Examples
    • City Weather on Chainlink Functions
  • 10. Connecting the 🌏 with Chainlink
  • Glossary
Powered by GitBook
On this page
  1. 8. Random Numbers with Chainlink VRF

Introduction to Chainlink VRF

Previous8. Random Numbers with Chainlink VRFNextHands On Game Using VRF

Last updated 1 year ago

Before diving into Chainlink VRF, it is important to understand why achieving randomness on-chain is very difficult and where VRF plays a part in achieving this.

Why is it hard to get randomness with smart contracts?

Blockchains are deterministic meaning that the output of any given input is always the same. This means that generating randomness on-chain is very difficult.

As the output from on-chain randomness is predictable, smart contracts utilising this method of randomness are prone to manipulation. This allows validator nodes or participants to 'game' outcomes by controlling or initiating transactions in their favour, undermining the integrity and fairness of decentralised applications.

Chainlink VRF

Chainlink VRF (Verifiable Random Function) is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability.

Migration Warning

The next exercise uses Chainlink VRF 2.0, however Chainlink VRF 2.5 has since been released which has introduced some minor changes that need to implemented. Please refer the following migration guide for more details on these changes:

Generate Random Numbers for Smart Contracts using Chainlink VRF | Chainlink DocumentationChainlink Documentation
Chainlink VRF Documentation
Blockchain Oracles for Connected Smart Contracts | Chainlink DocumentationChainlink Documentation
VRF 2.0 -> 2.5 Migration Guide
Logo
Logo