jcp-x402: the x402 agentic-payment wire, dual-ceiling gated + settlement coupling #24
Loading…
Reference in a new issue
No description provided.
Delete branch "jcp/x402-bridge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
x402 is the open HTTP-native payment wire: a server answers with
402 Payment Required+ a PaymentRequirements (a stablecoin charge), the agent retries with a signedX-PAYMENTheader, the server settles on chain. It standardizes how an agent pays inline — but the authorization is denominated in a stablecoin and bounds nothing about the compute the paid-for work consumes.That is precisely the shape SPEC §4.8 was built for. The stablecoin amount is a money ceiling; the compute is a joule ceiling; the two must not be reconciled by a fabricated USDC→joule rate. So the payment supplies one ceiling, the operator supplies the other, and both are enforced independently.
What's here
jcp-bridge—x402_resource(network, payTo)content-addresses a merchant as a grant audience an attacker cannot spoof by name;x402_pay_frame+call_x402_pricedmirror the a2a priced path. ReusesFrameKind::AgentTask, so no schema change and no conformance-vector churn.jcp-x402—ingest_requirementsparses the real wire shape (tolerating theaccepts[]wrapper, andmaxAmountRequiredas the wire's decimal string or an integer → integer minor units, never a float).X402Profilemints one dual-ceiling grant per merchant and gates each charge, sealing allow and deny alike.Denials, proven by test and by the runnable example
funds-exceeded— while joules still had roomcurrency-mismatch— refused, never convertedwrong-resourceThe settlement coupling
seal_settlementseals a receipt whosepayload_hashcommits to the settled transaction hash + the measured joules.coupling_id()is the public check: a third party recomputes the content id from the settlement record and compares. Changing either the tx or the joule figure yields a different id, so a receipt cannot be re-pointed at another settlement.This is the artifact neither side produces alone — the payment rail knows the transaction but not the energy; an energy meter knows the joules but not the transaction.
It required
jcp/2(#23) to be real. Underjcp/1the receipt didn't commit its payload, and this crate deliberately shipped without the claim rather than assert a coupling the format couldn't carry.42 suites green, clippy clean, all conformance checks pass.