Payment guard
Catch a payment on the wrong network.
The guard compares the proposed network and asset with the supplied terms before creating a payment.
Evidence and limits
- Problem
- In 0.1.x, a payment at the agreed price was allowed to another recipient (when the terms named no
payTo), in another mapped asset or on another mapped network. Found while replaying x402 #3866. - Change
- 0.2.0 adds
asset_matchandnetwork_match: a mismatch iscontradictedand stops the payment before it is created. A binding the terms entry doesn't name is reported asnot_evaluated. - Verification
- 12 new tests, 11 of which fail on 0.1.1 (release notes). Run on 2026-11-04: 79 of 79 pass at
543a911. - Limit
- The binding checks run in the local guard and are not in the signed receipt. With the default
onNotEvaluated: "allow", an undeclared recipient, asset or network does not by itself stop a payment.