Appearance
Instructions
The consumer-facing surface. (Prover-operator instructions — registration, bonding, key rotation — ship with the signer docs.)
request(seed: [u8;32], at_risk_lamports: u64)
Creates a randomness request: freezes alpha, escrows the fee, reserves the at-risk amount against the prover's bond.
| # | Account | Signer | Writable | Notes |
|---|---|---|---|---|
| 1 | payer | ✓ | ✓ | pays rent + fee; must hold a current Terms acknowledgment |
| 2 | requester | ✓ | identity bound into alpha (program PDA via CPI, or the wallet) | |
| 3 | comp_dest | receives slash compensation; may not be the prover, the request, or the prover's operator | ||
| 4 | network | ["network"] | ||
| 5 | terms | ["terms"] | ||
| 6 | ack | ["ack", payer] — must match the current terms version | ||
| 7 | prover | ✓ | the prover this request pins to | |
| 8 | request | ✓ | ["request", requester, seed], created | |
| 9 | slot_hashes | the SlotHashes sysvar | ||
| 10 | system_program |
Fails if: the network is paused (new requests only), the prover is not active, the prover rotated its key this slot, the at-risk amount exceeds the single-request cap or the prover's free bond, or the payer's acknowledgment is missing/stale (TermsNotAccepted).
fulfill(proof: [u8;80]) — permissionless
Verifies the proof against the request's pinned key and alpha; stores beta; releases the fee escrow to the prover's operator; frees the reservation. Never blocked by pause or prover status. Rejected in the request's own slot (commitment must precede outcome).
Accounts: request (w), prover (w), operator (w — fee destination, must be the prover's registered operator).
slash() — permissionless once overdue
After request_slot + fulfill_window_slots (window snapshotted at request time), moves exactly at_risk_lamports from the prover's bond to the request's comp_dest and terminates the request. Never blocked by pause.
Accounts: network, request (w), prover (w), comp_dest (w).
close_request() — requester only, terminal states only
Returns rent and any unspent fee escrow to the recorded payer. Pending requests cannot be closed (that would be an escape hatch from the commitment).
Accounts: requester (s), payer (w), request (w).
acknowledge_terms(hash: [u8;32])
One-time (per terms version) wallet acceptance. The submitted hash must equal the current on-chain terms hash — proof the client displayed this version. Re-callable after a revision.
Accounts: signer (s, w), terms, ack (w, created), system_program.
Discriminators
Anchor 8-byte discriminators, from the IDL (also exported as constants by vrand-interface):
| Instruction | Bytes |
|---|---|
request | [46, 101, 67, 11, 76, 137, 12, 173] |
fulfill | [143, 2, 52, 206, 174, 164, 247, 72] |
slash | [204, 141, 18, 161, 8, 177, 92, 142] |
close_request | [170, 46, 165, 120, 223, 102, 115, 2] |
acknowledge_terms | [5, 228, 143, 84, 226, 36, 17, 231] |