Skip to main content

Verifiable Random Function (VRF) System

Our gacha pack system uses Verifiable Random Function (VRF) technology to ensure completely fair and tamper-proof randomness for all pack openings.

How It Works

1. Deterministic Input Creation

When you open a pack, the system combines two pieces of data:

  • Your unique pack memo (UUID assigned when you purchase)
  • Your transaction signature (generated by your wallet when confirming the transaction)

2. VRF Proof Generation

This combined input is processed through our VRF algorithm (ECVRF-SECP256K1-SHA256) using our private key to generate:

  • A cryptographic proof
  • A random number (1 to 100,000,000) that determines your NFT

3. Immutable Storage

Both the proof and roll number are stored in our database, but also stored permanently on the blockchain.

Why This Is Trustworthy

  • User-Controlled Randomness: Your wallet's transaction signature is unique and unpredictable - we cannot influence or predict it
  • Deterministic: Given the same memo + transaction signature, the VRF will always produce the same result
  • Tamper-Proof: Once your transaction is confirmed, the randomness cannot be changed or manipulated
  • Cryptographically Secure: Uses industry-standard elliptic curve cryptography

Verification

Anyone can verify the fairness of any pack opening:

API Verification

Use our verification endpoint:

GET /api/vrf/verify?memo=YOUR_MEMO_HERE

This returns:

  • valid: Whether the VRF proof is cryptographically valid
  • rollMatches: Whether the stored roll matches the calculated roll
  • proof: The VRF proof for this pack
  • publicKey: Our VRF public key
  • transactionSignature: Your unique transaction signature

Manual Verification

  1. Take the memo + transaction signature
  2. Hash them together using SHA-256
  3. Use our public key to verify the VRF proof
  4. Calculate the roll from the proof hash

Technical Details

  • Algorithm: ECVRF-SECP256K1-SHA256-TAI
  • Input: SHA-256(memo + transaction_signature)
  • Output: Deterministic 32-byte hash converted to roll (1-100,000,000)
  • Public Key: Available in verification responses

Transparency

Every pack opening includes:

  • Immutable transaction record on Solana blockchain
  • VRF proof stored in our database
  • Public verification endpoint for all users
  • Open-source verification logic

This system ensures that neither we nor anyone else can manipulate your pack results after your transaction is confirmed.