Seedelf-Wallet

Chunk 38 · Midnight

Branch web-wallet/midnight, from main.

Status: ⬜ planning. Nothing is built yet. This file says what Midnight is for this wallet, how it would fit, the steps, and the calls the owner has to make first. The work runs over several releases. Each step below gets its own branch, web-wallet/midnight-<step>, and its own PR from main, as chunk 26’s three parts did, and ships in the next release after it lands.

What the owner asked (2026-10-30): “A potential big feature for 1.8.0 could be the basis for midnight support. Lace does it already. … This would be a fairly big feature that would probably spread multiple versions until feature ready. … when its done its private, public, and midnight or something. It would be the next big thing.”

What Midnight is, for this wallet

Checked on 2026-10-30 against Midnight’s docs and release notes, the wallet SDK’s source, Lace’s source, and the chain. Sources lists them. Midnight changes fast, so 38a checks this section again before anything is built on it.

What Lace does

We have Lace 2.4.2 checked out (_reference/lace at e431933). 2.5.0 came out on 29 October 2026 with Generate DUST from NIGHT, and 38a pulls it. Lace’s Midnight code lives in packages/contract/midnight-context, packages/module/{blockchain-midnight,midnight-sync,dapp-connector-midnight,midnight-host-pull}, packages/lib/cnight-dust-designation and, in 2.5.0, packages/lib/midnight-prover.

How it would fit

Seedelf Wallet, one phrase
├─ Private   the Seedelf balance (Cardano)     unchanged
├─ Public    the CIP-1852 account (Cardano)    unchanged, plus Generate DUST for its NIGHT
└─ Midnight  unshielded, shielded, DUST        new: its own keys, sync, sends and connector

Keys

Where the code runs

Data

Proofs

Where it touches the wallet

Privacy

The rules stand as written (privacy.md, development.md):

What Midnight adds:

Steps

Each step is a PR from main and ships in the next release after it lands.

  1. ⬜ 38a · The spike. No screens. It produces numbers and calls, recorded here, on a branch that may stay unmerged, as the Leios run’s (web-wallet/leios-musashi) does.
    • The SDK in our build: Vite, the worker against an offscreen document, the CSP, the zip’s size, the licences (the SDK is Apache-2.0, and the ledger repository’s licence is Apache-2.0 too).
    • Keys: the vectors, equal to Lace’s for the same phrase.
    • Sync on Preview (no token needed):
      • the requests, and what each one sends;
      • the time for a first sync and for a resume;
      • surviving a killed worker;
      • the history service replaced.
    • A whole transfer proved in the browser, timed, with its memory, against a local proof server doing the same.
    • Generate DUST on Cardano preprod, built in core and checked with Ogmios’s additionalUtxo, spending nothing, as tests/fixtures/probe-governance.mjs does for a DRep’s deposit, with an input the account doesn’t hold.
      • Its datum is byte for byte the reference dApp’s and Lace’s.
      • It matches a live mainnet registration.
    • The data question, priced: what a Midnight node and indexer need at home (hardware, and the db-sync connection the node follows Cardano through) against Blockfrost’s plans.
    • Lace 2.5.0 pulled: its prover and its Generate DUST, read.
  2. ⬜ 38b · Generate DUST from the public account (the 1.8.0 candidate: “the basis”). It is the one thing a Cardano wallet can do for Midnight on mainnet today, and it needs no Midnight service and no proof.
    • The Midnight keys and the DUST address come with it, from the phrase, with their frozen vectors. The DUST key may need the ledger’s WebAssembly, or a Rust crate of Midnight’s in ours (38a decides).
    • Register:
      • mint one token under the script’s own policy, with an empty name and redeemer Create (Constr 0 []);
      • pay it to the script’s address with at least 1.58608 ₳, which comes back on Stop, and the inline datum Constr 0 [Constr 0 [stake key hash], DUST key ≤ 33 bytes];
      • spend at least one cNIGHT UTxO. Unverified: Lace’s designation builder, which this follows, refuses with no cNIGHT and puts every cNIGHT UTxO the account holds in as inputs, on register, change and stop alike, for what it calls the validator’s rotation scan of the inputs. 38a reads the validator for which purposes scan them, and whether Stop needs NIGHT still held;
      • name the stake key as a required signer.
    • Change the DUST address: spend the registration and add a zero withdrawal from the script.
    • Stop: spend it and burn the token (Burn, Constr 1 []).
    • Mainnet’s script is 73e4aea31b5b51d9b0ca386196fc6a4c422f74c5aea011e4b8bdf4e5 (addr1w9e7ft4rrdd4rkdseguxr9hudfxyytm5ckh2qy0yhz7lfeg9lvhq7, with 3,885 registrations there on 2026-10-30). It’s a pinned Plutus V3 script, like Lovejoin’s templates.
    • Built in core beside build::account_mint, an account-paid Plutus V3 mint with the account’s collateral, where Pallas stages the mint and its redeemer. It can’t stage Change’s zero withdrawal or its Reward redeemer, which withdraw_zero.rs patches, as Lovejoin’s mixes use it. No Seedelf contract changes and no variant is involved.
    • Finding the registration again: it sits among everyone’s at the script’s address. On mainnet, a data-layer route reads it by its datum; the Koios fallback pages through the address (4 pages today), and the wallet keeps the one it sent. This is the step’s Koios cost.
    • On screen: the public account’s NIGHT, whether it’s generating and to which DUST address, Change and Stop, and the review’s one privacy line. Only NIGHT at an address carrying the registered stake key generates, by line 25’s rule, and the account also holds NIGHT under its payment keys at its enterprise address or under someone else’s stake key: the screen counts each UTxO by its stake part, and says what doesn’t generate.
    • What it can’t show yet is the DUST balance. That needs Midnight’s data (38c), so the screen says when generation starts (about 12 hours) instead.
  3. ⬜ 38c · A Midnight tab that reads. Turn Midnight on. Receive shows its three addresses, Home shows the unshielded, shielded and DUST balances and the sync state, from the data source call 2 picks.
  4. ⬜ 38d · Send on Midnight: shielded tokens, and unshielded NIGHT once the bridge puts any there, with the fee paid in DUST and the proofs where call 4 puts them.
  5. ⬜ 38e · Activity and Transaction details for Midnight: decoded by us, with the raw bytes beside them, as for Cardano.
  6. ⬜ 38f · Midnight’s connector: connector API 4.x (connect, the reads, makeTransfer, makeIntent, balancing, submitTransaction, signData, and getProvingProvider, so a dApp’s proofs go through our prover rather than a URL it names).
  7. ⬜ Each release’s own review covers whatever Midnight steps it carries: the zip’s size, the privacy policy’s entries, and the store listing’s text.

What doesn’t change

The owner’s calls

Each has a recommendation, which the owner can overturn.

  1. On for everyone, or off until turned on?
    • Recommended: off until turned on, from the Midnight tab or Settings, as the connector is.
    • Until then, nothing of Midnight’s loads, derives or phones home, but Generate DUST once it’s pressed. The zip carries it either way.
    • 38b’s Generate DUST sits on the public account and needs no switch: it’s a Cardano transaction. Pressed, it derives the DUST key, and loads whatever computes it (38a decides).
  2. Where mainnet’s Midnight data comes from. The indexer sees the unshielded addresses and the IP address, and the event stream is heavy.
    • Recommended first: Blockfrost through our server. A route on the droplet adds the token, as Lace’s proxy does, so no token ships and Blockfrost sees our server rather than the user.
    • Later: our own Midnight node and indexer, behind the droplet as seedelf-data is, so the no-log promise covers it as it covers the private side. What that takes, as of 2026-10-30 (no mainnet figures are published):
      • The node reads Cardano only from db-sync’s Postgres. It needs db-sync 13.7.1.0, replayed, with tx_in filled, the ledger state on and no address table. At its first start it adds three indexes of its own to db-sync’s tables.
      • Home’s db-sync can’t be it. It runs tx_out as consumed with the address table, which the API’s SQL relies on and only an empty database can change (its options), and it ran 13.7.0.1 when chunk 26 checked. So the node needs a mainnet db-sync and Postgres of its own, replayed from empty.
      • CPU and memory: about 8 vCPU and 32 GB for the node (Midnight’s archived guidance), and 5–12 GiB for the indexer (seen on Preprod).
      • Disk: about 200 GB for the node and 300–350 GB for the indexer, both on Preprod and both growing.
      • Sync: a re-index takes 3–4 days, and the node’s first sync puts at least 18 hours of load on db-sync.
      • Network: P2P on port 30333, which should be reachable from outside.
      • So it needs about 40–45 GB of RAM more for the node and the indexer, and up to about 21 GB for that db-sync (2–3 GB with ledger_backend: "lsm", by chunk 26’s measure), than home’s 64 GB box carries today with the relay, db-sync, Kupo and Ogmios: more memory, or a box of its own.
      • Midnight calls its indexer “a reference implementation … not designed to be public facing”, so it stays behind the API, as Postgres does.
    • A user’s own Blockfrost token in Settings is the fallback for someone who wants neither. Never a token in the zip.
  3. The test network.
    • Recommended: Cardano preprod maps to Midnight Preprod, through the same Blockfrost-on-our-server route, since home’s preprod server belongs to another project.
    • Development uses Preview, which needs no token. The wallet still has no Cardano preview (the backlog’s Declined).
  4. Proofs.
    • Recommended: the WebAssembly prover by default, so keys stay on the machine and nobody needs Docker. A local proof server is a visible switch for speed.
    • Never a prover of ours, and never a remote one by default. A proof server the user names elsewhere in Settings is theirs to choose, with a one-line note of what it’s sent (38a says what that is).
    • This depends on 38a’s numbers, and on accepting the offscreen document as the one place besides the worker that holds a Midnight key, and only for a proof.
  5. 1.8.0’s scope.
    • Recommended: 38a and 38b. Generate DUST is the one mainnet action open to a Cardano wallet today, and it needs neither of the hard calls (2 and 4).
    • 38c follows once call 2 is made.
  6. Which SDK line.
    • Recommended: 1.2.0 on ledger 8 for the spike, since it’s what all three networks run.
    • Then the 2.0 line once it’s stable, and before the ledger 9 fork, whose date isn’t out.
  7. Lace as the reference for Midnight.
    • Recommended: read cnight-dust-designation, the sync’s setup and 2.5.0’s prover, as architecture.md’s table already does for Cardano. Anything copied follows the Apache-2.0 rule, and architecture.md’s “nothing for … Midnight” line changes to match.
  8. The words.
    • Recommended: the tab is Midnight, and inside it Midnight’s own unshielded, shielded and DUST.
    • The private balance and the public account keep their names.

Sources

Read on 2026-10-30.