Skip to content

Instantly share code, notes, and snippets.

@ngundotra
Created July 10, 2025 21:24
Show Gist options
  • Save ngundotra/fe3bfd0628072e4f71cc169b59318002 to your computer and use it in GitHub Desktop.
Save ngundotra/fe3bfd0628072e4f71cc169b59318002 to your computer and use it in GitHub Desktop.
x402 Tx Flow
sequenceDiagram
  participant Client
  participant Server
  participant Facilitator

  Client->>Server: GET /api
  Server->>Client: HTTP 402 - Payment Required with { extra: { account: pubkey } }
  Client->>Solana: GET /blockhash
  Client->>Client: Form templated transaction, cosign, serialize
  Client->>Server: Include Header: X-PAYMENT b64 payload 
  Server->>Facilitator: /verify
  Facilitator->>Solana: Simulate, sign, send transaction
  Solana->>Facilitator: Verify transaction inclusion
  Facilitator->>Server: Confirm
  Server->>Client: return response x-payment-response
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment