Prover
Generate temporal ordering proofs for ordered transaction batches.
The Prover builds cryptographic proofs that the ordered batch you publish matches an ordering rule (FIFO by default) and is anchored to verifiable time. Use it in your sequencer, matching engine, or batch pipeline when you want an auditable record of fair ordering.
When to use the Prover
- You publish batches and need to prove the order was respected.
- You need an offline artifact that auditors or partners can verify.
- You want to attach proof metadata to on-chain commitments.
Basic usage
use fairseq_sdk::{Config, Prover, Transaction};
let config = Config::default();
let prover = Prover::new(config).await?;
let transactions = vec![
Transaction::new("0xabc...", 1704067200000000000),
Transaction::new("0xdef...", 1704067200100000000),
];
let proof = prover.prove(transactions).await?;Core methods
new(config: Config) -> Result<Prover>
Creates a prover bound to your time beacon configuration and ordering rule.
prove(transactions: Vec<Transaction>) -> Result<Proof>
Generates a proof for a single ordered batch. The batch must already be ordered according to your policy.
prove_with_options(transactions: Vec<Transaction>, options: ProveOptions) -> Result<Proof>
Like prove, but lets you attach metadata, override ordering rules per-batch, or pass performance hints.
Prove options
use fairseq_sdk::ProveOptions;
let options = ProveOptions {
metadata: Some([("source".into(), "l2-sequencer".into())].into()),
ordering_rule: None, // override FIFO when needed
};Error handling
The prover returns structured errors for:
- Invalid ordering inputs (non-deterministic or out-of-order timestamps).
- Missing time beacon connectivity.
- Batch sizes that exceed configured limits.
Related docs
Performance
For 100-1000 transactions per batch, proof generation typically completes in under one second on standard server hardware.