vrypan |--o--|
@vrypan.eth
I want to understand x402. Who can help me? I don't want step-by-step, copy-paste instructions. I want to understand the HTTP flow and the payloads involved. I feel it is something very simple, but I went through the whole https://www.x402.org website and I can't find an actual HTTP exchange example.
2 replies
1 recast
7 reactions
Haole
@haole
it should be simple, just Signs an EIP-3009 authorization for USDC transfer and pass the signature into the header, then server verify and execute to claim the money https://github.com/coinbase/x402/blob/main/typescript/packages/x402/src/schemes/exact/evm/client.ts
2 replies
0 recast
4 reactions
vrypan |--o--|
@vrypan.eth
Yea, it should be easy. But I don't want to decode typescript. I want a simple example of the HTTP exchange.
1 reply
0 recast
2 reactions
Erik.eth
@programmer
I can help here! x402 standardizes a response that describes how to const payment, and a header the includes a payment. The client creates the X-Payment payload based on the response body. There are other details like delegating settlement to the facilitator, but broadly thats it for the http exchange.
1 reply
0 recast
1 reaction
vrypan |--o--|
@vrypan.eth
Thanks! How does my client know 1. What to do with the payload 2. How to construct the next payload, after the payment is completed?
1 reply
0 recast
0 reaction
Erik.eth
@programmer
What to do for each tuple (chain, scheme) is defined in the spec, and clients implement the spec That x402 isn't opinionated on, the rest is up to the HTTP server accepting x402. Any part of http or standards on top of http (OpenAPI, MCP, HTML) are valid in the response to the request making payment
0 reply
0 recast
0 reaction