VRF Protocol Documentation

Technical reference for Verifiable Random Function implementation

v1.0.0GitHub

VRF Protocol Documentation

Welcome to the DPN VRF Protocol - a decentralized network providing cryptographically secure, verifiable random functions for Web3 applications. Our distributed infrastructure ensures tamper-proof randomness with mathematical guarantees and permanent on-chain proof storage on Solana blockchain.

Production Network

This documentation covers our live production VRF network. All endpoints and examples use real cryptographic operations.

SHA-512 Based

256-bit security strength with collision resistance and pre-image resistance properties.

Byzantine Fault Tolerant

Secure operation with up to 33% malicious nodes using consensus verification.

On-Chain Verification

Complete audit trail with permanent proof storage on Solana blockchain and Solscan integration.

What is VRF?

Verifiable Random Functions (VRFs) are cryptographic primitives that provide publicly verifiable, unpredictable outputs. Unlike traditional random number generators, VRFs offer mathematical proofs that the output was generated correctly and has not been tampered with.

Key Properties

Pseudorandomness
Output is computationally indistinguishable from uniform random distribution
Uniqueness
Each input produces exactly one valid output, ensuring deterministic results
Public Verifiability
Anyone can verify the correctness of the output using the provided proof
Collision Resistance
Finding two inputs with the same output is computationally infeasible

Use Cases

VRF Protocol enables secure randomness for a wide range of blockchain and Web3 applications.

Gaming & Gambling

  • • Provably fair casino games
  • • Lottery and raffle systems
  • • Random loot drops in games
  • • Tournament seeding

NFTs & Digital Assets

  • • Random trait generation
  • • Fair mint ordering
  • • Rarity distribution
  • • Airdrop selection

DeFi Applications

  • • Liquidation ordering
  • • Random oracle selection
  • • Yield farming rewards
  • • Governance proposals

Infrastructure

  • • Validator selection
  • • Load balancing
  • • Cryptographic key generation
  • • Consensus mechanisms

Network Architecture

The VRF Protocol operates as a distributed network of specialized nodes working together to provide secure, verifiable randomness. Our architecture ensures high availability, Byzantine fault tolerance, and cryptographic security.

System Components

1

API Gateway

Handles client requests, authentication, and load balancing across the network

2

VRF Nodes

Distributed validators that generate cryptographic proofs and random outputs

3

Consensus Layer

Byzantine fault tolerant consensus ensuring network agreement on results

Request Flow

// VRF Request Processing Pipeline
1. Client submits VRF request to API Gateway
2. Gateway validates request and forwards to available VRF nodes
3. Multiple nodes independently generate VRF proofs
4. Consensus mechanism selects final result
5. Response returned with cryptographic proof
6. Client can independently verify result authenticity

Node Types

The VRF Protocol network consists of different node types, each serving specific roles in the randomness generation process.

Full Nodes (Current)

Active

Responsibilities

  • • Process VRF generation requests
  • • Maintain connection to Solana blockchain
  • • Generate cryptographic proofs
  • • Participate in consensus voting
  • • Validate other nodes' submissions

Requirements

  • • Ed25519 keypair for authentication
  • • Stable internet connection (>100 Mbps)
  • • 99.9% uptime requirement
  • • Real-time Solana blockchain access
  • • Hardware security module (HSM) recommended

Lite Nodes (Coming Soon)

Planned

Planned Features

  • • Contribute entropy to VRF generation
  • • Verify VRF proofs from full nodes
  • • Participate in network governance
  • • Earn rewards for participation
  • • Lower resource requirements

Expected Requirements

  • • Consumer-grade hardware
  • • Basic internet connection
  • • Minimal storage requirements
  • • Periodic online presence
  • • Token staking for participation

Consensus Mechanism

Our Byzantine Fault Tolerant consensus ensures network security with up to 33% malicious nodes. The protocol uses cryptographic randomness for fair node selection and result validation.

Consensus Algorithm

// Dynamic Consensus Requirements
function calculate_consensus_threshold(unique_nodes):
if unique_nodes ≥ 10:
return 10 // Maximum redundancy
elif unique_nodes ≥ 5:
return min(unique_nodes * 2, 10)
else:
return min(unique_nodes * 3, 10)
// Selection Process:
// Random selection using cryptographic hash of all submissions

Security Properties

Byzantine Fault Tolerance
System remains secure with up to 33% malicious nodes
Sybil Attack Resistance
Ed25519 signatures prevent identity forgery and fake nodes
Prediction Resistance
Future randomness cannot be computed from past values
Finality Guarantees
Consensus results are immutable once confirmed by the network

Quick Start

Get started with the VRF Protocol API in minutes. This guide covers basic integration patterns.

Basic VRF Request

// HTTP POST Request
POST https://api.vrfprotocol.com/v1/randomness
Content-Type: application/json
Authorization: Bearer <API_KEY>
{ "algorithm": "sha512_vrf", "entropy": "user_provided_seed", "output_format": "binary" }

Response Format

{ "success": true, "request_id": "vrf_req_1704067200_abc123", "result": { "random_value": "heads", "proof": { "block_hash": "FzXcR4Rj7nQF3mP8wXyZ...", "entropy_hash": "b47c2c1a8f3e9d2b5a6c...", "signature": "ed25519_signature_bytes", "timestamp": 1704067200123 } }, "verification_url": "https://verify.vrfprotocol.com/proof/abc123" }

API Endpoints

Complete reference for all available VRF Protocol endpoints and their parameters.

POST/v1/randomness

Generate cryptographically secure random value

Request Parameters

ParameterTypeRequiredDescription
algorithmstringYesVRF algorithm type (sha512_vrf)
entropystringNoClient-provided entropy seed
output_formatenumNobinary | decimal | hex (default: binary)
GET/v1/proof/:request_id

Retrieve cryptographic proof for verification

Path Parameters

request_id- Unique identifier from randomness generation request

VRF Algorithm Specification

Mathematical specification of the Verifiable Random Function implementation based on SHA-512.

Core Algorithm

// Entropy Aggregation Function
E(t) = SHA512(B(t) || S(t) || T(t) || C(t) || R(t) || N(t))
Where:
• B(t) = Solana blockchain hash at time t
• S(t) = Current slot number
• T(t) = Server timestamp (nanosecond precision)
• C(t) = Client-provided entropy
• R(t) = Server pseudorandom value
• N(t) = Node-specific identifier hash

Entropy Sources

Multi-source entropy aggregation ensuring cryptographic randomness with redundancy and attack resistance.

Entropy Source Analysis

SourceEntropy BitsAttack ResistanceUpdate Frequency
Solana Block Hash~248 bitsBlockchain consensus~400ms
Slot Number~20 bitsTemporal ordering~400ms
Server Timestamp~40 bitsNTP synchronizationPer request
Client Entropy~64 bitsUser-controlledPer request
Server Random~64 bitsCSPRNGPer request
Process Nanotime~30 bitsSystem-levelPer request
Total Entropy: ≥466 bits (exceeds 256-bit security requirement by 82%)

Running a VRF Node

Join the VRF Protocol network as a validator node operator. Earn rewards while contributing to decentralized randomness generation.

Currently Invite-Only

Node operation is currently by invitation only. We're working towards a permissionless network. Contact our team if you're interested in running a node.

Hardware Requirements

Minimum Specifications

  • • 4 CPU cores (Intel/AMD x64)
  • • 8 GB RAM
  • • 100 GB SSD storage
  • • 100 Mbps stable internet
  • • 99.9% uptime requirement

Recommended Specifications

  • • 8+ CPU cores
  • • 16+ GB RAM
  • • 500+ GB NVMe SSD
  • • 1 Gbps fiber connection
  • • Hardware Security Module (HSM)

Node Setup Process

1
Generate Ed25519 Keypair
Create cryptographic identity for node authentication
2
Install Node Software
Deploy VRF node client and configure environment
3
Connect to Network
Establish connections to other nodes and sync with network
4
Begin Validation
Start processing VRF requests and earning rewards

Rewards System

Node operators earn VRFY tokens for participating in the network and processing VRF requests.

Reward Structure

Participation Rewards

Base participation0.1 VRFY
Selected result+1.0 VRFY
Per VRF requestVariable

Performance Bonuses

99.9%+ uptime+10% bonus
<100ms response+5% bonus
Early adopter+25% bonus

Proof Verification

Independent verification protocol allowing mathematical validation of all VRF outputs.

Verification Algorithm

// Verification Implementation
function verify_vrf_proof(proof):
// 1. Reconstruct entropy seed
seed = proof.block_hash + proof.slot + proof.timestamp +
proof.client_entropy + proof.server_random + proof.node_id
// 2. Apply SHA-512 hash
hash = SHA512(seed)
// 3. Extract result using algorithm
result = extract_result(hash, proof.algorithm)
// 4. Verify signature
return ed25519_verify(proof.signature, seed, proof.public_key)

On-Chain Verification

DPN VRF Protocol integrates with Solana blockchain to provide permanent, immutable proof storage for all VRF generations, enabling independent verification by anyone at any time.

Permanent Proof Storage

Every VRF proof is automatically stored on Solana blockchain using the official Memo Program, creating a permanent, tamper-proof record that can be independently verified on Solscan.

Solana Memo Program Integration

Program Details

Program ID:MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr
Network:Solana Mainnet
Storage Type:Transaction Memo

Proof Format

// Stored Memo Content
{ "gameType": "coinflip", "result": "heads", "proof": { "seed": "confirmed_block_hash_...", "hash": "64_byte_sha512_result", "signature": "ed25519_signature" }, "timestamp": 1703025600000 }

Proof Storage Flow

1
VRF Generation
Node generates VRF proof with cryptographic signature
2
Memo Transaction
Backend creates Solana transaction with proof data in memo field
3
On-Chain Storage
Transaction signed and submitted to Solana network
4
TXID Return
Solana transaction ID returned to frontend for verification

Solscan Integration

All VRF proofs can be independently verified on Solscan, providing transparency and trust.

Frontend Integration

  • Clickable TXID links in game results
  • Verification modals with step-by-step proof breakdown
  • Live Explorer with on-chain proof buttons
  • Auto-opening Solscan links in new tabs

Verification Process

  • • Click any Solana TXID in the UI
  • • Opens transaction on Solscan.io
  • • View complete proof data in memo field
  • Independently verify using SHA-512 tools

Trustless Verification

No need to trust our frontend or backend - every proof is permanently stored on Solana blockchain and can be verified independently using standard cryptographic tools and the public Solscan explorer.

Configuration

Environment Variables

# Backend Configuration (.env)
VRF_MEMO_PRIVATE_KEY=your_solana_private_key_base58
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Optional: Use QuickNode/Alchemy for better performance