What is mocked
Upcoming · Demo mode and the mock relay are upcoming. The devnet's mocks below exist today.
The rule for every mock here: what passes in demo must pass on Preprod. The mocks fake proofs, the chain and time. They do not fake the envelope, the checks or the error shapes.
Demo mode and the mock relay (upcoming)
Section titled “Demo mode and the mock relay (upcoming)”| Faked | How |
|---|---|
| The relay | An in-process relay inside the SDK (DemoTransport for wallets, MockRelay for solvers) instead of a server |
| Solvers (wallet side) | One firm quote from a demo solver key and one indicative quote from a ladder, at the demo relay's reference mid less a spread |
| Request flow (solver side) | Generated requests: steady, burst, quiet, or a recorded trace |
| Proofs | Mock-proven transactions; nothing is proven |
| The chain | No ledger: the fill walks its states without a block |
| Time | Compressed; realtime: true paces a fill like Preprod |
| The wallet | DemoWallet: the part of the dApp connector API the SDK calls (balances, addresses, makeIntent, balanceSealedTransaction, submitTransaction) over mock coins |
| Keys | Fixed demo keys for the relay and the demo solver, published in the SDK |
| Real, not faked | Why it matters |
|---|---|
| The RFQ envelope | Quotes, ladders, the attestation and the fee declaration are the MIP draft's objects, signed for real |
| The client's and the solver's checks | The SDK runs the same checks it runs against production; a response that fails them fails in demo too |
| State names | reserved → made → submitted → finalized, as the production relay reports them |
| Error shapes | Each scenario (no_quote, paused, declined, fade, reserve_race, ws_refused, privacy_unavailable) answers with the production relay's error; the plan is a test comparing them byte for byte against the relay on the devnet |
| Reservation | A second accept of the same quote is refused, as on the relay |
Every demo response carries a DEMO marker, so a demo fill cannot be mistaken for a real one.
The local devnet (works today)
Section titled “The local devnet (works today)”scripts/stack.sh up runs the real relay (Elixir), the real solvers, the matcher and the real SDKs against a devnet. What the devnet fakes:
| Faked | How | Turn it off |
|---|---|---|
| The chain | A single node running the ledger WASM (ledger 9) with an indexer-style API, not Midnight's node; short block times | Run on Preprod |
| Proofs | Proofs are erased (PROVER=mock, the default) |
PROVER=http with a local proof server proves every leg |
| Celestia | A mock of the mn-swap-v1 namespace for MIP-0006 open orders |
— |
| KYB, bonds, admission | Seeded fixtures (scripts/seed-programme.mjs): devnet entities, bonds by reference, no documents checked |
— |
| Wallets | Devnet wallets behind the dApp connector API, standing in for a browser extension; seeds derived from public labels | A real wallet on Preprod |
| Secrets | Solver keys and tokens derived from public labels, accepted only while the relay is on loopback | — |
Nothing else is faked: the relay's checks, the solver programme's rules, fees and fee verification, reservations, the audit chain and the error shapes are the production code.
Preprod
Section titled “Preprod”Preprod is Midnight's public test network: real node, real indexer, real proofs and real DUST. Its NIGHT has no value, and our test tokens stand in for the rest: tsSIT (shielded) where mainnet has USDM, tSIT (unshielded) for a second unshielded token. Nothing is mocked there except the value of the tokens. docs/PREPROD.md records what ran on it.