The Extension Model
Adding a new game to A2G requires three things:- A game specification — a machine-readable document describing the game’s rules, actions, state schema, and JSON Schema definitions. Served by the server at runtime.
- Payload schemas — JSON Schema (or TypeScript types) defining the game-specific data that rides inside the universal envelope.
- A game engine — server-side logic that implements the rules. This is Layer 4, not part of the protocol.
Multiple Game Models
A2G supports different game interaction patterns using the same envelope format: Turn-based games (poker, blackjack) — the server sendsgame_action_request to a specific client when it’s their turn. The client responds with submit_action. One player acts at a time.
Phase-based games (roulette, baccarat) — the server opens a betting_window_open period during which all clients can submit actions simultaneously. When the window closes (betting_window_closed), the server resolves the round.
Both models use the same envelope, the same identity mechanism, and the same funding interface. The difference is entirely in when and how submit_action messages are accepted. Future game models can be added without changes to the core protocol.
The Server Tells You What to Do
A key feature of A2G is that every action request includes an explicitavailableActions field. The server doesn’t just send you the game state and expect you to figure out what’s valid — it tells you exactly what actions you can take and what parameters they accept.
What the Core Protocol Handles
Regardless of game type, the protocol provides:- Connection lifecycle (
hello,authenticate,authenticated) - Session management (expiry, extension, inactivity timeout)
- Account linkage (binding wallets to verified user accounts)
- Balance queries and transaction history
- Table discovery via the lobby API
- Game specification serving and parsing
- Client runtime requirements (state tracking, action validation, timeout handling)
- Error handling with standardized codes
- Reconnection and state recovery
- Optional fairness proof transport (seed commitment/reveal)