Random Number Verification
This document explains how to independently verify that the winner of a Pumpkin Lucky Draw was selected fairly, deterministically, and using ORAO VRF randomness. All verification can be done using public on-chain data from the fulfilled transaction linked in the dApp. Overview of the Verification Flow.
To verify the random number used to select the winner, follow these steps:
Locate the fulfilled VRF transaction
Extract the ORAO VRF randomness
Derive the raw random number used by the program
Apply modulo with total weight
Confirm the result matches the WinnerSelected event
Step 1: Open the Fulfilled VRF Transaction
From the Pumpkin Platform (dApp), you are able to find the redirected to a Solana Explorer link pointing to the transaction where randomness was fulfilled. This transaction contains:
An ORAO VRF fulfillment event
FulfilledThe Pumpkin Lucky Draw program’s
WinnerSelectedevent
Step 2: Locate the ORAO VRF Fulfillment Event
In the transaction logs, find the event emitted by the ORAO VRF Callback program:
OraoVrfCb::events::fulfilled::FulfilledInside this event, locate the field:
randomness: [u8; 64]This is a 64-byte cryptographically secure random value generated and verified by ORAO VRF on-chain.
This randomness is guaranteed to be unpredictable and tamper-proof by the ORAO VRF protocol.
Step 3: Derive the Raw Random Number Used by the Program
The lucky draw program derives a raw random number by:
Taking the first 16 bytes of the VRF randomness
Interpreting them as a little-endian unsigned 128-bit integer
This transformation is fixed and reproducible, allowing anyone to independently derive the same value from the on-chain randomness.
Step 4: Apply Modulo with Total Weight
Each participant in the draw occupies a weighted range within:
To select a winner fairly across all weights, the program computes:
Where:
random_numbercomes from Step 3total_weightis the sum of all participant weights
Step 5: Verify Against the WinnerSelected Event
WinnerSelected EventIn the same transaction, locate the Pumpkin Lucky Draw program event:
This event includes:
number→ the final winner numberrandom_number→ the raw u128 derived from randomnesstotal_weight→ total cumulative weight useddraw_count→ number of times draw completedclaim_deadline→ last valid claim time
Verification checks confirm that:
The
random_numberequals the u128 derived fromrandomness[0..16]The
total_weightmatches the expected totalThe following holds true:
If all checks pass, the random number selection is fully verified.
Summary
To verify the random number used in the draw:
Open the fulfilled VRF transaction
Read
randomness: [u8; 64]from the ORAO VRF fulfilled eventConvert
randomness[0..16]to a little-endian u128Compute
random_number % total_weightConfirm it matches
WinnerSelected.number
If it matches, the draw result is provably fair and correct.
Last updated