random_u32
, random_u8_with_range
, and random_bool
make it simple to convert the [u8; 32]
output into usable values. Because the request and consume steps occur inside the ephemeral execution window, users get real-time results with verifiable fairness and without relying on external servers.
Flow

- Your program will CPI into the MagicBlock VRF program and append a request to the queue.
- Once your randomness request is in the queue, an oracle will release the request and perform the randomness computation.
- Upon completion, it returns the result and proof to the MagicBlock VRF program. After verifying the proof, the VRF program will callback into your program into a predefined function that will “consume” the randomness.
MagicBlock’s VRF Program is open-source and audited.