magicblock requestRandomness
magicblock_requestRandomnessGenerate provably fair randomness on Solana via MagicBlock VRF oracle. Creates an unsigned transaction for your program's callback.
Instructions
Request provably fair on-chain randomness from the MagicBlock VRF oracle (Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz). Builds an unsigned transaction that invokes request_randomness on the VRF program. Use sap_preview_transaction, sap_sign_transaction, and sap_submit_signed_transaction; do not create local signing scripts. The oracle queue defaults to the base-layer queue (Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh); set ephemeral=true to use the ER queue for delegated programs. Builder fee applies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payer | Yes | Wallet pubkey that will pay for the request and sign the transaction | |
| endpoint | No | MagicBlock Router endpoint: 'mainnet' or 'devnet' | |
| ephemeral | No | Use the Ephemeral Rollup oracle queue instead of the base-layer queue (default false) | |
| callerSeed | Yes | Seed string for the VRF request — committed before randomness is produced. The seed is hashed to 32 bytes. | |
| callbackAccounts | Yes | Accounts to pass to the callback instruction | |
| callbackProgramId | Yes | Program ID of the callback program (the program that will consume the randomness) | |
| callbackDiscriminator | Yes | Base58 or hex discriminator for the callback instruction in your program |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | MCP content blocks returned to the caller. | |
| isError | No | True when the tool result represents an application-level error. |