How Chainlink VRF works

Hi, team!

I have a few questions about the current VRF architecture (I’m doing a lecture about it).

When an event occurs with a request to provide VRF, the Chainlink infrastructure handles it.

Question 1: Do I understand correctly that this is not a single Chainlink node, but a DON consisting of several Chainlink nodes? Who are the participants of this “VRF network”?

Does one network of DONs is responsible for generating VRF for all users? Or a separate DON for each supported blockchain? How many nodes are in DONs? How can I see their list or get into the number of network members? Is the fees divided evenly among DON members?

Question 2: What happens when a DON receives an event? I couldn’t find a step-by-step description anywhere.

As I imagine this process now, a DON consisting of multiple Chainlink nodes starts to work on generating randomness for each individual request:

Step 1. Each DON node parses the source block of the network and pulls from it the events corresponding to the VRF requests.

Step 2. The nodes for this call create a “room” whose identifier is, for example, the hash of the received event.

Question: what actions do the DON nodes, responsible for VRF, take after they get one of the requests? We have a lot of VRF requests that might be in one block, how does this work in parallel?

Step 3. The nodes within the room select the member (how?) who generates the VRF value using their private signature and a proof that shows that the VRF generation was done exactly using the given instance and is honestly signed with the private key.

Step 4. The selected participant sends the generated number and proof for verification.

Step 5. If all is well, a node is selected from the DON members, which pushes the call with the VRF value and the generated proof to the Coordinator smart contact for verification.

This is my perception and I realize that it is not correct, so I am writing here :slightly_smiling_face:

Thanks in advance!


In general, a Chainlink node is a piece of software that allows you to access and interact with the Chainlink network. The Chainlink network is a decentralized network of nodes that are run by various participants, who are often referred to as “node operators.” These node operators are responsible for maintaining the functionality of the Chainlink network and ensuring that it is secure and reliable. They may also provide services, such as data feeds or oracle services, to users of the network. It is possible for a single node operator to run multiple Chainlink nodes, or for a group of node operators to work together to run a group of nodes.

How Chainlink VRF works

Chainlink VRF (Verifiable Random Function) is a decentralized, verifiable random number generator that allows smart contracts to securely generate random numbers on the blockchain. This is useful for applications that require a secure and unbiased source of randomness, such as games, lotteries, and other applications that rely on randomly generated outcomes.

The Chainlink VRF works by allowing a smart contract to request a random number from a Chainlink node. The node operator running the Chainlink node will then use the VRF to generate a random number and provide it to the smart contract. The VRF uses a combination of a deterministic algorithm and a private key to generate the random number, which allows the node operator to prove to the smart contract that the number was indeed generated randomly and fairly.

The smart contract can then use the random number to determine the outcome of an event, such as the winner of a game or the result of a lottery. Because the VRF is decentralized and verifiable, users of the smart contract can trust that the random number was generated fairly and securely, without any risk of bias or manipulation.

Chainlink Verifiable Random Function (VRF) is a type of secure randomness generation service provided by Chainlink, a decentralized oracle network. In a VRF, a prover generates a random value and provides a proof of the value’s generation to a verifier. The proof allows the verifier to confirm that the value was indeed generated randomly and not manipulated by the prover.

In the case of Chainlink VRF, a network of decentralized oracles called “Decentralized Oracle Nodes” (DONs) are responsible for generating and providing proof of the generation of the random values. The DONs are operated by independent node operators who are incentivized to provide reliable and secure services. When a request for a random value is made, multiple DONs are selected to participate in the VRF process, and the resulting random value is determined based on the collective output of these DONs. This decentralized design helps to ensure the security and integrity of the VRF process.

The Chainlink Verifiable Random Function (VRF) network is a decentralized network that provides a secure and verifiable source of randomness. It consists of a group of nodes that run the Chainlink VRF software and participate in the network by creating and verifying cryptographic proofs of randomness. These nodes are operated by a variety of different entities, including individuals, organizations, and companies. Some nodes may be operated by Chainlink itself, while others may be operated by third parties that have been vetted and approved to join the network. To participate in the Chainlink VRF network, a node must meet certain technical and operational requirements and must be able to demonstrate the ability to provide high-quality and secure randomness.

When a Chainlink External Adapter (DON) receives an event, it is triggered to perform a specific action, such as retrieving data from an API or executing a function on a smart contract. This action is typically specified in the contract that is calling the DON.

For example, if a smart contract has a function that is designed to retrieve the current price of a cryptocurrency from an API, it might use a DON to fetch the data and return it to the contract. When the contract calls this function, the DON would receive an event that triggers it to fetch the data from the API and return it to the contract.

Chainlink’s decentralized oracle networks (DONs) are a collection of independent nodes that are connected to the Chainlink network. These nodes are responsible for executing the tasks assigned to them by smart contracts and returning the results to the contracts. When a DON receives an event, it processes the request and returns the result to the contract that called it.


Use Cases of Chainlink VRF

  • Unbias Gaming Outcomes
    Users get the lottery smart contract, which proves that the winners are selected with only random data. This random data can be verified by people on-chain. Users get the assurance and surety to involve themselves in the smart contract and have confidence in the fact that they enjoy a winning probability. For instance, Pooltogether is a capital verified deposit lottery game on Ethereum. It is a principal secured savings game, which collects the user’s deposits together, initiates a lottery daily or every week, and pays the deposit interest as a bonus to the winner. The game encourages users’ saving behavior through a lottery mechanism.
    Pooltogether takes the assistance of chainlink VRF to create verifiable random numbers, which can demonstrate to its users that each issue’s winners are chosen by absolute random numbers. Along with their security assurance, it also ensures to users that the key hints and the security of the key links are traceable, and the process of random number generation can be checked thoroughly.

  • Secure NFT Distribution
    You can use chainlink VRF to reward distinct non-fungible tokens and ascertain the crate contents for the selling items with the help of your supply schedule. This will also allow the players to get an access to the auditable proof supporting their NFT backed assets’ creation done with tamper-proof randomness.
    For instance, Wildcards have used Chainlink VRF to enrich the randomness experience in their ecosystem to become the epitome of animal conservation worldwide.

  • Engaging Player Experiences
    With the help of Chainlink VRF, you can also increase the experience of uncertain environments and unpredictable scenarios. Yet you will be able to fetch out the compatible mix in strategy and fun to ascertain the outcomes in battles of PvP and other dynamic scenarios.
    For instance, Facegolf uses the Chainlink VRF to get a randomness solution that is secure and on-chain. With this, they avoid the expose of their future users to all sorts of malicious activities that they had faced in the past.

1 Like

What is ChainLink?

ChainLink was introduced in 2019 as a decentralized oracle network that connects smart contracts to off-chain resources, including as other blockchains, active payment gateways, cloud infrastructure, data APIs, and so on. As a result, it may supply actual data from the real world to blockchain smart contracts.

How does ChainLink work?

It’s critical to realize that smart contracts on the blockchain are effectively pre-written agreements that take effect automatically when specific criteria are met. They can be trusted by all parties since they are unchangeable and verifiable. But when dealing with off-chain data, how can one develop smart contracts? ChainLink aids in locating a solution to this issue. Oracles, a type of middleware that gives smart contracts access to actual data, are used in this system.

But the main benefit that ChainLink provides is that it is a decentralized network of oracles, which means that it is more dependable because it does not rely on a single centralized oracle. The ChainLink’s three guiding principles

  1. Resource distribution for data
  2. Oracle distribution
  3. Using reliable hardware

The LINK Token

The LINK cryptocurrency coin belongs to ChainLink. It was introduced in 2017, and this year has experienced an incredible surge. A large portion of this can be credited to ChainLink’s rising fame and the numerous relationships it has forged. It is ranked #8 in terms of market capitalization as of October 2020.


With the help of this ambitious initiative, it is now simpler to access real-world data such as stock prices, biometric sensor data, IoT sensory, scores, etc. It has grown to be a top project for decentralized oracles for smart contracts with applications in banking, trading, insurance, satellite images, gaming, and business.

How does Chainlink’s VRF work?

A safe method of producing random numbers that can be used in smart contracts is the Chainlink Verified Random Function (VRF). A blockchain is used to confirm the unpredictability of the generated numbers.

The VRF creates a random number by using a seed number, the block number, and other information from the blockchain. The blockchain then confirms this number to be sure it was produced randomly. The VRF can be used for any purpose that calls for a safe, verified source of randomness, including generating random numbers for smart contracts.

Metagiverse employs the VRF technology.


Hello @Alexander_Alekhin You have a good understanding of the basic process of how a decentralized oracle network (DON) handles requests for verifiable random function (VRF) on the Chainlink network. However, some of the details of your explanation may not be entirely accurate.

Answer 1: A DON on Chainlink network is a decentralized network of independent oracle nodes that provides decentralized and secure data feeds to smart contracts on the blockchain. A VRF network is similar to other DONs , it is also a collection of independent oracle nodes that provide VRF service. Participants of a VRF network are oracle operators who stake their link token and run the node, also external parties who use the VRF service.

There is one network of DONs that is responsible for providing VRF to all users, however, different networks can be created and used on different blockchain. Number of nodes in a DON can vary, for VRF is a new feature on Chainlink the number of nodes is still growing. For a list of the network members, you can refer to the explorer, which list all the active nodes, however these are not user-friendly way to check the number of nodes . The fees for the VRF service is divided among the DON members, the fees is taken from the requester and is split among the nodes based on their participation in providing the VRF service.

Answer 2: When a DON receives an event, the process is as follows:

  1. Each oracle node on the DON monitors the blockchain for new events or requests for VRF
  2. Once an event is detected, the oracle node verifies that it is a valid request and parses the request data.
  3. The oracle node then performs the VRF function and generates a random value along with a proof of the generation, using the VRF algorithm and the input data from the request.
  4. The oracle node then sends the value and proof back to the smart contract that made the request.
  5. The smart contract then verifies the proof and uses the random value in its logic.

The process happens in parallel, with different oracle nodes processing different VRF requests at the same time, and then returning their results to the smart contract.

Note that in this step by step explanation doesn’t mention the “room” concept, and there isn’t a specific node that selects a member from the DON to generate the VRF value. All nodes are capable of doing so and are selected randomly by the smart contract when it receives multiple VRF responses, making the process truly decentralized.