Fondaco Preprod — not mainnet

Threat model

Who sees what, and what stops misuse

What the relay, a solver, the chain, the edge provider and an attacker with the database can each see and do in a Fondaco swap. For what you choose to keep private, see what is private.

Rendered from docs/threat-model.md, last changed 27 November 2026.

Draft v0.1 — 11 November 2026 — for review before publication (security-hardening §3). Who sees what in a Fondaco swap, what each party can do with it, and what stops the things that should not happen. It describes the current version on Preprod; where mainnet will differ, it says so.

Scope

A swap involves a user's wallet (or an app built on the wallet SDK), the relay, the solvers that quote, the winning solver or the matcher, the Midnight chain, and the edge in front of the relay. The relay never holds funds: a solver settles from its own coins and the wallet signs its own side. Privacy on Midnight is a property of each leg: a shielded token's leg hides amount, coins and the link to the user; an unshielded token's leg (NIGHT) shows the address and the amount. The user's privacy level (privacy-levels.md) constrains the user's legs only; it does not change what the relay or a solver sees.

Who sees what

PartySeesDoes not see
Anyone reading the chainEvery unshielded output and input: for a NIGHT leg, the user's NIGHT address and amount, and the solver's NIGHT input. The DUST fee paid. That a transaction happened, its nullifiers and commitments. An MIP-0006 open order's imbalances (amounts and token types, not identities)Shielded amounts, coins and change; the fee amounts and recipients; which shielded inputs belong to whom
The relay (Fondaco)The request: pair, size, privacy level, app key, the user's IP and country as the edge reports them. Every quote. For user_offer, the offer bytes; for solver_offer, the solver's leg. The user's receiver address. Fee-output openings (token, value, recipient). Fill status and the transaction idThe user's keys; the user's shielded balance; any link between the shielded inputs and a person beyond what the request itself carries; a compliant disclosure record (stored encrypted, unreadable to the relay)
A solver that quotesThe pair and the size of each request it is sent, and the privacy level; whether its own quote wonWho asked; the user's IP; other solvers' quotes before the release; the user's address, unless it wins
The winning solverThe accepted terms and the user's receiver address; the user's offer bytes (user_offer) or its own leg and the merged transaction (solver_offer)The user's keys and other coins; the user's IP
The matcherThe resting offers on the book and the requests it crosses against themAs a solver
The wallet or app that brought the tradeEverything about its own user's trade, and its statement of fills and feesOther apps' flow
The edge providerIP, country, request paths, and — where TLS terminates at the edge — request and response bodiesAnything the relay itself does not see

What each party can do, and what stops it

PartyCould try toWhat stops it
A solverQuote and then not deliver (a fade)The quote is signed and binds until it expires. A fade costs 50 bps of the notional from the solver's bond (5–500 USDM); fulfilment under 95% over 7 days suspends (solver-programme.md)
A solverDeliver a leg that pays the user less, or drops the fee outputsThe wallet SDK checks the leg against the quote before the wallet signs; the relay verifies every leg and its fee openings before passing it on, and finds the fee commitments in the finalized transaction. A fee breach costs the penalty cap and suspends
A solverAlter the user's offerAn offer file is proven; any change invalidates it. The ledger settles both legs together or neither
A user or anyonePost the same coins in many offersThe book takes one offer per input; the second post is refused, on any relay node
The relayTell a wallet a worse quote was the best, or dispatch a job the solver did not agree toThe attestation commits to every quote by digest and is signed with the relay key the SDKs pin; each firm quote carries its solver's signature; solvers check every accept and job against their own quotes
The relayMove user or solver fundsIt holds none and signs no transaction that spends them
The relayRead shielded amounts or link shielded inputs to a personZswap's proofs: the relay sees the same public view as the chain, plus what the request itself states
An attacker who steals the relay signing keyForge attestations and job dispatches until the key is rotatedRotation with an overlap window; the key-management decision moves it into a KMS (m1/key-management.md). It still cannot move funds
An attacker who steals a solver's wallet seedSpend that solver's inventoryHot inventory is capped; the rest is held cold (m1/key-management.md). Users' funds are not exposed
An attacker with the relay databaseRead requests, fills, quote snapshots, receiver addresses of unshielded legs, fee records and statements; try to rewrite the recordNo keys or seeds are stored there; solver bearer tokens are stored only as hashes; the audit log is hash-chained, so a rewrite shows. Database traffic is TLS-verified outside the devnet
Someone forging a locationReach the service from a declined countryThe edge strips any incoming country header and sets its own; the relay trusts the header only from configured proxies, and with the location rule on, declines a request that has none
A flood of requestsExhaust the relayPer-IP rate limits at the edge and in the relay, per-IP connection caps, a cap on quote frames per solver, and kill switches the on-call can reach in under a minute
One region failingSettle a fill twice or lose oneOnly the home region writes money-moving state, under a lease; a home that loses the lease stops its fills; a fill is rebuilt from its record after a failover

What is not protected

  • The NIGHT leg is public. Until a shielded form of NIGHT is listed, a buy or sell of NIGHT shows the user's NIGHT address and amount on any explorer. The swap says so before the wallet signs.
  • The relay sees the request. Pair, size, the user's receiver and their IP reach the relay. It keeps request logs for 30 days and fills for as long as the law requires (legal-pages §1).
  • A quote can go stale. A user offer is all-or-nothing and binds until its expiry; it can be cancelled before then only by spending one of its inputs.
  • The winning solver learns the counterparty's receiver. It needs it to pay out.
  • Bridged assets carry their bridge's assumptions. No bridged asset is listed today. Before one is (Nightmode's vault assets, the Cardano rails' tokens), this document will state who holds the bridge's keys and what happens if they misbehave.

Open items

  • The key-management option for the relay key (m1/key-management.md §5 recommends a KMS).
  • The edge provider and where TLS terminates, which decides whether the provider sees bodies.
  • Ledger viewing keys (Foundation roadmap, Q1 2027), which will move compliant disclosure on chain.
  • Counsel's review of the data list on the privacy page.