Game4Blockchain #3 · x402 for agentic game flows

A small scaffold before x402 touches wallets, agents, or game state.

This packet is tailored to Game4Blockchain issue #3. The project already combines Algorand games, a React frontend, CLI, and LLM agent simulations; the next safe step is an x402 boundary that lets agents discover paid actions without mixing payment authorization into game logic.

1. Discovery first

Expose a dry-run catalogue of payable actions before any agent is allowed to sign: action id, game id, price, network, max spend, and replay/idempotency key.

2. Wallet boundary

Keep x402 payment headers outside contract/client state. The frontend or CLI passes a signed payment proof only after user/agent budget approval.

3. Game-state proof

Separate paid HTTP receipt from Algorand commit/reveal outcomes, so a paid agent call can be audited without leaking strategies, salts, or private wallet material.

Suggested scaffold

Acceptance table

The goal is not to add a live payment processor in one step. The goal is to make the x402 seam reviewable: indexers can discover it, agents can understand price and spend limits, and maintainers can test the state transitions with mocked 402 responses before real settlement.

This packet deliberately avoids live settlement, wallet transactions, bridges, swaps, staking, and private-key handling.

Relevant proof