Compute API
POST /fold accepts a circuit id, an input blob, and a callback. The handler queues the job, the host produces the sub-proofs, the folding adapter compresses them, the FastAPI worker returns the final proof bytes.
assembling
A FastAPI service in front of an SP1 host pool. Submit a job, poll for the folded proof, settle on mainnet. The marketplace publishes verified results as Pyth-style feeds.
POST /fold accepts a circuit id, an input blob, and a callback. The handler queues the job, the host produces the sub-proofs, the folding adapter compresses them, the FastAPI worker returns the final proof bytes.
The Anchor program exposes verify_proof(proof_bytes, public_inputs, circuit_id). On success it writes a ProofRecord PDA seeded by [b"proof", &proof_hash]. Distinct verifications never contend.
External dApps subscribe to ProofRecord accounts by hash. Producers publish verified facts; consumers read them. The proof bytes themselves stay off-chain.
1$ curl -X POST $NEXT_PUBLIC_API_URL/fold \2 -H "content-type: application/json" \3 -d '{4 "circuit": "median",5 "input": "<base64 input bytes>",6 "subProofs": 1007 }'8{ "jobId": "f3c1...", "status": "queued" }1$ curl $NEXT_PUBLIC_API_URL/jobs/f3c12{3 "status": "complete",4 "proofBytes": "<2.3KB base64>",5 "costSol": 0.0001,6 "verifierTx": "https://explorer.solana.com/tx/..."7}Weighted average over a fixed-length score vector.
SUM, AVG, MIN, MAX in one pass, all four committed.
Median with a sortedness witness over the input multiset.
Permutation proof — output is monotonic, multiset matches input.
Two-layer MLP forward pass, ReLU, fixed-point i32.
Verifier program ready to integrate.