Fast VRF
Cryptographically secure, verifiable randomness with millisecond-level generation
Fast VRF
Fast VRF enables verifiable random number generation for smart contracts with realtime delivery through RISE's shred architecture. Results arrive in 3-5ms via WebSocket, enabling responsive gaming experiences.
Overview
Fast VRF provides cryptographically secure randomness for smart contracts with millisecond-level response times. Traditional VRF solutions require multiple block confirmations, taking seconds or minutes. RISE's shred architecture delivers VRF results instantly through WebSocket subscriptions, enabling truly responsive gaming and DeFi applications with standard Solidity interfaces.
Interactive Demo
Try the dice game below. It uses RISE Wallet to request a random number, which is fulfilled instantly by the VRF Coordinator.
Current Streak
0 🔥
Top Streak
0 🏆
Connect your wallet to play
"use client";import { createPublicClient, webSocket, encodeFunctionData } from "viem";import { useAccount, useSendCalls } from "wagmi";import { useEffect, useState } from "react";import { riseTestnet } from "viem/chains";// RISE Testnetconst DICE_GAME = "0x3EcD88B557F1811C6fDd94bA1622cD8c88832Aad";export function DiceGameWidget() { const { address } = useAccount(); const { sendCallsAsync } = useSendCalls(); const [result, setResult] = useState<number | null>(null); // 1. Watch for VRF results in realtime via WebSocket useEffect(() => { if (!address) return; const client = createPublicClient({ chain: riseTestnet, transport: webSocket("wss://testnet.riselabs.xyz/ws"), }); const unwatch = client.watchContractEvent({ address: DICE_GAME, abi: DiceGameABI, eventName: "DiceRollCompleted", args: { player: address }, onLogs: (logs) => { const lastLog = logs[logs.length - 1]; setResult(Number(lastLog.args.result)); }, }); return () => unwatch(); }, [address]); // 2. Trigger the roll const handleRoll = async () => { const data = encodeFunctionData({ abi: DiceGameABI, functionName: "rollDice", }); await sendCallsAsync({ calls: [{ to: DICE_GAME, data }], }); }; return ( <div className="space-y-4"> <div className="text-4xl text-center"> {result ? `🎲 ${result}` : "❓"} </div> <Button onClick={handleRoll}> Roll Dice (Gasless) </Button> </div> );}Key Features
- 3-5ms response times: VRF results delivered faster than a blink
- Real-time updates: WebSocket subscriptions for instant notifications
- Full EVM compatibility: Standard Solidity interfaces work with existing tooling
- Cryptographically secure: Verifiable randomness you can trust
Common Use Cases
- Gaming: dice rolls, card shuffling, loot generation
- NFT minting with random trait generation
- DeFi lottery and reward distribution
- DAO jury selection and voting mechanisms
VRF Coordinator
| Network | Address |
|---|---|
| RISE Testnet | 0x9d57aB4517ba97349551C876a01a7580B1338909 |