> For the complete documentation index, see [llms.txt](https://gitbook.agorahub.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.agorahub.io/agoras-products/agoras-technology/random-number-generator-rng.md).

# Random Number Generator (RNG)

To ensure fairness and transparency in the distribution of rewards, Agora’s Loot Box System integrates with [ChainLink's Verifiable Random Function (VRF)](https://docs.chain.link/vrf/).&#x20;

The Loot Box System smart contract sources randomness from ChainLink VRF (Verifiable Random Function), a widely trusted oracle service that provides provably fair and verifiable random numbers. This ensures the integrity of random-based operations like lotteries or the distribution of digital assets in Loot Boxes.

The process begins when a request for randomness is sent from the Loot Box smart contract to the ChainLink VRF. The VRF then generates a random number and provides a cryptographic proof of the randomness, which is verifiable by anyone. This ensures that the process is tamper-proof and transparent, providing confidence in the fairness of the outcome. The random number is then used within the LootBox contract to determine the state transitions of the NFTs, such as from “Loot Box” state to “Gem” or “Golden Ticket”, and eventually to a Burned state after the prize allocation.

This system is part of what makes Agora's ecosystem trustworthy and secure, as it guarantees that the outcomes of each Loot Box campaign cannot be manipulated or predicted by any party, including the game developers themselves.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.agorahub.io/agoras-products/agoras-technology/random-number-generator-rng.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
