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

# Proof of Ownership/Access

This is the design doc for proof of ownership

The Aim for the circuit was to with one proof access to all the owner's access.This was done through `MerkleMaps`.<br>

<figure><img src="https://2666457903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdhKgRDf5sPua7CTobSuG%2Fuploads%2FKdKbN1A66AguRVcsZMN7%2Fimage.png?alt=media&amp;token=c59691a1-0dc3-48b9-9932-54ac01f9fc94" alt=""><figcaption></figcaption></figure>

## Recursive zkSnarks

Recursive zkSNARK circuits in this setup ensure two key technical guarantees:

1. **Valid Ownership Across Orders**:
   * The recursive nature of the circuit enforces that all previous orders in the sequence belong to the user. This is achieved by requiring the verification of the previous proof (`lastProof.verify()`) in the `canAccessAllTheOrders()` method.
   * Each proof includes the public output of the prior proof, such as the `root` and `orderId`. The validity of the previous proof implies that all previous orders were verified correctly, ensuring that the user owned those orders.
   * This design recursively links all previous proofs, so the latest proof indirectly verifies the entire sequence of order ownership up to the current one.
2. **Efficient Verification of New Orders**:
   * When a new order is created, instead of verifying each order individually and generating a separate proof for each, the recursive zkSNARK enables the user to simply verify the latest proof in the chain.
   * By verifying the recursive proof, the system implicitly validates the entire history of orders, as each proof in the chain depends on the successful verification of the previous one.
   * This drastically reduces computational overhead: instead of `O(n)` verifications for `n` orders, only a single proof verification is needed, making the process scalable and efficient.
