> For the complete documentation index, see [llms.txt](https://docs.nullmask.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nullmask.pro/virtual-network.md).

# Virtual Network

### Concept <a href="#concept" id="concept"></a>

Nullmask introduces itself to the user's wallet as a **virtual private EVM network**. This is not a real blockchain — it is a mechanism that places a custom RPC proxy between the wallet and the actual blockchain node.

### How It Works <a href="#how-it-works" id="how-it-works"></a>

#### Adding the Network <a href="#adding-the-network" id="adding-the-network"></a>

During onboarding, the user's wallet is prompted to add a new network with:

* **Network Name**: Nullmask (or chain-specific name)
* **RPC URL**: The proxy server URL with an embedded access token
* **Chain ID**: A virtual chain ID (e.g., 43615 for Ethereum Mainnet)
* **Currency Symbol**: ETH (same as the underlying chain)

All these parameters are preconfigured by the app — the user only confirms a wallet dialog.

#### Transaction Interception <a href="#transaction-interception" id="transaction-interception"></a>

When the user sends a transaction on the Nullmask network:

1. The wallet constructs and signs a standard EIP-1559 transaction
2. The wallet sends `eth_sendTransaction` (or `eth_sendRawTransaction`) to the proxy
3. The proxy detects it as a value transfer and shields it:
   * Translates 0x address to shielded address
   * Generates a ZK proof
   * Submits via the relayer
4. The proxy returns a transaction status to the wallet

#### Balance Queries <a href="#balance-queries" id="balance-queries"></a>

When the wallet queries `eth_getBalance` or ERC-20 `balanceOf`:

1. The proxy intercepts the call
2. Instead of querying the blockchain, it returns the user's **shielded balance** from local note storage
3. The wallet displays the shielded balance as if it were a normal balance

#### Access Token <a href="#access-token" id="access-token"></a>

Unlike a traditional RPC node where all data is public, the Nullmask proxy must restrict data access. An access token is embedded in the RPC URL and stored as an HTTP-only cookie. This token:

* Derives from the user's ECDSA signature (deterministic)
* Isolates each user's private data (keys, notes, transactions)
* Persists across sessions via secure cookies

### Local vs Remote Deployment <a href="#local-vs-remote-deployment" id="local-vs-remote-deployment"></a>

The proxy can run in two modes:

#### Remote Server <a href="#remote-server" id="remote-server"></a>

* Accessed via a web page (the default deployment)
* Full on-chain privacy is maintained
* The server operator can observe user transfers
* No installation required

#### Local Device <a href="#local-device" id="local-device"></a>

* Runs on the user's mobile device or as a browser extension
* Full privacy — no third party sees transfers
* Requires installation


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nullmask.pro/virtual-network.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
