# Replay Defense and Nullifier Cache

The replay nullifier cache is a runtime component maintained by each seller process independently. When a seller accepts a ZK-proof-gated inference request, it extracts the nullifier from the proof artifact and checks it against an in-memory cache that is also backed by a persistent file on disk for durability across process restarts. If the nullifier is already present in the cache and the TTL window for that nullifier is still active, the request is rejected with a replay error. If the nullifier is new, the proof is accepted, the nullifier is written to the cache, and processing continues.

Nullifiers are rotated out of the active cache after their TTL window expires. This prevents unbounded cache growth over long seller uptimes while still maintaining replay protection within any operationally relevant window. The TTL duration is a configuration parameter that operators tune based on the expected maximum delay between proof generation at the buyer and proof verification at the seller.

This mechanism closes a specific and serious attack surface. A valid inference request — complete with a correctly formed ZK proof, properly encrypted payload, and signed payment authorization — contains everything needed to pass the seller's verification pipeline. Without nullifier binding and cache-based rejection, an attacker who intercepts such a request could resubmit it to obtain additional inference outputs without the buyer's knowledge or any additional payment. The nullifier cache prevents this by making each proof instance single-use.

<br>


---

# Agent Instructions: 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:

```
GET https://docs.openshard.ai/core-concepts/privacy-mechanism/replay-defense-and-nullifier-cache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
