DocsGetting started
Quickstart (API)
This guide uses the hosted API to generate Stellar contract-compatible payloads for commit and reveal.
Hosted API
Base URL: https://vrf-core-production.up.railway.app/
Step 1: Generate payloads
curl -s "https://vrf-core-production.up.railway.app/payloads"You’ll receive both hex and base64. For Stellar Lab, use base64.
Step 2: Commit on-chain
Call commit(user, commitment, pubkey) on the deployed contract:
- Contract IDs: Contract IDsMainnet
CDLBUXLWQDRVVDYECDUVUOS3UG2YHZ4ZPDM3PKY5XSSX6DLMSNJOBPTYTestnetCBLC5COYONIRCPWWCRNE6S2EOYJ7IQOWI7RUDG5ZVPHCLZW2KXFFCK2Q commitment:BytesN<32>pubkey:BytesN<96>(G1, uncompressed)
commit requires authorization by user (the transaction must be signed by user).
Step 3: Reveal on-chain
Call reveal(user, seed, salt, signature):
seed:Bytes(any length)salt:Bytes(any length)signature:BytesN<192>(G2, uncompressed)
Return value is the verified BytesN<32> randomness.
Step 4: Derive randomness for your app
Use derive_random(randomness, context) to produce a deterministic u64 for your use-case.
Example contexts:
dao:proposal:42nft:mint:1039:raritygame:match:9:turn:12