Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/cre/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Use `go/llms-full.txt` or `ts/llms-full.txt` only when broad CRE context is requ
- [Triggers](https://docs.chain.link/cre/capabilities/triggers.md)
- [HTTP](https://docs.chain.link/cre/capabilities/http.md)
- [EVM Read and Write](https://docs.chain.link/cre/capabilities/evm-read-write.md)
- [Solana Read and Write](https://docs.chain.link/cre/capabilities/solana-read-write.md)
- [Confidential HTTP (Go)](https://docs.chain.link/cre/capabilities/confidential-http-go.md)
- [Confidential HTTP (TypeScript)](https://docs.chain.link/cre/capabilities/confidential-http-ts.md)

Expand All @@ -41,6 +42,8 @@ Use `go/llms-full.txt` or `ts/llms-full.txt` only when broad CRE context is requ
- [Using Confidential HTTP Client](https://docs.chain.link/cre/guides/workflow/using-confidential-http-client.md)
- [Using EVM Client (Go)](https://docs.chain.link/cre/guides/workflow/using-evm-client/overview-go.md)
- [Using EVM Client (TypeScript)](https://docs.chain.link/cre/guides/workflow/using-evm-client/overview-ts.md)
- [Using Solana Client (Go)](https://docs.chain.link/cre/guides/workflow/using-solana-client/overview-go.md)
- [Using Solana Client (TypeScript)](https://docs.chain.link/cre/guides/workflow/using-solana-client/overview-ts.md)
- [Secrets](https://docs.chain.link/cre/guides/workflow/secrets.md)
- [Using Randomness](https://docs.chain.link/cre/guides/workflow/using-randomness.md)

Expand Down
9 changes: 3 additions & 6 deletions src/content/vrf/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import { Aside } from "@components"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"

<VrfDeprecation version="v2-5" />

<Vrf2_5Common callout="security" />

**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. For each request, Chainlink VRF generates one or more random values and cryptographic proof of how those values were determined. The proof is published and verified onchain before any consuming applications can use it. This process helps ensure that results cannot be tampered with or manipulated by any single entity including oracle operators, smart contract developers, users, miners, or block builders\*.

\*In the unlikely event that an adversary compromises VRF's randomness-generating secret key and obtains the ability to construct blocks on the target chain, they could strongly bias the result.

<Aside type="note" title="Migrate to V2.5">
Follow the [migration guide](/vrf/v2-5/migration-from-v2) to learn how VRF has changed in V2.5 and to get example
code.
</Aside>

Use Chainlink VRF to build reliable smart contracts for any applications that rely on unpredictable outcomes:

- Building blockchain games and NFTs.
Expand Down
166 changes: 157 additions & 9 deletions src/content/vrf/llms-full.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/arbitrum-cost-estimation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ metadata:
isMdx: true
---

import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Tabs, TabsContent } from "@components/Tabs"

<VrfDeprecation version="v2-5" />

The total transaction costs for using Arbitrum involve both L2 gas costs and L1 costs. Arbitrum transactions are [posted in batches to L1 Ethereum](https://developer.arbitrum.io/inside-arbitrum-nitro/#how-the-sequencer-publishes-the-sequence), which incurs an L1 cost. For an individual transaction, the total cost includes part of the L1 cost incurred to post the batch that included the transaction.

To learn how to estimate gas costs for Arbitrum, refer to the [Arbitrum gas estimation tutorial](https://developer.arbitrum.io/devs-how-tos/how-to-estimate-gas) and the full [Arbitrum gas estimation script](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/gas-estimation) using their SDK. There is also a [**version of Arbitrum's gas estimation script extended to include VRF calculations**](#arbitrum-and-vrf-gas-estimation-code).
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { CodeSample } from "@components"

<VrfDeprecation version="v2-5" />

<Vrf2_5Common callout="security" />

These are example best practices for using Chainlink VRF. To explore more applications of VRF, refer to our [blog](https://blog.chain.link/).
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/billing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ metadata:
isMdx: true
---

import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { CodeSample } from "@components"
import { TabsContent } from "@components/Tabs"

<VrfDeprecation version="v2-5" />

This guide explains how to estimate VRF 2.5 costs for both the subscription and direct funding methods.

## Understanding transaction costs
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/direct-funding/get-a-random-number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Aside, CodeSample } from "@components"
import { TabsContent } from "@components/Tabs"

<VrfDeprecation version="v2-5" />

This guide explains how to get random values using a simple contract to request and receive random values from Chainlink VRF v2.5 without managing a subscription. To explore more applications of VRF, refer to our [blog](https://blog.chain.link/).

## Requirements
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ metadata:
image: "/files/2a242f1-link.png"
---

import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Aside, CodeSample, ClickToZoom } from "@components"

<VrfDeprecation version="v2-5" />

<Aside type="note" title="Requirements">
This guide assumes that you have basic knowledge about writing and deploying smart contracts. If you are new to smart
contract development, learn how to [Deploy Your First Smart Contract](/quickstarts/deploy-your-first-contract) before
Expand Down
9 changes: 7 additions & 2 deletions src/content/vrf/v2-5/migration-from-v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import { Aside, CodeSample } from "@components"
import { Tabs, TabsContent } from "@components/Tabs"

<Aside type="caution" title="Chainlink VRF v1 is deprecated">
Security fixes for VRF v1 are not guaranteed. Complete this guide to migrate your application to Chainlink VRF v2.5.
<Aside type="danger" title="Chainlink VRF v1 shuts down on November 18, 2026">
VRF v1 was deprecated on November 29, 2024 and will be permanently shut down on November 18, 2026. After this date,
VRF v1 will no longer fulfill randomness requests. Complete this guide to migrate your application to Chainlink VRF
v2.5 before November 18, 2026 to avoid service disruption.

If you have questions about this shutdown or need help with your migration, reach out to your Chainlink
representative.

_Continued use of VRF v1 is at your own risk. Use of the Chainlink Network is subject to the [Chainlink Foundation Terms of Service](https://chain.link/terms), which provides important information and disclosures._

Expand Down
9 changes: 7 additions & 2 deletions src/content/vrf/v2-5/migration-from-v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import { Aside, CodeSample } from "@components"
import { Tabs, TabsContent } from "@components/Tabs"

<Aside type="caution" title="Chainlink VRF v2 is deprecated">
Security fixes for VRF v2 are not guaranteed. Complete this guide to migrate your application to Chainlink VRF v2.5.
<Aside type="danger" title="Chainlink VRF v2 shuts down on November 30, 2026">
VRF v2 was deprecated on November 29, 2024 and will be permanently shut down on November 30, 2026. A 48-hour
brownout is scheduled for October 28-30, 2026, during which VRF v2 will not fulfill randomness requests. Complete
this guide to migrate your application to Chainlink VRF v2.5 before November 30, 2026 to avoid service disruption.

If you have questions about this shutdown or need help with your migration, reach out to your Chainlink
representative.

_Continued use of VRF v2 is at your own risk. Use of the Chainlink Network is subject to the [Chainlink Foundation Terms of Service](https://chain.link/terms), which provides important information and disclosures._

Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/overview/direct-funding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ metadata:
---

import VrfCommon from "@features/vrf/v2/common/VrfCommon.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Aside, ClickToZoom } from "@components"

<VrfDeprecation version="v2-5" />

This guide explains how to generate random numbers using the _direct funding_ method. This method doesn't require a subscription and is optimal for one-off requests for randomness. This method also works best for applications where your end-users must pay the fees for VRF because the cost of the request is determined at request time.

<Aside type="note" title="Migrate to V2.5">
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/overview/subscription.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Aside, ClickToZoom } from "@components"
import { TabsContent } from "@components/Tabs"
import { YouTube } from "@astro-community/astro-embed-youtube"

<VrfDeprecation version="v2-5" />

<Vrf2_5Common callout="security" />

This section explains how to generate random numbers using the subscription method.
Expand Down
4 changes: 4 additions & 0 deletions src/content/vrf/v2-5/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ date: Last Modified
title: "VRF Security Considerations"
---

import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"

<VrfDeprecation version="v2-5" />

Gaining access to high quality randomness onchain requires a solution like Chainlink's VRF, but it also requires you to understand some of the ways that miners or validators can potentially manipulate randomness generation. Here are some of the top security considerations you should review in your project.

## Use `requestId` to match randomness requests with their fulfillment in order
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/subscription/create-manage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ title: "Create and manage VRF V2.5 subscriptions"
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { CodeSample } from "@components"
import { Tabs, TabsContent } from "@components/Tabs"

<VrfDeprecation version="v2-5" />

<Vrf2_5Common callout="security" />

## Using the VRF Subscription Manager
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/subscription/get-a-random-number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import { Aside, CodeSample } from "@components"

<VrfDeprecation version="v2-5" />

This guide explains how to get random values using a simple contract to request and receive random values from Chainlink VRF v2.5. The guide uses the Subscription Manager to create and manage your subscription. Alternatively, you can also [create and manage subscriptions programmatically](/vrf/v2-5/subscription/create-manage#create-a-subscription-programmatically). To explore more applications of VRF, refer to our [blog](https://blog.chain.link/).

<Vrf2_5Common callout="uicallout" />
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/subscription/test-locally.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ metadata:
---

import VrfCommon from "@features/vrf/v2/common/VrfCommon.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import ContentCommon from "@features/common/ContentCommon.astro"
import { Aside, ClickToZoom, CodeSample, CopyText, Icon } from "@components"
import { linkEth } from "@features/data"
import { LatestPrice } from "@features/feeds"
import button from "@chainlink/design-system/button.module.css"

<VrfDeprecation version="v2-5" />

This guide explains how to test Chainlink VRF v2.5 on a [Remix IDE](https://remix-ide.readthedocs.io/en/latest/run.html#environment) sandbox blockchain environment. **Note**: You can reuse the same logic on another development environment, such as Hardhat or Foundry. For example, read the Hardhat Starter Kit [RandomNumberConsumer unit tests](https://github.com/smartcontractkit/hardhat-starter-kit/blob/main/test/unit/RandomNumberConsumer.spec.js).

<Aside type="caution" title="Test on public testnets thoroughly">
Expand Down
3 changes: 3 additions & 0 deletions src/content/vrf/v2-5/supported-networks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ metadata:
---

import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro"
import VrfDeprecation from "@features/vrf/VrfDeprecation.astro"
import ResourcesCallout from "@features/resources/callouts/ResourcesCallout.astro"
import { Address, Aside, CopyText } from "@components"
import { TabsContent } from "@components/Tabs"
import CcipCommon from "@features/ccip/CcipCommon.astro"

<VrfDeprecation version="v2-5" />

Chainlink VRF allows you to integrate provably fair and verifiably random data in your smart contract. For implementation details, read [Introduction to Chainlink VRF](/vrf).

VRF v2.5 coordinators for subscription funding are available on several networks. To use Chainlink VRF on certain networks, you may need to conduct token transfers. You can transfer tokens by using [Chainlink CCIP](/ccip/evm/tutorials/application-developers/transfer-tokens-from-contract), [Transporter](https://www.transporter.io/) or third-party applications such as [XSwap](https://xswap.link/).
Expand Down
4 changes: 3 additions & 1 deletion src/features/vrf/VrfDeprecation.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
import V1Deprecation from "./v1/common/deprecation.mdx"
import V2Deprecation from "./v2/common/deprecation.mdx"
import V2_5Deprecation from "./v2-5/v1-v2-shutdown.mdx"

export type Props = {
version: "v1" | "v2"
version: "v1" | "v2" | "v2-5"
}

const { version } = Astro.props as Props
---

{version === "v1" && <V1Deprecation />}
{version === "v2" && <V2Deprecation />}
{version === "v2-5" && <V2_5Deprecation />}
10 changes: 7 additions & 3 deletions src/features/vrf/v1/common/deprecation.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Aside } from "@components"

<Aside type="caution" title="Chainlink VRF v1 is deprecated">
Security fixes for VRF v1 are not guaranteed. VRF v2.5 replaced both VRF v1 and VRF v2 on November 29, 2024. [Migrate
your application to Chainlink VRF v2.5](/vrf/v2-5/migration-from-v1).
<Aside type="danger" title="Chainlink VRF v1 shuts down on November 18, 2026">
VRF v1 was deprecated on November 29, 2024 and will be permanently shut down on November 18, 2026. After this date,
VRF v1 will no longer fulfill randomness requests. [Migrate your application to Chainlink VRF
v2.5](/vrf/v2-5/migration-from-v1) before November 18, 2026 to avoid service disruption.

If you have questions about this shutdown or need help with your migration, reach out to your Chainlink
representative.

_Continued use of VRF v1 is at your own risk. Use of the Chainlink Network is subject to the [Chainlink Foundation Terms of Service](https://chain.link/terms), which provides important information and disclosures._

Expand Down
13 changes: 13 additions & 0 deletions src/features/vrf/v2-5/v1-v2-shutdown.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Aside } from "@components"

<Aside type="danger" title="VRF v1 and v2 shut down in November 2026">
VRF v1 and v2 were deprecated on November 29, 2024 and will be permanently shut down in November 2026. VRF v2 has a
48-hour brownout scheduled for October 28-30, 2026. VRF v1 shuts down on November 18, 2026 and VRF v2 shuts down on
November 30, 2026. After these dates, VRF v1 and v2 will no longer fulfill randomness requests.

[Migrate your application to Chainlink VRF v2.5](/vrf/v2-5/migration-from-v2) to avoid service disruption.

If you have questions about this shutdown or need help with your migration, reach out to your Chainlink
representative.

</Aside>
11 changes: 8 additions & 3 deletions src/features/vrf/v2/common/deprecation.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { Aside } from "@components"

<Aside type="caution" title="Chainlink VRF v2 is deprecated">
Security fixes for VRF v2 are not guaranteed. VRF v2.5 replaced both VRF v1 and VRF v2 on November 29, 2024. [Migrate
your application to Chainlink VRF v2.5](/vrf/v2-5/migration-from-v2).
<Aside type="danger" title="Chainlink VRF v2 shuts down on November 30, 2026">
VRF v2 was deprecated on November 29, 2024 and will be permanently shut down on November 30, 2026. A 48-hour
brownout is scheduled for October 28-30, 2026, during which VRF v2 will not fulfill randomness requests. After the
shutdown date, VRF v2 will no longer fulfill randomness requests. [Migrate your application to Chainlink VRF
v2.5](/vrf/v2-5/migration-from-v2) before November 30, 2026 to avoid service disruption.

The migration guide includes VRF v2.5 code examples for both subscription and direct funding and explains the
differences between VRF v2.5 and VRF v2.

If you have questions about this shutdown or need help with your migration, reach out to your Chainlink
representative.

_Continued use of VRF v2 is at your own risk. Use of the Chainlink Network is subject to the [Chainlink Foundation Terms of Service](https://chain.link/terms), which provides important information and disclosures._

</Aside>
31 changes: 26 additions & 5 deletions src/lib/markdown/__tests__/buildMarkdownArtifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ function expectedLegalNotice(version: string): string {
return `Continued use of VRF ${version} is at your own risk. Use of the Chainlink Network is subject to the [Chainlink Foundation Terms of Service](https://chain.link/terms), which provides important information and disclosures.`
}

const shutdownDates: Record<string, string> = {
v1: "November 18, 2026",
v2: "November 30, 2026",
}

describe("buildMarkdownArtifact", () => {
it.each([
["v1", "vrf/v1/api-reference"],
Expand Down Expand Up @@ -71,13 +76,20 @@ describe("buildMarkdownArtifact", () => {
.trim()

expect(transformed.transformMode).toBe("normal")
expect(markdown.split(`**CAUTION: Chainlink VRF ${version} is deprecated**`).length - 1).toBe(1)
expect(markdown.split(`Security fixes for VRF ${version} are not guaranteed.`).length - 1).toBe(1)
expect(
markdown.split(`**DANGER: Chainlink VRF ${version} shuts down on ${shutdownDates[version]}**`).length - 1
).toBe(1)
expect(
markdown.split(
`VRF ${version} was deprecated on November 29, 2024 and will be permanently shut down on ${shutdownDates[version]}.`
).length - 1
).toBe(1)
expect(markdown).toContain(`](/vrf/v2-5/migration-from-${version})`)
expect(markdown).not.toContain("replaces and enhances VRF v1")
expect(normalized.split(expectedLegalNotice(version)).length - 1).toBe(1)

if (version === "v2") {
expect(normalized).toContain("A 48-hour brownout is scheduled for October 28-30, 2026")
expect(normalized).toContain(
"The migration guide includes VRF v2.5 code examples for both subscription and direct funding and explains the differences between VRF v2.5 and VRF v2."
)
Expand All @@ -95,9 +107,18 @@ describe("buildMarkdownArtifact", () => {
.trim()

expect(artifact?.transformMode).toBe("normal")
expect(markdown).toContain(`Chainlink VRF ${version} is deprecated`)
expect(markdown.match(new RegExp(`Security fixes for VRF ${version} are not guaranteed\\.`, "g"))).toHaveLength(1)
expect(markdown).toContain("Complete this guide to migrate your application to Chainlink VRF v2.5.")
expect(markdown).toContain(`Chainlink VRF ${version} shuts down on ${shutdownDates[version]}`)
expect(
markdown.match(
new RegExp(
`VRF ${version} was deprecated on November 29, 2024 and will be permanently shut down on ${shutdownDates[version]}\\.`,
"g"
)
)
).toHaveLength(1)
expect(normalized).toContain(
`Complete this guide to migrate your application to Chainlink VRF v2.5 before ${shutdownDates[version]} to avoid service disruption.`
)
expect(normalized.split(expectedLegalNotice(version)).length - 1).toBe(1)
})

Expand Down
Loading