Search⌘ K
AI Features

The Chainlink Verified Random Function

Explore how Chainlink's Verifiable Random Function (VRF) provides secure and tamper-proof randomness for hybrid smart contracts on Ethereum. Understand the challenges of generating random numbers on-chain and learn the steps to create and fund a Chainlink VRF subscription, enabling your Play-to-Earn games to use verified randomness in gameplay.

Off-chain oracles

Smart contract transactions must be deterministic—Ethereum has that one limitation. Every node in the Ethereum network must be able to reproduce every operation in a transaction in order to validate it. This feature, which guarantees the integrity and decentralization of the blockchain, also poses two practical difficulties:

  • Smart contracts can't generate random numbers because validator nodes wouldn't be able to generate the same numbers.

  • They can't access off-chain data because validator nodes wouldn't necessarily be able to access the same version of these data.

But then, what if we need to get data from the outside world in our smart contract? Let's say a random number from 1 to 6 for an on-chain game of dice or the current ETH / USD exchange rate for a DeFi application. The solution is to use off-chain oracles. Oracles are off-chain services that are able to securely receive and fulfill data requests for smart ...