Ledgers & settlement
Pzero keeps two separate books and settles every clear atomically.
Two books
- Buyer ledger: entries:
topup,consumption,refund,fee. Only confirmed top-ups and debits affect spendable balance. - Seller ledger: entries:
accrual,payout. Seller accruals are payout-only; they cannot be spent on inference.
Settlement at clear
Each successful clear writes three entries in one database transaction:
| Entry | Book | Amount |
|---|---|---|
{request}:buyer | buyer | − gross (consumption) |
{request}:supplier | seller | + net 90% (accrual) |
{request}:platform | buyer | + fee 10% (to the platform revenue wallet) |
If the same wallet is both sides (self-clear), the net change is just the fee.
Confirmed vs pending
USDC top-ups land as pending and become spendable only after the configured number of confirmation blocks (~20 blocks, ~40s on Base). A reorg flips a pending top-up back out. Inference never spends unconfirmed balance.
Batched seller payouts
Sellers accrue per clear but are paid in batches, one on-chain USDC transfer per payout event, not per inference. This is deliberate: it keeps each payout to a single, clean accounting and tax event.
- Default threshold: $10. Manual "Pay me now": floor of $1.
- One in-flight batch per supplier at a time.
- Three-way reconciliation: on-chain transfers ↔ confirmed batches ↔ ledger payout debits.
Fail closed
If the upstream call succeeds but settlement fails, the request returns an error. Never a successful body with an unsettled clear. Credit deduction failure after inference must not return success.