Quick Access
Check out basic VRF examples:GitHub
Repo for roll dice example
VRF dApp
Roll a dice onchain
Delegated VRF dApp
Roll a dice within 100 ms onchain
Need the product overview first? Start with the Solana VRF landing page, then follow this quickstart.
Step-By-Step Guide
Any Solana program can request and consume verifiable randomness onchain within seconds using the MagicBlock VRF SDK. By the end of this guide, you’ll have a working example that rolls a dice using verifiable randomness.Write your Solana program as you normally.
Add request and consume randomness instructions.
Add CPI hooks that request and consume randomness via callback from a
verified oracle.
Deploy your Solana program using Anchor CLI.
Execute transactions for onchain randomness.
Send transactions to generate and consume randomness onchain.
Roll Dice Example

| Software | Version | Installation Guide |
|---|---|---|
| Solana | 3.1.9 | Install Solana |
| Rust | 1.89.0 | Install Rust |
| Anchor | 1.0.2 | Install Anchor |
| Node | 24.10.0 | Install Node |
Code Snippets
- 1. Write program
- 2. Request & Consume Randomness
- 3. Deploy
- 4. Test
A simple roll dice program where player initialize state account to store, request and consume randomness:⬆️ Back to Top
Want to run VRF end to end on your machine? Use the Local Validator Setup guide for the fully local stack, the Surfpool alternative, and the local
vrf-oracle flow.Solana Explorer
Get insights about your transactions and accounts on Solana:Solana Explorer
Official Solana Explorer
Solscan
Explore Solana Blockchain
Solana RPC Providers
Send transactions and requests through existing RPC providers:Solana
Free Public Nodes
Helius
Free Shared Nodes
Triton
Dedicated High-Performance Nodes
Solana Validator Dashboard
Find real-time updates on Solana’s validator infrastructure:Solana Beach
Get Validator Insights
Validators App
Discover Validator Metrics
Server Status Subscriptions
Subscribe to Solana’s and MagicBlock’s server status:Solana Status
Subscribe to Solana Server Updates
MagicBlock Status
Subscribe to MagicBlock Server Status
MagicBlock Products
Ephemeral Rollup (ER)
Execute real-time, zero-fee transactions securely on Solana.
Private Ephemeral Rollup (PER)
Protect sensitive data with compliance — built on top of Ephemeral Rollups.
Private Payment API
Add private onchain transfers to your app in seconds — compliant by default.
Solana VRF
Add provably fair onchain randomness to games, raffles, and real-time apps.
Pricing Oracle
Access low-latency onchain price feeds for trading and DeFi.

