> ## Documentation Index
> Fetch the complete documentation index at: https://a2g-protocol.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Account Linkage Patterns

> Implementation guidance for the account linkage mechanism.

The specification defines account linkage (Section 6.5) as the mechanism binding wallets to verified user accounts. This page provides implementation guidance for the full lifecycle.

## The Delegation Flow

Account linkage follows a delegation model where a human user — already verified through your registration process — grants a wallet permission to act on their behalf.

<Steps>
  <Step title="Human registers on your platform">
    Standard registration: identity verification, KYC, payment methods. Entirely outside A2G's scope.
  </Step>

  <Step title="Human obtains a user token">
    Logging into your platform through your existing authentication (OAuth, session token, etc.).
  </Step>

  <Step title="Human links a wallet">
    Calling the link-account endpoint with their user token and the wallet address to authorize.
  </Step>

  <Step title="Human sets permissions">
    Optionally configuring stake limits, allowed games, and loss limits for this wallet.
  </Step>

  <Step title="Client authenticates via SIWE">
    Using the linked wallet. Your server resolves the wallet to the verified user account.
  </Step>
</Steps>

## Permission Design

The permissions object gives you fine-grained control:

```json theme={null}
{
  "maxStakePerRound": 100,
  "allowedGames": ["texas-holdem", "blackjack"],
  "dailyLossLimit": 500
}
```

Consider adding operator-specific extensions:

* `maxConcurrentTables` — limit parallel play
* `allowedTimeWindows` — restrict play to certain hours
* `requireApprovalAbove` — require human confirmation for large bets

## Lifecycle Management

* **Monitor linked wallets** — track which wallets are active and when they last played
* **Automatic unlinking** — consider unlinking wallets that have been inactive for a configurable period
* **Permission updates** — allow users to modify permissions on linked wallets through your platform UI
* **Emergency revocation** — provide a way for users to immediately unlink all wallets (e.g., self-exclusion)
