DIM · Dagon Inference Marketplace

Settlement and redemption

Settlement is how a seller gets paid. Anyone can submit the newest voucher for a channel to the Solana program with redeem. The program checks the session key's signature, then pays the seller's payout account the voucher's settled_total minus what the channel has already paid. It never pays twice and never pays past the channel's budget.

The redemption rule

if settled_total > redeemed:  pay (settled_total − redeemed) to seller_payout_token; redeemed = settled_total
else:                          succeed and pay nothing
  • Idempotent. A voucher at or below redeemed is a successful no-op, so a relay can retry safely.
  • Bounded. settled_total ≤ budget is enforced. A channel can never pay out more than was locked in it.
  • Only the newest matters. Totals are cumulative, so redeeming the latest voucher collects everything owed so far.
  • Only before the deadline. redeem requires now < D, the channel's close deadline. Once closing has begun, the seller has the grace period to redeem.

Who can redeem

redeem is permissionless. The instruction immediately before it in the same transaction must be Solana's Ed25519 signature check over the exact 168 voucher bytes and the channel's session key. Whoever submits the transaction pays only its fee; the money always goes to the payout account fixed when the channel was opened. In practice the seller's gateway batches redemptions through its settler.

What happens to the money

Step Vault free Vault reserved Seller
Open a 2 USDC channel −2.000000 +2.000000
Redeem a voucher for 0.002233 −0.002233 +0.002233
Finalize after the deadline +1.997767 −1.997767

Under a Mandate, redemption also moves the paid amount from the Mandate's reserved to its spent total.

Off-chain acknowledgment versus on-chain payment

The seller's {"ack": true} to a voucher POST means the seller accepted the receipts and stored the voucher. It is not payment. Payment happens when the voucher is redeemed on-chain. The seller protects itself by refusing new requests that would push unredeemed, unvouchered exposure past what the channel can still pay.

One deployment, one domain

Every hold and voucher is signed over a domain: the cluster's genesis hash plus the program ID. A voucher is valid only for the program it names. A successor program, if one is ever selected for new funds, lives at a different address; existing vouchers keep settling through the original program, and existing balances are never moved automatically.