> 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/components.md).

# Components

### Overview <a href="#overview" id="overview"></a>

Nullmask consists of four main components that work together to provide privacy-preserving transactions.

### Wallet <a href="#wallet" id="wallet"></a>

Any standard EVM wallet that supports:

* **Custom networks** (custom RPC endpoints)
* **`personal_sign`** method (for key generation)
* **EIP-1559** transactions

### RPC Proxy <a href="#rpc-proxy" id="rpc-proxy"></a>

The core orchestration service. It sits between the wallet and the blockchain, intercepting JSON-RPC calls.

**Responsibilities:**

* **Key management** — Generates viewing keys and receiving keys from wallet signatures; stores them locally
* **Transaction shielding** — Parses transaction intent, selects funding notes, generates ZK proofs
* **Balance tracking** — Scans the blockchain for new notes, trial-decrypts them, maintains shielded balances
* **State isolation** — Per-user state via access tokens (HTTP-only cookies)
* **Key registry sync** — Caches on-chain receiving keys for privacy-preserving lookups

### Relayer <a href="#relayer" id="relayer"></a>

Executes shielded transactions on behalf of users.

**Responsibilities:**

* Receives shielded transaction data (proof + public inputs) from the proxy
* Submits transactions to the Nullmask contract
* Pays gas fees (reimbursed from the transaction's fee allocation)
* Hides the sender's IP address and identity

The relayer never sees the transaction contents — it only forwards the opaque proof and public inputs.

### Guard <a href="#guard" id="guard"></a>

Approves or rejects deposits entering the privacy pool.

**Responsibilities:**

* Monitors pending deposits on the contract
* Screens depositing addresses using chain analysis tools
* Approves legitimate deposits (adds note commitments to the Merkle tree)
* Rejects flagged deposits (refunds the depositor)
* Publishes revocation keys with each approved deposit

### Smart Contract (Nullmask.sol) <a href="#smart-contract-nullmask.sol" id="smart-contract-nullmask.sol"></a>

The on-chain privacy pool. Deployed behind a UUPS proxy for upgradeability.

**Responsibilities:**

* Verifies ZK proofs using on-chain verifier contracts
* Manages the note commitment Merkle tree (LeanIMT with Poseidon2)
* Tracks spent nullifiers (note nullifiers and transaction nullifiers)
* Holds deposited funds (ETH and ERC-20 tokens)
* Executes Uniswap V2 swaps during shielded swap operations
* Maintains a key registry for receiving key registration
* Manages token whitelist


---

# 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/components.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.
