# What is Fairway?

Fairway is a **decentralized compliance infrastructure** for making **KYC/AML checks programmable** across **Cardano, Midnight, and EVM,** without putting PII on-chain.

We store KYC data in **decentralized off-chain storage** (the “Vault”), use a **Fairway Cloud Agent** via API with a **Witness** to generate a **Midnight ZK-proof** *bound to a specific wallet address*, and record that proof on **Midnight’s public ledger**.

A reference to that Midnight proof (the **proof UTXO**) is then **embedded in Merkle trees** on Cardano and/or EVM, alongside Fairway’s signature and the user’s eligibility flags. dApps verify **Merkle membership + Fairway signature + epoch freshness**, and can later **audit** the referenced Midnight UTXO.

***

### Why It Matters

* **For Developers** → add a single eligibility check (Merkle inclusion + signature verify) to your validator/contract.
* **For Institutions** → get auditability (via Midnight proof references) without handling raw PII on-chain.
* **For Users** → prove once, reuse across chains; no document leakage.

***

### How It Works

<figure><img src="/files/53ZdDIWSUt4ZaWkZnamT" alt=""><figcaption></figcaption></figure>

**Core components**

* **Vault (decentralized storage)** — holds KYC documents/PII **off-chain**.
* **Cloud Agent** — verifies inputs, runs Witness logic, and **generates ZK-proofs on Midnight** bound to the user’s wallet.
* **Midnight proof UTXO** — immutable record of the ZK result on Midnight’s public ledger.
* **Merkle Trees (Cardano & EVM)** — compact allowlists of **wallet → claims/flags + midnight\_ref**, signed by Fairway.
* **Policy Engine** — dApp-side rule evaluation (YES/NO) based on Merkle membership + epoch freshness.

***

### Merkle Leaf (Cardano/EVM) — canonical fields

```json
{
  "address": "addr1... | 0x...",
  "claims": ["KYC1_OK", "EU_RESIDENT"],
  "midnight_ref": "0x<txid>#<index>",
  "epoch": 391,
  "fairway_sig": "sig(fairway_key, hash(root || epoch || midnight_ref))"
}

```

**Verifier MUST:**

1. Verify **Merkle membership** of `address` with the on-chain root.
2. Verify **Fairway signature** over `(root, epoch, midnight_ref)` using the chain-appropriate key.
3. Enforce **epoch freshness** (revocation).
4. (Optional, for audits) Resolve `midnight_ref` on Midnight to validate provenance.

> EVM note: you can integrate via (A) Merkle allowlist guard or (B) ERC-3643 adapter that internally checks Fairway eligibility. Both carry the midnight\_ref for auditability.

***

### Key Principles

* **No PII on-chain** — only commitments, signatures, and references.
* **Auditability by reference** — every Merkle leaf links to a **Midnight proof UTXO**.
* **Composable** — same proof powers Cardano and EVM integrations.

***


---

# 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.fairway.global/~/revisions/rnSjZBEQmp5ZhwBkzR4G/developers/readme/what-is-fairway.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.
