> For the complete documentation index, see [llms.txt](https://cll-devrel.gitbook.io/bootcamp-2024/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cll-devrel.gitbook.io/bootcamp-2024/8.-random-numbers-with-chainlink-vrf/introduction-to-chainlink-vrf.md).

# Introduction to Chainlink VRF

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.&#x20;

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&#x20;

**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.

{% embed url="<https://docs.chain.link/vrf>" %}
Chainlink VRF Documentation
{% endembed %}

{% hint style="info" %}

### <mark style="color:red;">Migration Warning</mark>

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:
{% endhint %}

{% embed url="<https://docs.chain.link/vrf/v2-5/migration-from-v2>" %}
VRF 2.0 -> 2.5 Migration Guide
{% endembed %}


---

# 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://cll-devrel.gitbook.io/bootcamp-2024/8.-random-numbers-with-chainlink-vrf/introduction-to-chainlink-vrf.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.
