slot-vrng

Integrate verifiable random numbers into Starknet game contracts via multicall.

1|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/shariqazeem/Prophecy-Roguelite --skill slot-vrng-shariqazeem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: slot-vrng
Source: https://github.com/shariqazeem/Prophecy-Roguelite/tree/main/.agents/skills/slot-vrng
Command: npx skills add https://github.com/shariqazeem/Prophecy-Roguelite --skill slot-vrng-shariqazeem

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many on-chain games need cheap, deterministic, and trust-minimized randomness that can be generated and verified within a single transaction; this Skill removes reliance on off-chain or expensive RNG patterns by integrating Cartridge's verifiable RNG into contract flows.

Core Features & Use Cases

  • Atomic verifiable randomness: Generate and verify randomness within one transaction to avoid race conditions and external oracle delays.
  • Flexible source selection: Support for per-address nonces or explicit salts so developers can choose deterministic or varying seeds.
  • Integration pattern and policy: Demonstrates calling request_random as the first multicall entry, consuming the result via consume_random in game logic, and adding the VRF provider to Controller policies for allowed methods.
  • Use Cases: Ideal for dice rolls, loot drops, random map generation, and on-chain prediction outcomes where verifiability and atomicity are required.

Quick Start

Call request_random as the first entry in your multicall with a nonce or salt source, then invoke your game entrypoint that calls consume_random to retrieve the verifiable random value.

Frequently Asked Questions about slot-vrng

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate verifiable randomness for on-chain games on Starknet?

Verifiable randomness for on-chain games is generated atomically within a single transaction using Cartridge's VRF. You call request_random as the first entry in a multicall, then retrieve the value via consume_random in your game logic to ensure trust-minimized outcomes.

How does atomic verifiable RNG prevent race conditions in smart contracts?

Atomic verifiable RNG prevents race conditions by generating and verifying the random number within a single transaction. This removes reliance on off-chain oracles or external delays, ensuring the random value is settled before the transaction completes.

Can I use Cartridge session keys with verifiable RNG for dice rolls and loot drops?

Yes, Cartridge session keys support verifiable RNG for dice rolls and loot drops. You must configure the VRF provider address in your Controller policies for allowed methods, enabling seamless atomic random number generation in your game contracts.

What is the best way to structure a multicall for on-chain randomness?

The best way to structure a multicall for on-chain randomness is to place request_random as the very first call, followed by your game entrypoint. You must match the source values, such as nonces or salts, between request_random and consume_random.

Why does my consume_random call fail to match the verifiable RNG source?

Your consume_random call fails if the source values do not match the request_random call. You must ensure the per-address nonces or explicit salts provided in the initial request_random entry are identical when consuming the verifiable random value.

Do I need to configure Controller policies to use verifiable randomness?

Yes, you need to configure Controller policies to use verifiable randomness. You must add the VRF provider address to your allowed methods list, granting the session key permission to execute the request_random and consume_random calls.