BlueprintsSurplus MarketOperator Requirements

Surplus Market Operator Requirements

A Surplus operator can be a venue, an attester, a market maker, a bonded issuer, or some combination of those roles. The obligations are different.

Do not run as a bonded issuer unless you can redeem the credits you sell.

Base host

RequirementWhy
Rust operator buildRuns surplus-operator-lite or surplus-operator.
Persistent venue stateKeeps books, outbox, inventory, settlement state, and operator config.
Chain RPCReads contracts and submits settlement when chain mode is enabled.
Supervised processThe venue should restart without losing book/accounting state.
HTTP endpointServes the market API used by the app and other clients.
Private key storageProtects issuer, attester, and submitter keys.

Key separation matters. The operator key signs issuer/attester actions. The submitter key can be a separate gas/nonce key.

Inference backend

Bonded issuance needs real inference capacity.

SettingUse
SURPLUS_VLLM_MODELManaged vLLM model backend.
SURPLUS_INFERENCE_URLOpenAI-compatible inference endpoint.
SURPLUS_INFERENCE_API_KEYCredential for that endpoint.

Router-proxy mode is useful for tests and non-bonded flows. A bonded issuer must not rely on router fallback because the credit lot must be backed by capacity the issuer runs or controls.

Settlement keys and config

SettingUse
SURPLUS_CHAIN_IDChain ID used in EIP-712 and settlement calls.
SURPLUS_SETTLEMENT_ADDRSettlement contract address.
SURPLUS_RPC_URLRPC endpoint for settlement submissions.
SURPLUS_OPERATOR_KEYIssuer or attester key.
SURPLUS_SUBMITTER_KEYOptional separate transaction key.

Do not put these in frontend env. They are operator secrets.

Shared CLOB and attesters

For shared books, configure:

SettingUse
SURPLUS_CLOB_OPERATORSPeer operator list.
SURPLUS_CLOB_BOOKBook identifier.
SURPLUS_CLOB_THRESHOLDAttestation threshold.
SURPLUS_ATTESTER_ONLY=1Runs a quorum member that attests but does not issue.

The CLOB path depends on operator signatures. Peers must prove their operator address by signature recovery before joining the transport.

Privacy mode

Surplus can publish and use onion endpoints through Arti, the Rust Tor implementation.

SettingUse
SURPLUS_ONION_URLFixed onion endpoint.
SURPLUS_ONION_FILEPath where Arti writes the generated onion hostname.
PRIVACY_MODE=torRoute outbound operator calls through Tor.

This is Tor, not custom cryptography. The privacy goal is to avoid concentrating a seller’s redemptions on the same identifiable operator endpoint.

Operator preflight

Run the repo proof paths before claiming a venue is ready:

pnpm -r test
cargo test --workspace
cd contracts && forge test

For settlement and spend paths, the repo uses:

bash scripts/settlement-e2e.sh
bash scripts/spend-e2e.sh
bash scripts/prove-batch.sh execute

Those prove more than “the server boots.” They exercise atomic fill settlement, redemption, collateral default, attested batch settlement, spend billing, and circuit parity.