> For the complete documentation index, see [llms.txt](https://docs.fairway.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fairway.global/developers/core-concepts/zero-knowledge-proofs-midnight.md).

# Zero-Knowledge Proofs (Midnight)

### Flow

<figure><img src="/files/MAK0h05cZkY3t1qYdD7p" alt=""><figcaption></figcaption></figure>

***

### What’s Proven in the Circuit

* The user’s **KYC data** satisfies required rules (e.g., `KYC2_OK`, jurisdiction).
* The proof is **bound to a specific wallet address**.
* The proof is linked to a **timestamp of KYC verification** (`kyc_verified_at`).
* The proof is **anchored on Midnight** as an immutable reference (`midnight_ref`).
* Cross-chain (Cardano/EVM) contracts only verify **Merkle membership, Fairway sig, sanctions\_epoch, and KYC recency** — no raw PII.

***

### Verifier Checklist (Cardano/EVM)

* ✅ Verify **Merkle membership** for `address`.
* ✅ Verify **Fairway signature** over `(root, sanctions_epoch, midnight_ref)`.
* ✅ Enforce **KYC recency** → `now - kyc_verified_at ≤ max_age`.
* ✅ Enforce **sanctions freshness** → `sanctions_epoch == latestEpochRoot`.
* ⬜ Optional audit: **resolve `midnight_ref`** on Midnight for regulator review.

***

### Notes on Keys & Curves

* **Fairway signature** uses chain-appropriate keys:
  * secp256k1 for EVM chains.
  * Cardano-compatible key for UTXO scripts.
* Midnight Compact supports Schnorr signatures inside circuits.
* On-chain verifiers don’t recompute the ZK — they only check Fairway’s signature + Merkle inclusion.

***

### Next Steps

* See [Build on Cardano](https://fairway.gitbook.io/docs/~/revisions/2bV85LKrNLQL0C6MEOcr/developers/build-on-cardano) → validator checks for Merkle, timestamp, and sanctions epoch.
* See [Build on EVM](https://fairway.gitbook.io/docs/~/revisions/2bV85LKrNLQL0C6MEOcr/developers/build-on-evm) → attestation schema with `kyc_verified_at` + `sanctions_epoch`.
* Review[ Revocation Epochs & Freshness](https://fairway.gitbook.io/docs/~/revisions/2bV85LKrNLQL0C6MEOcr/developers/core-concepts/revocation-epochs-and-freshness) → how long-term KYC vs short-term sanctions are combined.
