The payment flow
Every request your node serves moves through the same on-chain payment flow: reserve → escrow → serve → receipt → settle. The price is fixed before any work happens and the charge is provable afterward, so you can serve anonymous users without trusting them, and they can pay you without trusting you.
The user-facing summary is in The operator network.
The happy path, end to end:
This is the flow when your node and the client are both on protocol 9.12 or later: the client signs both escrow groups and your node submits them to its algod. Otherwise the client submits both groups itself — the open before it sends the prompt, the settlement after it verifies the receipt.
Step 1 — Reserve, you quote a price ceiling
A client calls your node's reserve endpoint before it sends a prompt. Your node returns a ticket: a signed quote that names a price ceiling for the request.
The ticket is signed by your node's signing key (the one registered on-chain) and includes, at minimum:
| Field | What it carries |
|---|---|
| Ticket id | Identifies this request. |
| Operator id and node id | Your on-chain identity. |
| Maximum price and minimum price | The most this request can cost, and the floor charged on any non-zero usage. |
| Expiry | Clients reject a ticket that's too close to expiring, so quote enough validity to cover the request. |
| Cryptographic material | What the client needs to encrypt its prompt to you and to verify the reply (covered in Encryption & keys). |
Because the ceiling is signed, you can't raise the price after serving. Because the client checks the signature against your on-chain key, a relay in the middle can't forge a ticket in your name.
How the ceiling gets sized
Your node derives the maximum price from an input count the client declares on its reserve call, plus the output ceiling for the request. Reserve happens before the client sends the prompt, so the client measures its own request body and declares its size.
That count is sized from the actual body, not the model's context window. A
short question against a 1M-context model reserves a few hundred tokens, so the
payer locks cents rather than dollars. Your node caps whatever the client
declares at context_window − max_output and never raises it.
Once the prompt arrives, your node re-measures the decrypted body against
what was reserved. That check is on by default (enforce_input_budget). Over
budget, a plain request is refused before you spend anything upstream (sealed,
zero-cost, fully refunded), and a tool loop stops at the boundary while still
returning a final answer from what it already gathered.
The exception is a long prompt whose reserve is already at the
context_window − max_output cap. The size estimate runs about twice a real
tokenizer on prose, so it can't tell whether the prompt fits. Your node forwards
it and lets your backend decide, as long as the estimate is within three times
the budget; past that it refuses context_length_exceeded up front. If your
backend refuses the prompt as too long, the payer sees context_length_exceeded
and the request settles at zero cost. A forwarded request is not offered your
built-in tools, because a single round can already fill the window; tools the
caller defined itself are still passed through.
The three-times limit matters if you declare a context_window smaller than
your backend's real one. A forwarded prompt can then use more input than the
reserve covers, and the payer's charge stops at the escrowed amount, so you
absorb the difference, up to that limit.
An honest client sizes with the same bound your node measures with, so the two
agree within a tolerance. The check stops a payer who under-declares to reserve
less than their prompt actually costs you. Configuration is in
zs.reserve; the metric to watch is
zs_reserve_input_budget_over_total.
Step 2 — Escrow: funds are locked on-chain
The client locks the ticket's maximum price in the escrow contract, opening an on-chain ticket record that names you as the payee. Your node's signing key authorizes the escrow-opening transaction (your node pre-signs it as part of the reserve response), so only a node you control can open a ticket that pays you.
The client signs its USDC transfer and completes the group, then sends it to your node inside the encrypted prompt. Your node checks that the group is the one it pre-signed for this ticket and only then submits it to its algod, so it never broadcasts an open it would refuse. If algod or the contract rejects the group, the request is refused as a payment failure and the ticket is spent; the client reserves again. The cause can be the payer's (its deposit or USDC falls short) or your node's (see Troubleshooting). When the client or your node is older than protocol 9.12, the client submits the group itself before sending the prompt, and your node finds it in the mempool.
Once the ticket is open you can confirm on-chain that the funds are real before
spending compute. The user can't pull the funds back during the live window: an
unclaimed ticket becomes refundable to them only after its deadline passes
(expires_at plus the settlement grace period). Once you claim, the two-phase
settle governs.
Step 3 — Serve: you run the model
The client sends its encrypted prompt to your inference endpoint. Your node decrypts it, runs the model, and streams the reply back encrypted (see Encryption & keys). You track the actual resources used (input tokens, output tokens, and any images produced), because that's what you bill for.
Step 4 — Receipt, you sign what it actually cost
When the response is complete, your node issues a receipt, signed by the same node key. The receipt states:
- The ticket id it settles.
- The actual input and output counts (and any auxiliary output, such as images produced by an in-loop image tool).
- The amount charged, which must fall within the ticket's
[minimum, maximum]range. - A hash of the response body you returned.
The client verifies all of this before it will settle:
- The signature matches your on-chain node key.
- The amount doesn't exceed the ticket's maximum (and meets the minimum on non-zero usage).
- The body hash matches the bytes the client actually received.
If any check fails, the client refuses to settle. If the body hash doesn't match, it also protests the receipt, which freezes the ticket (see When the two sides disagree).
Step 5 — Settle: the escrow pays out
Settlement is two-phase. On the happy path both halves ride in one atomic
two-transaction group: your node pre-signs its first-half claim and hands it
back in the response, and the client signs the matching acknowledgement and
sends the group back to your node's /v1/zs/settle-ack endpoint, encrypted and
through a relay when the request used one. Your node checks that it's the group
it composed for that ticket and submits it. When the client or your node is
older than protocol 9.12, or the client finds no relay able to carry the
acknowledgement, the client broadcasts the group itself.
- You claim. The first half of the settlement, authorized by your signing key, carries the amount charged and a digest of the receipt.
- The client acknowledges. The client signs the matching second half. If
its receipt matches your claim, the contract releases funds in one atomic
group:
- You receive the amount charged.
- The protocol fee goes to the treasury (see Staking & economics).
- The remainder of the escrow is refunded to the user.
When the two sides disagree
A ticket freezes instead of paying out in two cases:
- The client protests. Before the ticket's deadline, a client can protest a receipt it rejects, attaching the receipt your node signed. A protest after the deadline is refused.
- The two halves of the settlement don't match. The client sends a mismatched half on purpose only when you claim more than the receipt your node signed. A claim that is lower or differs in some other way is normally left unanswered, and it pays at the deadline as described below. The exception is a ticket where the client posted its half first: your node's half must then match it, or the ticket freezes.
Nobody can settle, force-finalize, protest, or refund a frozen ticket, and its funds stay locked in escrow. The protocol admin resolves it, weighing the evidence on chain, and splits the escrow between your owner address and the payer. The protocol fee is charged on your share as on a normal settlement, and the payer gets the rest. See Disputed tickets need you for what your node logs.
When the client never acknowledges
If you've served a request and claimed, but the client's half never arrives (it went offline, say, your node refused its acknowledgement, or your claim differed from the receipt without exceeding it), you aren't stuck. A client whose acknowledgement fails doesn't fall back to broadcasting the group itself, so this path finishes the ticket. After a grace period that the ticket carries, your pending claim can be force-finalized on the terms you claimed. This call is permissionless: your node normally posts it, but a watcher bot (or anyone) can finalize a lapsed claim on your behalf, so you get paid for work you did even if both you and the user are offline when the grace period elapses.
On Solana
The same five steps run on Solana, with these differences:
- Escrow. At reserve your node composes the payer's escrow transaction; the
payer signs it and hands it back with the request, and your node sends it,
paying its fee. Under the default
chain.open_policy: paritythe work starts once the RPC accepts the transaction and stops if it then fails to land;strictwaits for it to land first. - Settle. The payer's acknowledgement is a signature your node sends with the settlement. If it never comes, your node claims the charge and settles the ticket itself once the grace period has passed.
- Payout. A settlement pays your node's vault rather than your owner, and
the node sends the vault's earnings on to your owner every
chain.payout_interval. See Payouts. - Free models open nothing on-chain; your node's own daily budget limits them. See Free models.
What this means for running a node
- Leave the input-budget check on. Without
zs.reserve.enforce_input_budget, a payer can declare a smallinput_count, send a large prompt, and have you serve the difference. Turn it off only for a trusted single-user node, or temporarily to measure the real rate fromzs_reserve_input_budget_over_totalbefore enforcing. - Keep your signing key online and safe. It authorizes opens, signs tickets and receipts, and claims settlements. It is the identity users pay. Treat it as a hot key with real money behind it; see Encryption & keys.
- Settle promptly. Claim settlements as responses complete. The grace-period fallback is for clients that vanish, not your normal path.