cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Explore x402 protocol support for SATP

Open RafaelAPB opened this issue 5 months ago • 4 comments

Is your feature request related to a problem? Please describe. x402 allows autonomous clients, like AI agents or automated services, to discover payment terms, pay instantly via stablecoins (such as USDC), and fulfill digital requests seamlessly without setting up manual user accounts or API keys.

SATP gateways can provide (cross chain) liquidity services by enabling payment via a x402 endpoint

Describe the solution you'd like TBD

Describe alternatives you've considered TBD

Additional context

https://x402.org/

RafaelAPB avatar Jul 03 '26 00:07 RafaelAPB

Hi Cacti maintainers — this issue is about x402 support for SATP gateways. I’m running a live Base-mainnet x402 seller that may be useful as an external interop fixture while you evaluate the SATP ⇄ x402 payment flow.

Live x402 seller: https://x402.167-172-95-184.nip.io

Machine-readable surfaces:

BASE=https://x402.167-172-95-184.nip.io
curl -i "$BASE/price"                    # expected: HTTP 402 + x402 payment requirements
curl -s "$BASE/.well-known/x402" | jq .  # paid resource discovery
curl -s "$BASE/openapi.json" | jq .info  # OpenAPI 3.0.3 spec
curl -s "$BASE/demo" | jq .              # free health/demo response

Payment details for tests:

  • Network: Base mainnet (eip155:8453)
  • Asset: USDC
  • Facilitator: Coinbase CDP x402 (https://api.cdp.coinbase.com/platform/v2/x402)
  • Cheapest route: GET /price at $0.01 USDC
  • Agent-oriented routes also include /audit/x402, /receipt/verify, /mandate/verify, /mcp/call, /opportunities/latest, and /research/{topic}.

Why this may help this specific issue:

  1. SATP gateway prototypes can test the pre-payment path without spending anything by asserting the HTTP 402 challenge and parsing the payment requirements.
  2. Wallet-equipped test agents can perform a real low-cost settlement when you need to validate post-payment receipt/data handling.
  3. The /receipt/verify and /mandate/verify routes are intentionally aligned with agent-commerce/SATP-style concerns: receipt classification, replay/context binding, and mandate-readiness checks.

I verified immediately before posting that GET /price returns HTTP/2 402 and that /.well-known/x402 is live. No partnership claim here — just offering a concrete external seller fixture if useful for x402/SATP integration tests.

AmitabhainArunachala avatar Jul 06 '26 03:07 AmitabhainArunachala

@AmitabhainArunachala thank you! A few questions

  1. Is there an address that allow us to do really low cost payments for integrations tests (ideally as close to 0 as possible)?
  2. Due to security concerns we will use a well-tested, well-documented seller for our tests. Do you have any evidence of the legitimacy of the seller you are showcasing?

RafaelAPB avatar Jul 06 '26 10:07 RafaelAPB

@RafaelAPB thanks — concrete answers:

  1. Lowest-cost integration path: for CI/unit tests, you can spend $0 by asserting the pre-payment path only:
BASE=https://x402.167-172-95-184.nip.io
curl -i "$BASE/price"                    # expected: HTTP 402 + x402 requirements
curl -s "$BASE/.well-known/x402" | jq .  # discovery manifest
curl -s "$BASE/openapi.json" | jq .info  # OpenAPI metadata

For an actual settled x402 payment, the cheapest live Base-mainnet route is:

  • GET https://x402.167-172-95-184.nip.io/price
  • price: $0.01 USDC
  • network: Base mainnet (eip155:8453)
  • pay_to: 0x68614873C5d624c07DCAA3aFF5243DD5027c3910
  • facilitator advertised in the challenge: Coinbase CDP x402 (https://api.cdp.coinbase.com/platform/v2/x402)

I don’t want to claim “near-zero” beyond the live route’s actual price; if SATP needs a lower-cost fixture, I can add a dedicated /satp/fixture route and post the manifest/challenge for review before anyone pays it.

  1. Legitimacy / review evidence: agreed that tests should use something inspectable. Current public evidence surfaces are:
  • health: GET https://x402.167-172-95-184.nip.io/health returns service/version/network/pay_to/paid route catalog
  • discovery: GET https://x402.167-172-95-184.nip.io/.well-known/x402 lists the paid resources
  • OpenAPI: GET https://x402.167-172-95-184.nip.io/openapi.json
  • indexing status: GET https://x402.167-172-95-184.nip.io/status/indexing
  • latest local x402scan verification receipt reports registered=10, failed=0, warning_count=0 for this origin
  • the unpaid GET /price challenge currently returns HTTP 402 with network=eip155:8453, asset=USDC, the pay_to above, and the CDP facilitator URL

I’m not asking Cacti to trust a revenue claim here — self-pay/testnet/unknown-payer calls are not counted as external revenue. If useful, send the exact SATP gateway test shape you want (endpoint URL or expected x402 challenge fields), and I’ll return a minimal fixture spec/checklist for that flow.

AmitabhainArunachala avatar Jul 06 '26 10:07 AmitabhainArunachala

For SATP gateway support, I would keep the x402 fixture tests separate from the SATP receipt tests.

A useful minimum conformance shape could be:

1. unpaid request -> HTTP 402 with parseable x402 requirements
2. paid request -> settled x402 proof bound to request/resource/context
3. SATP gateway step -> transfer receipt references the payment proof, but does not become the payment proof
4. replay test -> same payment proof cannot authorize a different SATP transfer context

The important boundary is that x402 answers "was this resource paid for?" while SATP still needs to answer "what gateway action did this authorize, between which parties/assets/chains, under which state transition?"

So I would expect the test artifact to preserve both layers:

x402_payment_receipt_ref
satp_session_or_transfer_ref
gateway_identity_ref
asset_or_route_ref
request_context_hash
verification_state

That lets Cacti support x402 without collapsing payment settlement, gateway identity, and SATP state into one overloaded receipt. No partnership claim here; this is just the interop boundary we have been using in adjacent AgentFolio/SATP work.

0xbrainkid avatar Jul 06 '26 15:07 0xbrainkid