DIM · Dagon Inference Marketplace

Holds

A hold is a small signed message your agent sends with every request. It says "I will pay up to this cap for this request, on this channel, at this route's published prices." The seller checks it before serving the first token, and refuses the request with HTTP 402 if anything is wrong. A hold is never payable by itself: money moves only when your agent later signs a voucher.

What is in a hold

A hold is exactly 275 bytes, signed by the channel's session key:

Field Meaning
tag, domain IM/HOLD/1 and genesis_hash ‖ program_id, so a hold for one deployment is useless on another.
channel, channel_epoch Which channel pays.
lane, lane_counter Which agent lane sent it, and a counter that must strictly increase per lane.
request_id 32 random bytes, fresh for every attempt.
request_commitment SHA256(salt ‖ request body bytes). Binds the hold to the exact prompt without revealing it.
route_id, schedule_digest Which route, at which prices.
cap_micros The most this request may cost, in micro-USDC.
dispatch_until Unix time after which the seller must not start the request. The SDK sets it 10 seconds ahead.
tape_consent Always 0 in the MVP.

How it travels

The hold rides in HTTP headers on the normal OpenAI-compatible call:

POST /v1/chat/completions
Content-Type: application/json
X-IM-Hold: base64(275 hold bytes)
X-IM-Hold-Sig: base64(64-byte Ed25519 signature)
X-IM-Session: base58(session public key)
X-IM-Salt: base64(32-byte salt)

The salt lets the seller recompute the commitment from the body it received. The SDK draws a fresh salt per attempt, hashes the exact bytes it sends, and does not keep the salt in its payment records.

What the seller checks

The seller's gateway admits a request only if all of these hold:

  • the signature is valid for the channel's session key and the domain matches;
  • the channel is open, belongs to this seller and is not closing;
  • the route is listed here and the schedule digest matches an effective schedule;
  • dispatch_until has not passed;
  • the cap is at least the schedule's w_req_micros and at most the per-request limit;
  • the cap fits in the channel's remaining budget: budget − redeemed − unvouchered exposure − caps of requests in flight;
  • the request_id has never been used, and lane_counter is higher than the last one on that lane.

Each failure has its own 402 code; see errors. If everything passes but the route is full, the answer is 429.

Choosing a cap

The cap is your worst case for one request. Too low and the seller refuses it (cap_too_low) or the receipt is cut at the cap, which the seller absorbs. Too high and it ties up channel budget while the request runs, which limits how many requests can run at once. If you do not set one, the SDK uses defaultCapMicros from the client options, or else the route's w_req_micros. Under a Mandate, the cap can never exceed per_request_cap.