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

# Compliance freeze design

Compliance freeze is the **on-chain half** of Privacy Core compliance (Layer 2 — post-hoc note freeze). For entry/exit address screening (Layer 1, off-chain TRM + Chainalysis) and the full operational model, see [Compliance implementation](/plabs-docs/privacy-core/compliance-implementation.md).

Compliance freeze is Privacy Core’s **explicit extension** over Zcash Orchard: the circuit proves spent notes are **not** on an admin-maintained blacklist.

## Goals

| Goal                  | Mechanism                                                  |
| --------------------- | ---------------------------------------------------------- |
| Sanctions / blacklist | Off-chain set, on-chain root updates                       |
| Hide list contents    | Only Merkle root public                                    |
| No bypass             | Prove **input** `cm_old` non-membership (not output `cmx`) |

## Indexed Merkle Tree (IMT)

| Parameter   | Value                                    |
| ----------- | ---------------------------------------- |
| Depth       | 20                                       |
| Leaf format | Ordered `(val, next_val)` low-leaf chain |
| Empty root  | `0`                                      |
| On-chain    | `cmxFrozenRoot()`                        |

Admin rebuilds IMT off-chain, then `setFrozenRoot(newRoot)`.

## Circuit: `FrozenCmxNonMember`

Witness includes low-leaf bracket + IMT path proving `cm_old` falls in a gap → not in frozen sorted set.

### Why bind cm\_old not cmx (audit H-01)

Binding only output `cmx` lets attacker spend frozen note with fresh output randomness. **Input commitment** must be constrained.

## On-chain: pubFields\[7]

```
pubFields[7] == cmxFrozenRoot()   // else BadFrozenRoot
```

Each action’s Groth16 public input commits to this root via `pub_hash`.

## Trust trade-off

Admin can freeze identified notes. Should use multisig / timelock in production.

## Shared by applications

* **pERC20**: per-pool `cmxFrozenRoot`
* **pSWAP**: each leg must pass non-membership in its pool

## Admin workflow

1. Identify `cmx` to freeze off-chain
2. Rebuild IMT → new root
3. `setFrozenRoot(newRoot)`
4. Wallets/provers use new root in witness

## Next

* [Compliance implementation](/plabs-docs/privacy-core/compliance-implementation.md) — entry/exit screening + freeze overview
* [Universal call format](/plabs-docs/privacy-core/universal-call-format.md)
* [pERC20 overview](/plabs-docs/privacy-core/perc20/overview.md)


---

# 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://plabs.gitbook.io/plabs-docs/privacy-core/compliance-freeze.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.
