Fondaco Preprod — not mainnet

How it works

A swap, station by station

The example trade: 100 USDM for NIGHT. You ask for a price, independent solvers compete to fill it, and the trade settles in one atomic transaction on Midnight. Walk through it, or press play; the cards under each step show who learns what.

DUST
the resource that pays Midnight's network fees; it accrues to NIGHT holders and cannot be traded.
Zswap
Midnight's shielded-coin ledger: amounts and owners are hidden behind zero-knowledge proofs.
offer file
a proven, imbalanced transaction that gives one token and wants another (MIP-0005); anyone can complete it, nobody can change it.
solver
an independent, bonded party that quotes prices from its own inventory and completes the trade.

The walkthrough

Six stations, one transaction

Two settlement paths exist and both have filled on Preprod: you prove first with an offer file, or the winning solver proves its leg first and your wallet balances it.

Who proves first:
The offer file as MIP-0005 writes it: you need no NIGHT and no DUST.

Two settlement paths exist. In the first, the offer file as MIP-0005 writes it: you need no NIGHT and no DUST. In the second, the web swap's path: your wallet balances a leg the solver has already proved. Steps 4 and 5 differ between them; both are shown below.

Step 1 You ask for a price

Your wallet, or the web swap, posts a request for a quote to the relay: the pair, the size, and which settlement paths it can do. Before anything reaches a solver the relay checks the kill switch, the app key, rate limits, compliance (receiver, source, location) and the reference price. Nothing touches the chain.

POST /api/v2/rfq { give: 100 USDM, want: NIGHT, settlements: [user_offer, solver_offer] }

You

amountpairyour keys

Relay

pairsizeapp key

Solvers

learns nothing

Chain

learns nothing

Step 2 The relay fans it out

The relay sends the request to every admitted solver and to the matcher, and reads the live ladders. After a short minimum wait it ranks the answers (price, then reputation, then arrival), signs one attestation of the request and every quote, and returns them. Your wallet checks the attestation against the relay key it holds before it uses any of it. Measured on Preprod: quotes back in about ≈ 0.3 s.

rfq.request → maker-1, ext-alpha, matcher
← quotes + attestation

You

all quotesattestation

Relay

pairsizerequest id

Solvers

pairsize

Chain

learns nothing

Step 3 Solvers compete

Each solver prices from its own inventory and signs a firm quote: the request terms, both amounts, the settlement path, its fee declaration and an expiry. The signature binds it and a bond stands behind it: fading an accepted quote costs 50 bps of the notional from the bond. The matcher may quote from resting user offers instead of inventory. The best quote wins.

maker-1: firm quote, signed   ext-alpha: firm quote, signed   matcher: no cross
→ best: maker-1

You

every quote

Relay

every quote

Solvers

their own quotewon or lost

Chain

learns nothing

Step 4 · when you prove first Your wallet makes the offer

You accept. Your wallet builds an offer at the quoted price and proves it on your device: about ≈ 5 s on Preprod. The offer is a proven but imbalanced transaction — it gives USDM and wants NIGHT to your address — encoded as a swapoffer1… string. You need no NIGHT and no DUST; the solver completes it and pays. The relay checks the offer, screens its sources, confirms its inputs are unspent and sends a signed job to the winner.

makeIntent → proof ✓   swapoffer1qpz…k7d2
relay: well-formed ✓ inputs live ✓ screened ✓   job → maker-1

You

amountyour coinsproof witness

Relay

offer bytes

Solvers

maker-1: offer bytes

Chain

learns nothing

Step 5 · when you prove first The solver completes it

The winning solver checks the offer against the quote it signed, then adds its own leg (gives NIGHT, takes USDM), the protocol-fee and app-fee outputs, and the DUST that pays the network fee. It merges the two into one transaction, submits it, and reports the transaction and the fee openings to the relay. Measured on the devnet with real proofs: about ≈ 29 KB and ≈ 2.8 DUST per fill at a blank ledger's prices.

merge( yourOffer, solverLeg )  deltas { USDM: 0, NIGHT: 0 }
submit

You

nothing new

Relay

status: submitted

Solvers

maker-1: full trade

Chain

a transaction arrived

Step 4 · when the solver proves first The winning solver proves its leg

You accept; the relay reserves the quote — of thirty simultaneous accepts of one quote, one wins and the rest are refused — and sends the terms to the solver. It builds a leg that pays NIGHT to your address, wants your USDM and carries the fee outputs, and proves it: 3.7 s for a 200-NIGHT lot on Preprod. The relay verifies the leg (the payout to you, the fee openings, the expiry) and hands it to your wallet.

rfq.accept → maker-1
rfq.made: leg, proof ✓   relay: verified ✓ → wallet

You

the leg, your payout

Relay

leg bytesfee openings

Solvers

maker-1: its leg

Chain

learns nothing

Step 5 · when the solver proves first Your wallet balances it and submits

Your wallet adds the USDM input and change, proves its side (6–8 s on Preprod, proving included) and pays the network fee in DUST: 0.72–0.95 DUST measured, where the relay had estimated 3 DUST. Or it balances without DUST and the solver sponsors the fee. Then it submits the merged transaction.

balanceSealedTransaction( leg )  proof ✓
fee paid in DUST (or sponsored)   submit

You

full trade

Relay

status: submitted

Solvers

maker-1: its leg

Chain

a transaction arrived

Step 6 The ledger settles it

Blocks are six seconds and Preprod finalises in 25–30 s, so a whole swap takes 34–37 s from request to final. Every node verifies the proofs; either both legs settle or neither does. The relay marks the fill final once the fee-output commitments appear in the transaction's public view. NIGHT is an unshielded token, so its leg is public: your NIGHT output (address and amount) and the solver's NIGHT input. The USDM amount and coins, the fee amounts and any link from the shielded inputs to you stay hidden.

block #…  finalized
NIGHT → your address : amount           (public)
USDM leg: nullifiers, commitments       (hidden)
network fee in DUST                     (public)

You

your own history that you received NIGHT

Relay

tx idfee commitments

Solvers

maker-1: full trade tx id

Chain

USDM amountfee amountswho spent what NIGHT amountyour NIGHT addressDUST feenullifierscommitments

hidden only the named party knows it public anyone reading the chain can see it

Measured on Preprod, 10 November 2026: quote ≈ 0.3 s your proof ≈ 5 s wallet balancing a solver's leg 6–8 s finality 25–30 s request → final 33.7–36.9 s

Try a quote

Your view, and what the chain shows

Two example solvers quote. Accept the better one, let it fill, then switch between what you see and what anyone reading the chain sees. The winning spread in the devnet measurement run was 12 bps with 3 quotes per request.

Illustrative · price fixed at 0.04 USDM per NIGHT for the example, not a market price

Fees on top of the spread: the protocol fee, 4 bps (30% of it goes to the wallet or app that brought the trade), and on Fondaco's own web swap an app fee of 12 bps. A wallet that embeds the SDK sets its own app fee instead.

Solver A · best

2,493 NIGHT

for 100.00 USDM · spread 12 bps + 4 protocol + 12 app

Solver B

2,492 NIGHT

for 100.00 USDM · spread 16 bps + 4 protocol + 12 app

Your offer file (MIP-0005)

give  : 100.00 USDM (shielded)
want  : ≥ 2,493 NIGHT → your address
ttl   : 10 min
proof : generated on your device

An offer is a proven but imbalanced transaction: it gives one token and wants another. Anyone holding the other side can complete it; nobody can change it. It expires at the time written into it. On the web swap the order is reversed: the solver proves its leg first and your wallet balances it.

The merged transaction

Your view
LegUSDMNIGHTNetwork fee
Your offer+100.00−2,493—
Solver A's leg−99.84+2,493paid in DUST by the solver
Protocol fee output (4 bps; 30% to the channel)−0.0400——
App fee output (12 bps, the front-end's)−0.1200——
Merged total00

Positive means the transaction releases that token, negative means it needs it. The merged totals are zero for every token, which is exactly what the ledger checks.

What the chain shows
FieldOn the explorer
NIGHT paid to youthe amount, to your NIGHT address (NIGHT is unshielded)
The solver's NIGHT inputone NIGHT output spent
USDM amounthidden
Your USDM coins and changehidden — nullifiers and new commitments only
Fee outputshidden amounts, one commitment each
Who spent the shielded inputshidden
Network feethe DUST paid, as declared

NIGHT is Midnight's unshielded token, so its leg is as public as on any chain; the shielded side and the fees are not. Trade a shielded pair instead — USDM for a shielded token — and both of your legs disappear from the explorer.

Privacy level

Choose what the chain can see

Privacy on Midnight belongs to each leg, not to the venue. A request names its level, the relay refuses a quote that would break it, and the swap says in one sentence what will be public before your wallet signs.

Not live yet. The privacy level ships in the relay, the wallet SDK and the web swap before mainnet (docs/privacy-levels.md). Until then every fill is what the public level describes: the NIGHT leg is public, the shielded side hidden.

Your trade
Privacy level

You receive NIGHT. NIGHT is public on Midnight: the explorer will show your NIGHT address and the amount. The USDM you pay stays hidden.

Not available for NIGHT yet. Choose a shielded pair, or receive NIGHT publicly.

As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.

The NIGHT you sell is public: your NIGHT address and the amount. The USDM you receive stays hidden.

Not available for NIGHT yet. Choose a shielded pair, or receive NIGHT publicly.

As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.

Not offered: both tokens of this pair are shielded, so the selector shows shielded and compliant only.

Nothing about this trade is visible on the explorer beyond that a transaction happened.

As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.

What the swap tells you before your wallet signs
Your tradePublicShieldedCompliant
Buy NIGHT with USDMYou receive NIGHT. NIGHT is public on Midnight: the explorer will show your NIGHT address and the amount. The USDM you pay stays hidden.Not available for NIGHT yet. Choose a shielded pair, or receive NIGHT publicly.As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.
Sell NIGHT for USDMThe NIGHT you sell is public: your NIGHT address and the amount. The USDM you receive stays hidden.Not available for NIGHT yet. Choose a shielded pair, or receive NIGHT publicly.As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.
A shielded pair (USDM ↔ a shielded token)Not offered: the pair is shieldedNothing about this trade is visible on the explorer beyond that a transaction happened.As shielded, plus a disclosure record your wallet encrypts to a key you keep. Hand the key to an auditor if you need to.

Shielded delivery of NIGHT needs SNIGHT, a shielded form of NIGHT, to be listed; until then a shielded request for NIGHT is refused with this sentence rather than quietly filled in public. The compliant level's disclosure record is encrypted to a key only you hold. All three levels, leg by leg.

Who you trust

The same outcome as NEAR's confidential rail, a weaker trust assumption

NEAR made confidential swaps the default on near.com in August 2026, using a separate shard run by permissioned validators inside hardware enclaves. On Midnight, hidden amounts and parties come from a zero-knowledge proof that every node checks. NEAR is also the natural partner for cross-chain legs.

NEAR Confidential IntentsFondaco on Midnight
Who sees the tradePermissioned validators, relay and bridge operatorsThe two counterparties; the relay sees the pair and the size. An unshielded leg (NIGHT) is public on chain
What makes it correctEnclave hardware and operator honestyA zero-knowledge proof verified by every node
Settlement atomicityInside the private shardInside one merged ledger transaction
Quote bindingThe signed diff is the commitmentA signed firm quote, backed by a bond and a reputation record
Partial fills / cancelYes / yesNo (all or nothing) / only by spending an input
StatusLive, the default on near.comOn Preprod; the offer-file standards are proposals (MIP-0005, MIP-0006); not yet on mainnet

Who runs what

A marketplace, not a market maker

Fondaco operates the venue and the tooling; other people supply the capital and earn the spread; wallets and apps bring the users and keep a share. Fondaco runs a solver of its own only to start the market, under a published sunset.

Fondaco runs

  • The relay, built for two regions with failover: in the devnet drill, the second region finished a fill 14.8 s after the first was killed.
  • The solver programme: identity checks, bonds, dry run, reputation, penalties, appeals.
  • The matcher, the compliance gate, the fee ledger and monthly statements.
  • The wallet SDK, the solver SDK and the web swap.
  • Its own solver, for now: no privileged relay data, separate keys and infrastructure, wound down once 3 external solvers fill 60 of volume for 2 months.

earns: the protocol fee (4 bps) · the app fee on its own front-ends

Solvers run

  • Their own inventory, pricing and strategy — market makers, funds, bots, agents. Anything that holds keys and answers a quote request.
  • A bond of at least 10,000 USDM; the largest quote is 50% of it, open notional all of it.
  • A dry run on live flow — at least 48 h, 50 quotes at p95 within 300 ms, no bad signatures — then admission.
  • Fading an accepted quote costs 50 bps of the notional from the bond; fulfilment under 95% over 7 days suspends.

earns: the spread

Wallets and apps run

  • The front-end their users already have. The SDK is a few calls: quote → accept → balance or make an offer → track.
  • Their own app fee, set by them and declared in every quote.
  • Flow attribution: every fill records the app that brought it.
  • Monthly statements; the channel share is paid on chain.

earns: their app fee · 30% of the protocol fee on their flow