Seedelf-Wallet

Chunk 54 · Seedelf Messaging

Status: ✅ 54a merged (#403). ✅ 54c merged (#406) and deployed. ✅ Calls 12 and 13 merged (54a′, #407). ✅ 54d merged (#408, the WebAssembly bindings). ✅ 54e merged (#409, the worker). ✅ 54f merged (#410, the screens, with call 15’s verified reveal). ✅ 54f′, the owner’s reflection (#411), but for item 7, the owner’s open call. ✅ 54b, the model (#405), and its follow-ups, which add the verified reveal, skipped keys and the outer envelope: every lemma was proved before call 16. 🚧 54g, the gate (web-wallet/release-1.10.0), which waits on chunk 55, Messages’ own key (the owner, 2026-11-26): call 16’s change to the protocol is built in the crate, the bindings, the worker and the relay, and the models changed with it, and check.sh proved them again but for those the model’s README names and argues for. In this release Messages opens on preprod only, as a test, and protocol.md §20’s freeze starts when it opens on mainnet (the owner, 2026-11-24: calls 17 to 19, and Before Messages opens on mainnet, below). Phase 1 is built: the seedelf-messaging crate, merged in #401. This plan builds the rest: the session layer, the relay, the WebAssembly bindings, the worker and the screens. Each step gets its own branch, web-wallet/messaging-<step>, and its own PR from main, as chunk 38’s and 53’s do.

The specification is protocol.md, with the envelope in construction.md and the guarantees in security.md. It has had two reviews; the second’s reasoning, and its adversarial tests, are in protocol-review.md. This plan doesn’t repeat them: it says what to build, where, in what order, and what’s still the owner’s to decide. A step that changes the protocol changes protocol.md in the same PR.

What the owner asked (2026-11-20):

The owner’s decisions so far, all 2026-11-20 and recorded in protocol.md §0 and §13:

The marks:

What’s already there

Constraints the plan follows

Steps

54a ✅ The session layer, in seedelf-messaging

Everything in protocol.md §3 to §6, as plain Rust with no network and no storage:

Tests:

Done means: every rule in protocol.md §3 to §6 has a test that fails without it, and the vectors are reproduced.

Where it stands (merged in #403, 2026-11-20):

54b ✅ The model

Done means: the model’s queries hold, and a fresh-context reviewer has read the model against protocol.md.

Where it stands (2026-11-22, web-wallet/messaging-model):

54b’s follow-up (2026-11-22, web-wallet/messaging-model-continuations, after #405). The owner’s aim: verify as much of the protocol as is realistic, as the messaging grows from a prototype to a product.

54c ✅ The relay

Where it runs is call 1, and its storage call 2. The routes, as the recommendation puts them:

Done means: offline tests for every refusal, the expiry, paging and duplicates, the price (a burst from one address, from one IPv6 /64, and from many addresses at once), a load test on the droplet’s size [measure], and the vectors.

Where it stands (2026-11-21, web-wallet/messaging-relay):

54a′ ✅ Calls 12 and 13, before 54d

The owner accepted both on 2026-11-21, to be built before 54d. Built in seedelf-messaging’s session module, protocol.md changed to match (§0, §2, §3, §5 to §9, §13, §16), and the reasoning in protocol-review.md §G.

54d ✅ WebAssembly

Done means: the module’s size change is recorded, and the scan’s figure is in protocol.md §8.

Where it stands (2026-11-21, merged in #408):

54e ✅ The worker

Done means: unit tests with a fake relay, a worker stopped mid-scan and mid-send, the quota checked [measure], and byWorker holding for every relay call.

Where it stands (2026-11-21, web-wallet/messaging-worker):

54f ✅ The screens

Done means: unit and e2e tests pass, under load and on the store build, and the screens are checked by eye.

Where it stands (2026-11-21, web-wallet/messaging-screens):

The verified reveal (call 15, built in this PR, 2026-11-22):

54f′ ✅ The reflection

The owner used 54f on preprod after it merged and asked for a pass of questions and small fixes before the gate (2026-11-22). Each item is the owner’s call.

  1. Spam, small and large alike (the owner: “one of the hardest problems here”). A reader’s cost per envelope is its bytes (downloaded) and its scan (about 1 ms, whatever its size). The price only paces an address: one mainnet address keeps about 15 short posts a minute under the 24-bit ceiling, about 33,000 in the 36 hours, and four fill the 64 MiB pool before the global floor moves. The pool had no limit per address.
    • Built: a window on what each address has kept in the pool over the 36 hours, by envelopes and by bytes, counted in memory only and never per envelope; a post past it is refused like the ceiling (429, with how long), and the page prices its size at 0. IPv6 is counted by /56 for messaging, so one server’s allocation is one address. protocol.md §17, the API’s README and the privacy policy’s unshipped entry say so.
  2. A time on “Sending…” (the owner: “a timer to when it would be sent or some other indicator”). Built: “sending, about 7 s” while a post’s work, or a first message’s stamp, is solved, from an attempt’s time measured here (each attempt is a fresh chance, so an estimate, never a countdown), shown at 2 s or more; and “sending in 2:14” while the relay has asked the wallet to wait. Where a page prices a size at 0, the wallet posts with no work to ask: the relay counts before it checks work, so its 429 gives the exact time, where the wallet used to wait a blind minute. Since 2026-11-24 that wait is said in words, “sending in 3 min”: “2:14” read as a clock’s time. And while Messages are paused, or the server doesn’t answer, a waiting message says that instead, with no countdown.
  3. Order kept (the owner: a conversation should read in order). A short message still waits behind a refused long one; nothing changes.
  4. The connector’s window closed and opened again after an unlock for a signature whose account read outlasted the window’s 800 ms. Fixed: the worker keeps the window while a request the unlock let go is on its way.
  5. The switch alone (the owner: “no reason for the paragraph below it or text on it at all”): it reads “Turn on Messages”, with nothing under it. The privacy policy and privacy.md still say what the server sees. Since 2026-11-24 one warning stands under it, the owner’s call 18: the test is for a wallet that isn’t a mainnet wallet.
  6. Save to contacts in the header, not the chat (the owner: “I dont want links … in the chat”): a round button beside Rename and Delete wherever the other side’s Seedelf is known, the one written to or one shown and verified, until a contact names it.
  7. Links, images, GIFs and videos (the owner: “we need to think about how to handle” them). Open: the owner’s call, and the one item of 54f′ not done. Until it’s made, a message is text, and a link in it isn’t a link. Recommended: a link shown as a link that asks before it opens, naming its whole address, and never a preview (a preview tells the site the reader’s IP address and that the link arrived). Media waits for a chunk of its own: an envelope holds 32 KiB, so a file means many envelopes against the relay’s limits, or a host that sees the reader’s IP address.
  8. Copy the Seedelf (the owner: “maybe the user is working out some deal, payment, or escrow”): a round Copy button beside Save, wherever the other side’s Seedelf is known.

54g 🚧 The gate

Where it stands (2026-11-23, web-wallet/release-1.10.0; the review’s own record is kept apart):

Before Messages opens on mainnet

Mainnet opens by adding it to MESSAGING_NETWORKS, in a later release (call 17). Before it does:

Request timing: an assumption, with its stated limits

The owner, 2026-11-24, after six more request-timing cases were found and fixed in this review: “The timing stuff might have to just be part of the assumptions to make this work.” The concern, in order: the one key leaking, then the screens. So the relay and the data layer see when a wallet asks and how often, and Messages doesn’t claim to hide the timing of its requests from them. What’s built stays, as what the wallet does, not as a guarantee (architecture.md, Seedelf Messaging). These are stated limits, not open items:

One kind of timing isn’t in the assumption and stays in scope: timing that depends on the key, the WebAssembly module’s work with x.

For 1.10.x

From the last review of the fixes (2026-11-24), both low, each needing a lock and a restore at the wrong moment, or a refused write:

From the blind read of the screens and the two live runs (2026-11-24):

Not in this chunk

What doesn’t change

The owner’s calls

Each has a recommendation, which the owner can overturn.

  1. ✅ Where the relay runs: new routes in seedelf-data-api (the owner, 2026-11-21), a module of its own on the same droplet, behind the same Caddy, deployed by the same workflow, with no new origin for the wallet to trust. With buckets and a traffic ceiling of its own, inside the API’s (54c). The server grows as the wallet does.
  2. ✅ The relay’s storage: in memory, saved to StateDirectory every minute and on shutdown (the owner, 2026-11-21), so a deploy or restart keeps the pool. 36 hours at 10,000 envelopes a day is about 7.5 MB.
  3. ✅ Whether the relay checks points: yes (the owner, 2026-11-21), as 54c built it.
    • Recommended: yes, with a copy of decode_point held to the crate’s vectors, so garbage never reaches readers.
    • The alternative is the version, the length and the proof of work alone: cheaper, and readers refuse garbage anyway.
  4. ✅ Preprod: a pool on the same relay (the owner, 2026-11-21), as 54c built it.
    • Recommended: a preprod pool on the same relay, told apart by the path, with lower caps, so 54g can run live between two preprod wallets.
    • It’s the data layer’s first preprod route, but it reads no chain, so it touches nothing of preprod’s.
    • The alternative is mainnet only, with preprod tested against the e2e fake and a local relay.
  5. ✅ The largest message: 32 KiB envelopes (the owner, 2026-11-21), as 54c built it.
    • Recommended: 32 KiB envelopes, under Caddy’s 64 KiB.
    • The alternative is raising Caddy’s limit for this route alone.
  6. ✅ Proof of work, priced by traffic (the owner, 2026-11-20: “or even scale with traffic via ip”).
    • Hashcash over SHA-256 of the envelope, a microsecond for the relay to check, at a light base that rises with the address’s recent posts, with a global floor and a ceiling (protocol.md §10). The numbers are 54c’s [measure].
    • A price, not a refusal, so an honest user behind the same address as a flooder (a carrier’s NAT, an office) still gets through, only slower.
    • Raising one flat difficulty for everyone was weighed and set aside: the relay can’t tell first messages from replies, so every reply would pay, and a GPU solves SHA-256 orders of magnitude faster than a browser.
    • In reserve against GPUs: a memory-hard puzzle that stays cheap to check, such as Equihash. Not one whose check costs as much as an attempt, such as Argon2, which would make the 2-vCPU relay the target.
  7. ✅ Where Messages lives (the owner, 2026-11-21): both a round button left of Settings in the top bar and a row on Home near dApps, Activity and UTxOs, opening the same page.
    • Recommended: a row on Home, like the dApps row, with its unread count, opening the Messages screen. It’s the wallet’s own, not a dApp.
    • The alternative is a dApp tile.
  8. ✅ Strangers’ first messages on screen: a Requests list (the owner, 2026-11-21), as recommended and built in 54f. protocol.md §3.1 bounds what’s kept; this is how it’s shown.
    • Recommended: a Requests list, apart from conversations, until the user replies or deletes. Nothing tells the sender either way.
  9. ✅ Messages off by default, a switch for each network (the owner, 2026-11-21): the worker reads each network whose switch is on, whichever the wallet shows (54e).
    • Recommended: off, with one switch on the Messages screen. Syncing tells the relay when the wallet is online, which is the private-by-default rule’s case for off.
    • Messages works whether or not Koios-only is on, since there’s no Koios version of it.
    • Since call 17 (2026-11-24) only preprod’s switch can be on, for now.
  10. ✅ History kept within about 5 MB (the owner, 2026-11-21), the oldest going first, and the thread says so (54e).
    • Recommended: until the user deletes it, within a budget of about 5 MB of the extension’s storage. The oldest messages go first past it, and the thread says so.
    • The alternative is a fixed age, such as 30 days.
  11. ✅ Notifications: the unread count, on Home’s row and the top bar’s button (the owner, 2026-11-21), as built in 54f, the button’s since the owner put one there. No badge or system notification.
    • Recommended: the unread count on the Messages row only, and no badge or system notification in this chunk. The notification centre was declined on 2026-10-11.
  12. ✅ A first-contact stamp (the owner, 2026-11-21): built in 54a′.
    • An 8-byte nonce after F whose work over F the reader checks before any key is computed, 24 bits [choice], about 7 s in the browser. It prices a stranger’s first message to one reader, which the relay’s price can’t target, since the relay can’t tell first messages from replies. Replies pay nothing more.
    • Writers solve at 24 bits and readers ask the same: there’s no way to tell writers a reader’s own price.
  13. ✅ Proving the base comes from the named handle (the owner, 2026-11-21): built in 54a′.
    • A first message to the sum of two Seedelfs’ registers opens only for a wallet holding both, so a reply to it links them, unseen. A proof that p₀ re-randomizes the handle in to, bound to F, makes to verified; to is required.
    • It needed every envelope bound to its conversation too, or the writer aims the envelope at the sum instead (54a′, protocol-review.md §G).
  14. ❓ Tombstones for evicted requests (found by 54b’s review). §16.4 leaves no tombstone when the bounds push a request out [choice]. So after a flood of 50 requests, a first message re-posted after the relay’s 36 hours, and within t + 48 hours, reads again as a new request. No conversation changes; the reader sees a request twice.
    • Recommended: tombstone evicted requests too, until t + 48 hours as the others. A flood then costs the reader a tombstone per evicted request (24 bytes each), as it costs the flooder a stamp for each (call 12).
    • The alternative is to leave it, documented.
    • Still open after the gate: call 16 keeps a new request pushing the oldest out with no tombstone, and a join now never pushes one out, so only a new request, with its own stamp, can.
  15. ✅ Revealing one’s Seedelf inside a conversation: a verified reveal, in 54f (the owner, 2026-11-21: “allow alice to reveal but only in the rachet part so its not in the first message”; “a button that shows up after the handshake on Alices side that says, Reveal or something and it sends it like a message to bob”; “I think its worth putting it in this pr”). Built as recommended, designated-verifier (protocol.md §19). The owner noted it proves “someone with a seedelf is messaging you”, not a person: its value is tying a conversation to a Seedelf the reader already knows. Numbered past 54b’s call 14 (#405).
    • Recommended: a verified reveal only, as its own step after 54f. A new inner kind (§18), sent in the ratchet and never in a first message, carries the Seedelf’s name and a proof that the conversation’s key A and that Seedelf’s register share the writer’s key, bound to the cid; the reader shows §7’s “Verified ⟨handle⟩”. The writer chooses it, per conversation, and the reader alone learns it.
    • Which proof: a designated-verifier one convinces only the reader, who could have made it, so the conversation stays deniable, as Signal’s are; a plain one is evidence the reader can show anyone. Recommended: designated-verifier.
    • The alternative, an unverified claim (“Says they’re ⟨handle⟩ (unverified)”, §7’s row), anyone can make for any Seedelf: a phishing tool, so not recommended.
    • It changes the protocol: protocol.md, the crate with vectors checked independently, 54b’s model told, a WebAssembly export, the worker and a button.
  16. 🚧 The protocol’s change before release: call 16 (the 1.10.0 gate, 2026-11-23), from the gate’s review. Nothing of Messages had shipped, so v1 changed in place, with no migration, and a development build’s records are refused by their version (protocol.md §0, §20). An envelope carries a tag of w in place of w; its ephemeral point is derived from the message key and checked; F carries a keys proof, and its base proof became designated-verifier; a request has its share; “too far ahead” needs a message that authenticates; tombstones ignore a clock set back. joint-security.md took the keys proof as x’s tenth use, written before the code. Built in the crate, the bindings, the worker and the relay, with every vector file re-recorded; the models were proved again, but for those the model’s README names and argues for.
    • Kept outside it, and said in the docs: a first message hands its reader (p₀, A), a register of the writer’s key it can pay (one key and one scan, so it can’t be closed); the timing a take leaves at the relay (W10); and a Seedelf someone else put under the key that the user turns on (W8).
  17. ✅ Messages on preprod only, for now (the owner, 2026-11-24, at 1.10.0’s second review). MESSAGING_NETWORKS in networks.ts is ["preprod"], and the store build still has both networks for everything else.
    • On mainnet the Messages page has one line in the switch’s place, “For now, Messages are on Preprod only.”, and its pen can’t be pressed; the worker refuses to turn mainnet’s switch on; and a mainnet switch a development build left on reads as off everywhere. So nothing of mainnet’s reaches the relay: no read, no post.
    • The relay keeps both pools (call 4), and the wallet uses preprod’s. With preprod’s switch on, the worker reads its pool while the wallet shows mainnet too (call 9), and mainnet’s page says so, with a way to turn it off.
    • Mainnet opens by adding it to that list, in a later release: Before Messages opens on mainnet, above.
  18. ✅ The test is for a wallet that isn’t a mainnet wallet (the owner, 2026-11-24: “the preprod only test should use a non mainnet wallet”).
    • The Seedelf key comes from the recovery phrase and an account index alone, so one phrase has the same key on preprod and on mainnet, and Messages reads and writes with it. A flaw in Messages that nobody has found yet, if it exposed the key, would expose the key that holds that phrase’s mainnet funds, though Messages runs on preprod only.
    • The Messages page says it under the switch, as a warning: “Messages are a test for now: use a wallet that isn’t your mainnet wallet.” That’s one line more than 54f′’s item 5 left there.
    • It’s advice: nothing checks which wallet it is.
  19. ✅ The freeze starts at mainnet (the owner, 2026-11-24). What protocol.md §20 freezes is frozen by the release that opens Messages on mainnet, not by 1.10.0.
    • Until then a later release may still change a format, or what the relay’s v1 routes take and answer, where a review finds a flaw, and preprod’s conversations and its pool may then be reset.
    • §20’s rules stay as written; a paragraph at its top says when they start.
  20. ✅ No keep-alive (the owner, 2026-11-24: “I do not want any issues with the chrome extension because of this. If solving that issue is removing it then so be it.”). Chrome’s migration guide, “Keep a service worker alive continuously”, allows one only on managed enterprise or education devices: “It is not allowed in other cases and the Chrome extension team reserves the right to take action against those extensions in the future.” Removed the day it was built; a post’s solve still keeps the worker up until it ends, which the guide allows.
    • What it leaves is a stated limit: the relay can tell a wallet that was recently busy from an idle one (Request timing, above).
  21. A fallback for the one key: a messaging-only key (the owner, 2026-11-24). Taken up by chunk 55 (the owner, 2026-11-26): the same split, with the binding a certificate the Seedelf key signs instead of a second Seedelf, so the handle stays one name. As first recorded: not built, kept in reserve. “a back up plan for the one key is to have a message account on the private side. A key that gets derived just for messaging and that is it. Then a custom seedelf gets created for that secret and that resultant seedelf becomes the messaging address. It creates one more step if it becomes an issue.”
    • It would be a new derivation beside the frozen v1, never a change to it.
    • What it would need settled (the review’s notes, not the owner’s): a payment sent to the messaging Seedelf would land under the messaging key, so it’s swept, or that name isn’t shown as payable; a verified reveal of the main Seedelf would still take one proof from the main key; and “message whoever you can pay, by the same name” is given up.
  22. ❓ The test warning’s words (a blind read of the screens, 2026-11-24). “use a wallet that isn’t your mainnet wallet” didn’t tell the reader that it means another recovery phrase: one phrase has the same key on every network (call 18). Open: the owner’s words.
  23. ❓ Who can read a message isn’t said (the same read). Nothing on Messages’ screens says it: the word “encrypted” isn’t there, but for one refusal’s “couldn’t encrypt it”. Open.
  24. ❓ A tag reads like a checked name (the same read). A Seedelf’s tag is its maker’s choice, and “Found: bob” at New message, and the bold tag under “Verified Seedelf”, read as a name someone checked. Open.

Unknowns