Abstract Requirements
Regardless of the underlying funding mechanism, A2G-compliant servers MUST:- Accept deposits — Provide a mechanism for value to be credited to a participant’s platform account before gameplay
- Track balances — Maintain accurate platform credit balances, distinguishing between available and locked (in-play) credits
- Support withdrawals — Provide a mechanism for participants to withdraw available credits
- Guarantee integrity — Player balances MUST be recoverable after any failure to the last confirmed game action. No credits may be created or destroyed by a server failure
- Provide transparency — Expose balance and transaction history through the funding API endpoints
Credit Model
During gameplay, all chip/bet movements are tracked off-chain on the server. No settlement transactions occur during a game round. The settlement layer (blockchain, fiat processor, etc.) provides custody guarantees at deposit and withdrawal only.EVM / ERC-20 Binding
A2G defines a concrete funding binding for Ethereum-compatible blockchains. Servers operating on other blockchains, fiat rails, or alternative custody models MAY implement equivalent funding operations and document them in a server-specific extension specification.Deposits
Value is transferred by callingdeposit() on the server’s smart contract with an ERC-20 token. The server detects the on-chain deposit event and credits the participant’s platform balance.
- Client queries
/api/wallet/configto get contract details - Calls
ERC-20.approve(depositContract, amount)on-chain - Calls
depositContract.deposit(amount)on-chain - Server detects the deposit event and credits the balance
- Balance is reflected in subsequent messages
Withdrawals
Withdrawals use a server-signed authorization model:- Client requests withdrawal via
POST /api/wallet/withdraw - Server verifies sufficient unlocked balance
- Server signs a withdrawal authorization (EIP-712 typed data or equivalent)
- The signed authorization is submitted to the on-chain contract
- Contract verifies server signature and transfers tokens
Configuration
Funding configuration is exposed viaGET /api/wallet/config: