Skip to content

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.

#AccountSignerWritableNotes
1payerpays rent + fee; must hold a current Terms acknowledgment
2requesteridentity bound into alpha (program PDA via CPI, or the wallet)
3comp_destreceives slash compensation; may not be the prover, the request, or the prover's operator
4network["network"]
5terms["terms"]
6ack["ack", payer] — must match the current terms version
7proverthe prover this request pins to
8request["request", requester, seed], created
9slot_hashesthe SlotHashes sysvar
10system_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):

InstructionBytes
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]

Apache-2.0. Live on Solana devnet.