Support for Chainlink VRF v2.5 Users
Overview
dcipher supports Chainlink VRF v2.5 users by providing adapter contracts compatible with the latest VRF v2.5 interfaces for both direct funding and subscription models. This enables existing Chainlink VRF users to switch to dcipher's VRF infrastructure with minimal changes to their smart contracts.
dcipher offers two main adapter contracts to support the two common funding models in Chainlink VRF v2.5:
-
Direct Funding Adapter For users who pay for randomness requests using native tokens (e.g., ETH or other native chain tokens).
-
Subscription Funding Adapter For users who utilize Chainlink VRF subscription accounts to fund their randomness requests.
These adapters are fully compatible with Chainlink VRF v2.5’s request and callback flows, while incorporating dcipher-specific customizations.
Key Features
-
Direct Funding Adapter
-
Allows Chainlink VRF users to fund randomness requests directly using native tokens (e.g., ETH or native chain tokens).
-
Designed to return a single random value per request by default, instead of multiple random words.
-
To integrate, users simply replace the address of their current Chainlink VRF wrapper contract with the address of a deployed instance of dcipher’s ChainlinkVRFV2PlusWrapperAdapter.
-
Fully compatible with Chainlink VRF v2.5 request and fulfillment logic.
-
Enables seamless integration without requiring changes to existing consumer contracts.
-
-
Subscription Funding Adapter
-
Designed for Chainlink VRF users who fund randomness requests via subscription accounts.
-
Fully compatible with Chainlink’s Subscription API, enabling:
-
Seamless creation of new subscriptions via Randamu contracts.
-
Management of subscription consumers (add/remove).
-
Funding subscriptions using native tokens.
-
-
To integrate, users simply replace the address of the Chainlink VRF Coordinator contract with the address of a deployed instance of dcipher’s ChainlinkVRFCoordinatorV2_5Adapter on their network. Subscriptions can then be created and managed using the same Chainlink function signatures.
-
Fully adheres to Chainlink VRF v2.5 request and callback flow.
-
Enables subscription management using native tokens in a manner consistent with Chainlink’s design patterns.
-
How to Switch to dcipher VRF
For Direct Funding Users
-
Update your consumer contracts to reference the deployed contract address of the ChainlinkVRFV2PlusWrapperAdapter on your target network. Each user has to deploy an instance of the adapter contract.
-
Fund randomness requests directly with native tokens as usual—no change to your payment flow is required.
-
The adapter processes requests and fulfills callbacks with a single random word by default.
For Subscription Users
-
Update your consumer contracts to reference the deployed contract address of the ChainlinkVRFCoordinatorV2_5Adapter on your target network. Each user has to deploy an instance of the adapter contract. It enables the creation and funding of subscriptions via dcipher's adapter using native tokens.
-
Register your consumer contracts as authorised consumers under the newly created subscription.
-
Request randomness as usual.
The adapter handles subscription billing and randomness fulfillment in full compliance with Chainlink VRF v2.5 standards.
Developer Notes
The adapters expose Chainlink’s standard subscription interface—functions like createSubscription
, fundSubscription
, and addConsumer
, allowing them to serve as drop-in replacements with minimal integration effort.
The primary customization is that Randamu returns a single random value per callback by default, rather than an array of multiple values as in the standard Chainlink implementation.
Both direct funding and subscription workflows have been thoroughly tested using Foundry, ensuring compatibility, reliability, and secure fulfillment behavior across request flows.
Example Testing Highlights
Direct Funding Flow: Consumers fund randomness requests directly with native tokens and receive a single random word per request. Request fees are accurately tracked and can be withdrawn by the contract owner.
Subscription Flow: A subscription is created and funded using native tokens, with consumer contracts added under the subscription. Randomness requests are fulfilled as expected, fees are properly accounted for, and consumers receive the correct random values.