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

# Overview

The Nullmask protocol enables privacy-preserving transactions on EVM chains using zero-knowledge proofs. This section provides the formal cryptographic specification.

## Core Concepts

| Concept                   | Description                                                                                                                                           |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Notes**                 | Private UTXOs — encrypted value containers. Note commitments are stored in an on-chain Merkle tree; encrypted note data is emitted in contract events |
| **Nullifiers**            | Unique spend identifiers that prevent double-spending without revealing which note was spent                                                          |
| **Viewing Key**           | Enables decryption of incoming and outgoing notes; grants view access to transaction history                                                          |
| **Receiving Key**         | Public key registered on-chain that enables others to send shielded funds to an address                                                               |
| **Transaction Nullifier** | Prevents replay of signed transactions by a malicious proxy                                                                                           |

## Cryptographic Stack

| Primitive       | Purpose                                                                         |
| --------------- | ------------------------------------------------------------------------------- |
| Poseidon2 T4    | Hash function for note commitments, nullifiers, key derivation, and Merkle tree |
| LeanIMT         | Incremental Merkle tree for note storage (depth 16, \~65K leaves)               |
| Grumpkin        | Embedded curve for key exchange and encryption                                  |
| secp256k1 ECDSA | Transaction signature verification (standard Ethereum signatures)               |
| UltraHonk       | ZK proof system (Barretenberg prover)                                           |

## Notation

Throughout this specification:

* $$\mathbb{E}$$ denotes the Grumpkin embedded curve
* $$\mathbb{F}$$ denotes the base field of $$\mathbb{E}$$ (scalar field of BN254)
* $$\mathsf{G}$$ denotes the generator point of $$\mathbb{E}$$
* $$\operatorname{Poseidon2T4}(x)$$ denotes the Poseidon2 hash function with state width 4


---

# 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://docs.nullmask.io/protocol-specification/protocol.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.
