> For the complete documentation index, see [llms.txt](https://singularityzk.gitbook.io/singularity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://singularityzk.gitbook.io/singularity/darkswap-onchain-darkpool/darkswap-faqs/technology-overview.md).

# Technology Overview

### Singularity’s Darkswap – Technical FAQ

### **1. How does private execution work in Darkswap?**

Darkswap submits orders through Singularity’s zero-knowledge execution layer.\
Users generate encrypted intents locally, and the settlement contract verifies validity via zk-proofs — ensuring trades execute correctly without exposing asset, size, or direction.

### **2. How does the matching engine operate without revealing order details?**

Obfuscated orders are sent to the matching coordinator.\
The matcher pairs compatible orders and produces proofs attesting that:

* Price conditions were respected
* Balances were sufficient
* Counterparty matching was valid\
  These proofs are then verified on-chain before settlement occurs.

### **3. How does non-custodial settlement work if trade data is private?**

The settlement contract sees only:

* Validity proof
* Token movement outcome\
  It never sees the input order metadata.\
  This achieves **auditable settlement** while preserving **transaction confidentiality**.

### **4. How are market makers integrated into Darkswap without leaking inventory signals?**

Market makers run a **local Maker API server**:

* They stream bulk orders privately
* Manage inventory without exposing order flow
* Receive fills through encrypted channels, then settlement happens on-chain via proofs

A GUI version is planned to support professional trading workflows without needing local infra.

### **5. How does Darkswap prevent MEV and order leakage?**

Orders never enter the public mempool.\
Because no asset/size/side metadata leaks, searchers cannot detect or frontrun execution — removing sandwiching, liquidity probing, and footprint tracking.

### **6. How can trades be verified if nobody sees the orderbook?**

Verifiability moves from inspection to **provability**:

* The matching engine generates proofs
* Settlement verifies them\
  This replaces transparent mempool visibility with cryptographic correctness guarantees.

### **7. How will matching decentralize in the roadmap?**

Darkswap moves toward a **P2P matching network** where:

* No node sees the full orderbook
* Peers hold partial encrypted state
* Matching is coordinated through zk-validated interactions

This eliminates reliance on a central coordinator while preserving privacy.

### **8. What happens when assets exit the darkpool?**

Withdrawals send tokens back to a public address.\
Balances are visible again, but **trade history remains unrecoverable** — observers cannot see how deposits evolved into outputs.


---

# 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://singularityzk.gitbook.io/singularity/darkswap-onchain-darkpool/darkswap-faqs/technology-overview.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.
