# Recommended Architecture

For the best developer experience, split responsibility across two boundaries:

**Client-side (`@privy-io/react-auth`)** for session management, wallet provisioning, login/logout UI, and identity-token acquisition.

**Server-side (`@cityprotocol/core` → `verifyPrivyWallet`)** for token verification, wallet-address resolution, and any downstream authorization logic that gates access to City Protocol features.

Never trust a wallet address sent directly from the client. Always resolve it from the verified identity token on the server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/wallet/recommended-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
