> For the complete documentation index, see [llms.txt](https://wiki.privai.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.privai.cloud/product-architecture.md).

# Product Architecture

PRIVAI combines an OS-style Web3 frontend, server-side scan APIs, external intelligence providers, private routing tools, browser-local Case Files, and an AI analyst layer.

The product is currently **Solana-first**, with selective Ethereum support where reliable APIs are already available. Additional EVM chains are planned later.

### Architecture At A Glance

| Layer                     | Role                                                                                                                         |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Frontend OS**           | Browser-based interface with folders, modules, draggable windows, login, reports, and Case Files.                            |
| **Access Layer**          | Solana wallet login, hidden admin bypass, and token-gated OS access.                                                         |
| **Module API Layer**      | Server routes that run wallet, token, identity, routing, and threat-intel modules.                                           |
| **Data Connectors**       | On-chain RPC, intelligence APIs, market data, risk providers, and selected browser workers.                                  |
| **Private Routing Layer** | DEFCON session state, Tor-aware provider calls, Jupiter swap preparation, Uniswap URL handoff, and bridge exchange creation. |
| **AI Layer**              | Security analyst terminal, risk summaries, action plans, project briefs, and signature explanations.                         |
| **Case Files**            | Browser-local saved scan history with exportable report data.                                                                |

### Access Model

PRIVAI uses a single OS-level login gate. Once access is granted, users should be able to open folders and run modules without being repeatedly gated.

| Access Type              | Behavior                                                                                |
| ------------------------ | --------------------------------------------------------------------------------------- |
| **Admin wallet**         | Hidden server-side bypass for the configured admin wallet. This is not shown in the UI. |
| **Token holder**         | Requires at least **1,000,000 $PRIVAI** of the configured Solana mint.                  |
| **Unauthenticated user** | Remains on the login layer and cannot enter the OS.                                     |

Current token-gate mint:

```
Gc7QGptjL88oM8uzGTBKw8Zhnm2Gp3P73sYdf6zZpump
```

### Product Areas

| Area                 | What It Covers                                                                       | Details          |
| -------------------- | ------------------------------------------------------------------------------------ | ---------------- |
| **Wallet OpSec**     | Wallet exposure, approvals, wallet graphing, and on-chain behavior.                  | Wallet OpSec     |
| **Private Routing**  | Privacy-aware route preparation for supported swap and bridge workflows.             | Private Routing  |
| **Token Intel**      | Token contracts, deployers, holders, liquidity, rug-risk, and project reuse signals. | Token Intel      |
| **Identity Defense** | Breach exposure, phone metadata, username reuse, and public identity links.          | Identity Defense |
| **Threat Intel**     | Phishing domains, fake claims, site posture, and risky web infrastructure.           | Threat Intel     |
| **AI Analyst**       | Natural-language investigations, risk summaries, project briefs, and action plans.   | AI Analyst       |
| **Case Files**       | Saved scan results, reports, and exportable evidence history.                        | Case Files       |

### Data Sources

PRIVAI is designed to use a mix of direct APIs, on-chain data, and background browser workers where appropriate.

| Source                     | Used For                                                                      |
| -------------------------- | ----------------------------------------------------------------------------- |
| **Solana RPC / Helius**    | Wallet history, balances, token accounts, mint metadata, transaction samples. |
| **DEX Screener**           | Token pair context, liquidity, market data, social/profile links.             |
| **RugCheck**               | Solana token risk report and risk signal enrichment.                          |
| **VirusTotal**             | Domain and URL reputation checks.                                             |
| **urlscan**                | Domain and web infrastructure scan context.                                   |
| **Numverify**              | Phone metadata lookup.                                                        |
| **DeHashed / Leak-Lookup** | Breach intelligence lookup where API authorization and rate limits permit.    |
| **Etherscan**              | Ethereum contract/source enrichment where configured.                         |
| **GoPlus**                 | Token security enrichment where configured.                                   |
| **Husher**                 | Bridge quote, create, and status provider for the Tor Bridge module.          |
| **Jupiter**                | Solana swap quotes and swap transaction building.                             |
| **Uniswap**                | EVM swap handoff URL for the MVP.                                             |

### Design Principles

| Principle                  | Meaning                                                                                      |
| -------------------------- | -------------------------------------------------------------------------------------------- |
| **Verify once**            | Token gating should unlock the OS, not interrupt every module.                               |
| **Evidence first**         | Reports should connect conclusions to observable signals.                                    |
| **Defensive scope**        | The product must avoid laundering, evasion, phishing, malware, or wallet-draining use cases. |
| **Readable output**        | Risk reports should be understandable without specialist tooling.                            |
| **Redaction by default**   | Sensitive identity and breach data should be masked or summarized.                           |
| **Local-first Case Files** | MVP scan history is saved in the browser and exportable by the user.                         |

### Current Technical Limits

| Area                    | Current Limitation                                                                                                            |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Chain support**       | Solana-first. Ethereum support exists only for selected contract/token enrichment. Other EVM chains are planned.              |
| **Case Files**          | Saved scan history is browser-local and exportable, not yet a multi-device account database.                                  |
| **Wallet graph**        | Current graphing is one-hop. Multi-hop cluster scoring is planned.                                                            |
| **Breach intelligence** | Depends on provider API authorization and configured credentials.                                                             |
| **Background browser**  | Used selectively; direct APIs are preferred where possible.                                                                   |
| **Tor routing**         | Some providers reject Tor directly. PRIVAI may use a verified private relay fallback while preserving DEFCON session context. |
| **Tor Swap**            | Solana is active through Jupiter. EVM currently opens Uniswap and does not yet build or sign EVM transactions inside PRIVAI.  |
| **Tor Bridge**          | Provider minimums, symbols, networks, receive addresses, and provider-side availability can reject orders.                    |
| **Watchlists**          | Staged for later because they require scheduled jobs, alerts, and false-positive handling.                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wiki.privai.cloud/product-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
