Back to blog

AGENTTRUST

Pending is not unpaid: following a native NEAR payment

The core admits a signed invoice and reserves the owner's available balance before dispatching a native transfer. The transfer then runs in a separate receipt. A private callback records the outcome.

This separation matters. An allowed request is not a settled payment, and a successful RPC response is not enough to release purchased content.

Keep one operation identity

Each attempt has a stable payment ID and an immutable invoice hash. An exact retry returns the original payment record. Reusing the ID for another invoice conflicts.

The SDK design saves the original quote and operation context before broadcast. After a timeout, it resumes that attempt. A missing payment in one observation does not prove that an earlier transaction cannot still execute, so it must not silently choose a fresh quote, supplier, or payment ID.

Three outcomes, plus an explicit gap

A successful transfer and successful callback leave a settled record. A definitive failed transfer restores the available balance once. A pending transfer keeps its reservation.

If the transfer succeeds but its callback fails, the reservation can remain indefinitely. The 120-second reconciliation label is diagnostic. The prototype has no automatic refund, resend, or administrative resolver for this state.

A supplier must independently check final settled state and the full invoice/request binding before releasing a report. A settled receipt remains valid for its original input after quote expiry; retrieval failure never permits repayment.

Evidence and remaining gap

The native runtime captures support 20 of 21 case groups, including actual restricted-key behavior, storage and receipt cases. The refund-gap case remains unobserved. The r2 testnet run records two settled native payments and exact retry behavior with a scripted buyer. Fresh r3 and r4 local-model rehearsals each capture a separate 0.002 NEAR settled purchase, exact direct retry with no second payout and keyless saved buyer replay with no model or MCP calls. The public feed shows dated on-chain decisions; browser visual QA remains open.