The Chainlink Verified Random Function
Learn about how to securely generate random numbers for smart contracts.
We'll cover the following...
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 ...