RANDOMNESS TESTING & VERIFICATION

Test the dcipher VRF system, verify randomness, and understand how provably fair selections work

🔧 RANDOMNESS VERIFICATION

Contract Status

Balance: 0 ETH

Subscription ID: 0

Next Selection ID: None

Randomness Sender

Address: Not set

Status: ❌ Not configured

💰 Contract Funding

The contract needs ETH to pay for VRF randomness requests. Each request costs approximately 0.001 ETH.

🎲 Randomness Testing

Test if randomness is being generated for your selections. This will check the blockchain for updates.

📋 How Randomness Generation Works

1. Submit Selection

When you submit a selection, the smart contract calls getRandomness() to request randomness from dcipher VRF.

2. VRF Processing

dcipher VRF generates cryptographically secure randomness and calls back to your contract's onRandomnessReceived() function.

3. Winners Selected

The contract uses the received randomness to select winners using a provably fair algorithm (Fisher-Yates shuffle).

4. Event Emission

A SelectionCompleted event is emitted with the winners and randomness, which the frontend listens for.

🔍 Troubleshooting

Randomness Not Received?

  • Check if the contract has sufficient ETH balance
  • Verify the RandomnessSender address is correct
  • Ensure the contract is properly deployed and configured
  • Check blockchain explorer for transaction status
  • Wait 1-2 minutes for VRF callback (normal processing time)

Testing Steps

  1. Fund the contract with ETH
  2. Submit a selection with participants
  3. Wait for transaction confirmation
  4. Use "Check Randomness Update" button
  5. Monitor for SelectionCompleted events

UNDERSTANDING PROVABLY FAIR RANDOMNESS

What is VRF?

Verifiable Random Function (VRF) is a cryptographic primitive that provides verifiable randomness. It generates random values that can be independently verified by anyone, ensuring the randomness was not manipulated.

In our system, dcipher VRF generates the randomness on-chain, making it impossible for anyone (including the contract owner) to predict or manipulate the results.

How Verification Works

When you request randomness, the system generates a unique request ID and sends it to the VRF network. Once the randomness is generated, you receive:

  • Request ID: Unique identifier for your randomness request
  • Randomness: The actual random value generated
  • Signature: Cryptographic proof of authenticity
  • Nonce: Additional entropy for security

REAL-WORLD APPLICATIONS

🎯

Giveaways & Raffles

Fair selection of winners for promotional campaigns and contests

📋

Whitelist Selection

Random selection for NFT drops and token sales

🎲

Gaming & Gambling

Provably fair random outcomes for games and betting