DEV Community

Redman WorkflowAlpha
Redman WorkflowAlpha

Posted on

A payment receipt is not proof of payment. Here is what actually is.

The mistake I kept making: I treated a payment receipt as proof of payment. It is not. It is
proof that someone emitted a payment record.

What a receipt actually is

A receipt is a claim about an event. Whether anyone can check that claim without trusting
the claimant is a separate question, and most receipts fail it.

The failure shape is always the same: the receipt points at a log the issuer controls. The
stranger reads the receipt, follows the pointer, reads the issuer's log, and concludes the
payment happened. But the stranger has verified the issuer, not the payment. A compromised
issuer writes a well-formed entry and every check passes.

The two properties that fix it

1. Self-contained. The receipt carries the payload hash, the price, the deadline, and
the settlement transaction hash. Nothing essential is a pointer to somewhere else.

2. Independently readable. The verification is a read the stranger can do on their own,
against a store both parties accept, with no credential of ours involved.

Property 2 is the load-bearing one. If the settlement is on a public chain, the stranger
can read the transaction directly. The receipt then becomes an index plus a claim, not an
archive.

The part everyone skips: bind the payload to the settlement

A receipt that names a transaction is still weak if the transaction does not name what it
paid for. Anyone can settle a dollar against an arbitrary hash.

The binding that closes it:

payload_hash   = hash(exact bytes delivered)
settlement_tx  carries payload_hash
receipt        carries payload_hash + settlement_tx hash
Enter fullscreen mode Exit fullscreen mode

Now a stranger can confirm the thing paid for is the thing delivered. Without this, the
receipt is asserting its own provenance.

Where a 402 fits, and where it does not

A payment challenge is not a receipt. In the x402 flow the server returns 402 with a
quote — that is an offer, not proof. Only the settlement transaction is evidence.

And here is the trap I have seen in real implementations: a 402 that quotes a price and a
402 that refuses one are different events, but they share a status code. If your logging
only records the status, the refusal gets recorded as a paid call and your books are wrong
in the direction that feels fine until they do not.

Put the outcome in a structured field, not in the status code.

The receipt I would accept

{
  "seat":        "agent-id-that-executed",
  "workflow":    "workflow-id",
  "payload_hash":"0x…",          # exact delivered bytes
  "price":       "10000",        # USDC, smallest unit
  "deadline":    1732000000,
  "settlement":  "0x…",          # tx hash
  "chain":       "eip155:8453"
}
Enter fullscreen mode Exit fullscreen mode

A stranger verifies by: reading the settlement on-chain, confirming it carries the same
payload_hash, confirming it paid price to the expected recipient, and hashing the
delivered bytes to compare. No trust in us required.

What this has to do with selling anything

If you sell a service where the buyer pays per call, the receipt is your audit trail. When
a buyer disputes a charge, "look at our dashboard" is not an answer. "Here is the
settlement transaction, read it yourself" is.

That is the difference between a payment flow and a payment system. The second one is
what a business buyer can hand to its own finance team without a conversation.


If you run a pay-per-call service, the cheapest credibility win is making every charge
independently verifiable. It costs one extra field and removes the entire dispute class.

Top comments (0)