Apache 2.0 · Source revision c4506c4

Download Markdown · License · Notice

mdw/1 wire profile

The encoding and signature domains for mdw/1 certificates, manifests, listings, and publication pointers are compatibility requirements for previously published data. Incompatible changes to these records require a new version and a migration path. Optional discovery and administration extensions evolve separately. The implementation and interoperability tests live in crates/xan-proto. See docs/architecture.md §3–§6.

The mdw/1 test vectors give deterministic Ed25519 keys and exact CBOR bytes for a publication certificate, its first manifest, and its public listing. The manifest's index.md is empty and the title uses UTF-8. The fixture seeds are public test values. The Rust gate verifies the bytes and reproduces them byte for byte when signing again. The pointer TXT vector is checked in crates/xan-proto/src/pointer.rs.

1. Keys and ids

2. Deterministic CBOR profile

RFC 8949 §4.2.1 core deterministic encoding, restricted to: unsigned integers (major 0), negative integers (major 1), byte strings, text strings, arrays, maps with text keys only, false, true, null. A decoder refuses:

Every allowed value has exactly one encoding, so decode-then-encode reproduces the input. Unknown map keys are refused in every mdw/1 object in this draft (no silent extensions; a later draft will name an extension field).

3. Certificate

{ "person": bstr(32), "subject": bstr(32), "role": "publication" | "device",
  "scope": null, "valid_from": tstr, "sig": bstr(64) }

sig = person key over the deterministic encoding of the same map without sig, context mdw/1 certificate. valid_from is RFC 3339 UTC to the second (2026-11-20T12:00:00Z; other forms are refused). scope is reserved and must be null. Rotation, revocation and expiry are not in this draft (architecture §3: define before freeze).

4. Manifest

Envelope (what is stored, served and hashed):

{ "manifest": bstr(body), "sig": bstr(64) }

sig = publication key over the body bytes, context mdw/1 manifest. Manifest hash = blake3: + hex of BLAKE3 over the whole envelope. body is the deterministic encoding of:

{ "protocol": "mdw/1",
  "publication": bstr(32),            publication public key
  "root_cert": certificate,           person → this publication key, role "publication"
  "title": tstr,                      ≤ 256 bytes, no control characters
  "seq": uint,                        ≥ 1
  "previous": bstr(32) | null,        null iff seq = 1; otherwise the previous manifest hash
  "updated": tstr,                    RFC 3339 UTC, seconds
  "access": "public",                 the only value defined in this draft
  "index": tstr | null,               must be one of files
  "feed": tstr | null,                must be one of files
  "files": { path: { "blake3": bstr(32), "size": uint } },
  "routes": { "https": [tstr], "nodes": [tstr] } }

Verification order: size ≤ 4 MiB → envelope decode → body decode → (optional) expected publication → publication signature → certificate signature → rules (below).

Rules: ≤ 10 000 files, each ≤ 1 GiB; every path valid (§5) and no two colliding; index/feed listed in files; ≤ 8 routes of each kind; HTTPS routes are https:// bases ending in /, ≤ 512 bytes, without whitespace, control characters, , ; " \; node ids are 1–64 ASCII letters/digits (the network layer defines their exact form); the certificate's subject is the publication key with role publication.

Routes are hints. A reader fetches <https base>.mdw/manifest and <https base><path> and verifies everything against the manifest; a route never vouches for content.

Writer rules (implemented by Publisher): seq increases by one per snapshot; publishing an unchanged folder makes no new snapshot.

Removal signs a terminal head with an empty file map and no index or feed, before deleting the publication key. The writer retains the signed manifest and a signed pointer packet, so it can advertise and serve the proof when online. A reader that verifies this head reports the removal. Previously saved bytes may still exist on independent devices, especially before they receive the terminal head.

5. Logical paths

/-separated, relative, NFC, ≤ 512 bytes, ≤ 32 segments, each segment 1–255 bytes. Refused: empty segments, ./.., names starting with ., names ending in space or ., control characters, \ : * ? " < > |, and Windows-reserved stems (con, prn, aux, nul, com1–com9, lpt1–lpt9). Two paths collide when NFC + Unicode lowercase makes them equal; a manifest with a collision is refused. Names read from disk are normalized to NFC first (macOS stores NFD).

Publishable files (folder snapshot): .md, .markdown, .png, .jpg, .jpeg, .gif, .webp, and rss.xml/feed.xml. No SVG (architecture §1b). Dot entries and symbolic links are skipped, so a publish never reaches outside the chosen folder. Defaults: ≤ 10 000 files, ≤ 64 MiB each, ≤ 1 GiB in total. index is the first of index.md, README.md, readme.md, index.markdown present.

5a. Opening an address

mdw://<publication>/<path>: path is percent-decoded, without the leading /. Readers resolve it against the verified manifest, in this order:

Contents page. Deterministic Markdown that every reader makes the same way from the signed version. It is not a file of the publication and is never signed itself; its trust is the manifest's (the list it shows is exactly the signed one), and readers mark it as made by the reader (Markmallow: About.listing).

# <title>                      the publication's title at the root, else the folder's last segment

[<site>](<../../>) / [<folder>](<../>) / <this folder>
                               below the root only: the way back up. The publication's title, then each
                               folder above this one, each a link; this folder's name last, as text

## Folders

- [<folder>/](<./<folder>/>) · <n> pages
                               one per child folder with a Markdown file somewhere below it; n counts
                               those files at any depth ("1 page")

## Pages

- [<title>](<./<file>>)        one per Markdown file directly in the folder

Directory lists in authored pages. A writer can insert ordinary relative Markdown links to the visible pages of a folder. With live updates enabled, the writer encloses those links between <!-- markmallow-directory flat . --> and <!-- /markmallow-directory -->. The final argument is the folder relative to the containing page, with each path segment percent-encoded. flat and tree use page titles, with tree including subfolders. flat-files and tree-files use the file name without its extension. Ordinary Markdown readers display the authored links.

A Markmallow reader refreshes membership from the same verified version. It excludes the containing page, index pages, and names beginning with a dot or underscore. For a title-based list the reader uses the version’s verified table of contents, then the authored label for that path, then its file name. A reader can fetch the one table of contents for the page. Rendering a list never requires downloading every linked page. Refreshing the display preserves the signed source bytes.

Notes shown in place. A reader may show a Markdown file of a version inside another page of the same version. The author's page says where with a paragraph that holds only ![[path]] (or ![[path|title]]). This is a convention between authors and readers: the manifest and the signatures know nothing of it, and a reader that does not follow it shows the line as text.

Posts view. mdw://<publication>/?view=posts (the root with view=posts in its query; other pairs are ignored) is the whole publication as one flat list. Like the contents page it is made by the reader from the verified manifest, deterministically, and never signed itself.

# <title>                                    the publication's title

- [<label>](<mdw://<publication>/<path>>)    one per Markdown post at any depth; label = its path without
                                             its last extension (a leaf index uses its containing folder)

6. Pointer record (Pkarr)

Name _mdw, one TXT value:

v=1;seq=<uint>;m=blake3:<hex>[;h=<https base>,…][;n=<node id>,…]

v=1 first; seq ≥ 1 and m required; h/n follow the manifest's route rules; unknown keys are ignored (later hints); a repeated key is refused. The text is at most 800 bytes: BEP 44 caps the whole value at 1000 bytes and the DNS packet (header, name, TTL, framing, 255-byte TXT string splits) needs the rest. The record shows the key holder wrote it; it does not prove freshness, and the manifest it names is verified on its own.

7. Heads

Per publication, durable (seq, manifest hash). A higher seq advances; the same hash is a no-op; a lower seq is refused as latest (still readable when pinned); the same seq with a different hash is a fork: both are kept, the publication is flagged, and nothing advances automatically until reconciled.

8. Blob store

blobs/<first 2 hex>/<64 hex>, named by BLAKE3 of the content, written temp → fsync → rename. Every read re-hashes; a mismatch moves the copy to quarantine/ and reports it. Signed manifests are stored here too (their hash is the BLAKE3 of their bytes).

9. HTTPS mirror layout

<base>/<path>                   each file at its logical path, bytes unchanged
<base>/.mdw/manifest            the signed manifest envelope
<base>/.mdw/manifest.json       the same manifest as JSON (people/debugging only; never verified)
<base>/.well-known/mdweb.json   {"k": "<publication id>"} (the HTTPS half of a domain alias, §3)

A plain browser, BonBon or Markdown Robot reads the Markdown unchanged. Export never writes through a symbolic link and never deletes files a previous snapshot left. The version's rss.xml and toc.opml (§9a) are files like the rest, so a mirror carries them at <base>/rss.xml and <base>/toc.opml. bonbon.json generation is 0.4.

9a. The feed and the table of contents

A publisher puts two files beside the writer's own in every version it signs. They are made from exactly the files that version holds, so they are never behind it. They are ordinary files of the version: listed in the manifest, fetched and verified like any other.

rss.xml, at the root, named by the manifest's feed. RSS 2.0.

<rss version="2.0"><channel>
  <generator>Markmallow</generator>        first in the channel: the mark of a made feed
  <title>, <link>mdw://<publication>/</link>, <description>
  <item>
    <title>         the page's title as a reader gives it (front matter `title`, else the first heading,
                    else the path without its extension); plain text, at most 300 characters
    <link>, <guid isPermaLink="true">       mdw://<publication>/<path>, each segment percent-encoded
    <pubDate>       RFC 2822; left out when the post has no date
    <description>   front matter `description`, plain text, at most 400 characters; left out when none

toc.opml, at the root. OPML 2.0. <head><title> is the publication's title. Every Markdown file of the version except those under mdw-replies/, in byte order of path, nested by folder:

<outline text="<folder name>">                              one per folder
  <outline text="<title>" type="link" url="mdw://<publication>/<path>" created="<RFC 2822>"/>

text is the page's own title, else its file name without the extension. created is front matter pubDate, left out when there is none.

10. Recovery file

An age v1 file (one scrypt passphrase recipient) holding one deterministic-CBOR map: format = xan-recovery/1, created, person (seed), publications (id, title, created, seed, certificate bytes, seq, head, updated, and the head's signed manifest so previous is known) and optional reader heads. Device keys are never included. A restore:

11. Not in this draft

Private (consensual) manifests, Bao outboards and chunk-group verification, aliases and indexers fields, certificate rotation/revocation, the four-word check, a paper mnemonic, and known-device/endpoint bookmarks in the recovery file.

12. Peer protocol (0.2 draft)

Implemented by crates/xan-peer. A device serves the manifests and blobs it holds and fetches others'.

Reachability (interim default, flagged for review before 1.0). The default endpoint uses iroh's n0 preset:

These are services run by n0. They see node ids and IP addresses, never content: the QUIC session is end-to-end. The Disabled choice uses no relay, no lookup service and no port mapping. It dials only addresses the app was given: a pointer's hints, a LAN listing, or a test. Self-hosted relays, or an opt-out of n0, are open decisions.

13. Pointer publication

The §6 record is carried in a Pkarr signed packet under the publication key:

The Pkarr key text equals the publication id (§1).

14. Search request (0.7 draft)

A third request kind on the §12 stream: 0x03 search. A device answers it from its public projection only: its own current publications and the publications it follows and keeps in full. Never drafts, private publications, reading history, or pages it merely read. Answering is not a claim of authority: every field in an answer is the answering device's claim until the reader opens the file and verifies it against the publication key (§4).

14a. Listings request (0.14 draft)

A fourth, optional request kind: 0x04 listings. It carries the publishers' own signed listings (specs/director/README.md §2, context mdw/1 listing) from device to device, so a publication listed under some words can be found without any director. A listing is passed on exactly as signed: never re-signed, never extended past its own expires. A device that passes one on can only withhold it or replay it until it expires; the newest issued wins, so a replay can't undo a newer listing or withdrawal.

14b. Submit request and hosted directors (0.18 draft)

A device may host a director (specs/open-network/PLAN.md §2): the directory of specs/director/README.md, on the device network instead of HTTP. Markmallow hosts one on a desktop with Help the open network on, and xan node runs one headless; phones never do. A hosted director is addressed mdw-node:<device id> (the z-base-32 node id), wherever a director's HTTPS address is accepted.

15. Recommendations (follows.json, 0.7 draft)

A publication recommends others with a generated file at the root of its snapshot, follows.json, signed like every file (it is in the manifest). It is made by the publishing app from the publisher's explicit list and never written into the publisher's folder; a folder's own follows.json is not publishable (§5), so the name can't collide.

{"version":1,"follows":[{"address":"mdw://<publication id>/","title":"Fish Notes"}]}

16. Web pages in search: a director's index of Markdown sites (0.39 draft)

A search also finds web pages written in Markdown that the reader has never opened. A director may keep an index of web sites that serve Markdown and answer searches from it (specs/open-network/PLAN.md §7). What it answers is a claim. The page is unsigned, and the reader fetches nothing from its site until the page is opened. Rows from the reader's own library (app-api §20, API 0.15) are unchanged.

The index.

Polite reading.

Asking an HTTPS director: GET v1/web?q=<words>&limit=<1–20> (specs/director/README.md §4 holds the other requests).

Asking a device that hosts a director: request kind 0x15 web (§12 framing).

Reader rules (Markmallow).

Not in this draft.

17. Private publications (private.json, 0.17 draft)

A publication asks not to be found with a generated file at the root of its snapshot, private.json, signed like every file. Like follows.json (§15) it is made by the publishing app, never written into the publisher's folder, and a folder's own private.json is not publishable (§5), so the name can't collide. A manifest field would have been refused by every reader of this draft (§2: unknown keys are refused); a file is read by older readers as one more file.

{"version":1,"private":true}

18. Meeting place (0.19 draft, specs/open-network/PLAN.md §3)

Where always-on devices list themselves, so a device that knows nobody finds them. It lives on the Mainline DHT (and the pkarr relays) as ordinary pkarr packets, like pointers (§6), so a phone that can't reach the DHT still reads it through a relay.

19. HTTP gateway (0.19 draft, specs/open-network/PLAN.md §7)

An always-on device can show searchable publications to plain web browsers, so a link to a page works for someone without Markmallow. Markmallow: xan node --gateway ADDR, plain HTTP for a TLS proxy in front (nk.tools: a /mdw/ route).

20. Federation: directors pull from directors (0.20 draft, specs/open-network/PLAN.md §4)

Directors hosted on devices share what they hold, so a listing sent to a few of them reaches the others. A director pulls; nothing is pushed.

21. Private directors (0.20 draft, specs/open-network/PLAN.md §4, O6)

A director can be private instead of federating: only people with its address can use it, and it holds only listings sent by people who were given that address.

22. Open relays (0.20 draft, specs/open-network/PLAN.md §5)

An always-on device may run an iroh relay with a public TLS name. The relay passes the peers’ encrypted QUIC traffic and sees their node IDs and network addresses. The peer connection authenticates the remote device. Publications and file bytes retain their normal signature and hash checks.

23. Hosted director reachability (0.20 draft)

A desktop director tries to bind UDP 47160. The CLI xan node --port N can choose another fixed port. A busy fixed port falls back to an automatically assigned UDP port, with relays available. A fixed-port director asks its router for an automatic UDP mapping through UPnP, PCP or NAT-PMP, advertises any mapping as an endpoint candidate, renews while hosting and requests release on orderly shutdown.

The local status reports the bound fixed port, the device address toward the router, the router’s reported capabilities and the public address observed by a network probe or mapping. A mapping with evidence of another outer IPv4 address is not reported as public. The reachability state is an inference from local observations. No unsolicited internet dial-back request is used. A port forwarded manually on the router can help when the fixed port is bound, subject to the upstream network and firewall.

24. Saved copies and provider discovery

A reader saves the exact Markdown bytes and the author’s verified manifest. Peers request the original publication ID and validate its signature, then request the file by the BLAKE3 hash the manifest names. Copies keep the original address and attribution. An ordinary browser cache does not grant permission to serve a file. Removing a saved page stops serving its bytes immediately. Private publications and unsigned web pages are excluded from public provider announcements.

A keeper advertises short-lived device locations separately from the author’s pointer. Each UTC hour has four Pkarr slots derived by BLAKE3 derive-key in context mdw/1 saved providers slot. The input is the 32-byte publication public key, the big-endian u64 Unix hour (Unix seconds divided by 3,600), and the one-byte slot number (0–3). The keeper writes in the current hour. Readers check the current and previous hour. The slot for a keeper is the first byte of the BLAKE3 hash of its device public key modulo four.

The _mdw-keep TXT value is v=1;<device-id>;<expires>;<signature>, with a z-base-32 device ID, decimal Unix seconds, and base64url without padding for the signature. The device signs the publication key bytes followed by the big-endian u64 expiry in context mdw/1 saved provider. A lease expires after an hour. Each slot preserves at most five leases and each lookup returns at most eight devices. Writers merge live leases and renew while actively serving. Readers verify a lease for the requested publication and treat it as a route hint. A keeper can provide an older verified copy when the newest version cannot be fetched.

If the available manifest names a version of the file that no device can serve, a reader may ask for the manifest kept with the page. The optional 0x0a request is one kind byte, the 32-byte publication key, and the decoded UTF-8 path with no leading slash or fragment. The root uses an empty path. The path is bounded to 512 bytes plus an optional trailing slash. A keeper answers with the usual manifest response for an explicitly saved page or not found. The reader still verifies the original author signature and the requested file hash, and displays it as a kept copy.

25. Network-wide device names (phase 1: test and self-hosted registries)

A device name such as jdb.system76.mdw resolves to the Iroh endpoint serving it. The device profile's hostname hint stays local until its owner registers the name. A name opens the device's public post list (§25a). Each page still opens and shares at its own mdw://<publication-key>/<path> address, verified by its author key. crates/xan-names implements this section.

Registries

A registry is named by a bootstrap file. The reader imports the file (the app keeps it in its data folder, and the CLI takes --names-bootstrap FILE). Without one there are no device names, and nothing talks to a registry. The file is public and holds no secret. It is JSON (format: 1) with:

A reader checks it whole before use. The checks cover the threshold against the key package, every endpoint as a valid Ed25519 point, and relay URLs (https, with a host and no credentials).

An open director can explicitly advertise a chosen public bootstrap. Optional peer request 0x10 is the kind byte alone. The response is at most 64 KiB of UTF-8 bootstrap JSON, or not found if the director shares none. Readers can ask up to eight authenticated directors found through the existing DHT meeting place. The director's identity authenticates the source of the hint. Trust in the registry requires the reader to compare the group fingerprint and accept it explicitly. Checking for hints sends no requests to the advertised registry. A private director offers no hint. The headless node uses --names-bootstrap FILE --advertise-name-registry. An operator can co-host the registry's sequencer in that node with --registry-sequencer DIR, where DIR contains the configured sequencer's key and log. The registry still needs its signer quorum.

Ordering and signing

One operator-led sequencer orders requests into an append-only log. Signers each hold one FROST Ed25519 share; the test registry has 3 signers with a threshold of 2. The sequencer holds no share and can sign nothing alone. Every signer replays the same log and checks each entry before it signs at that index. Each signer persists a guard naming the one history it signs. Without enough signers a change stays committed but unsigned (pending), and nothing falls back to any single key.

This tolerates a crashed or restarted signer or sequencer under an honest sequencer and honest signer processes. It is not Byzantine fault tolerant. A registry of independent public validators needs consensus with finality certificates, as in HotStuff.

Operations are signed by the owner key for one network: Reserve(base, requestId) with a proof of work, and Renew or Release of an assignment named by its original log index. Each entry is persisted and synced before anything reports it. The candidates for a base are the base, then 1.<base>, 2.<base>, and so on. A committed reserve takes the first candidate free at that point in the log, so simultaneous claims by different owners get the base and 1.base in committed order. Only the registry assigns a name whose first label is all digits.

Each decision also gets a group-signed receipt for exactly that owner, request and operation digest. A retried request id returns its first decision. A client saves its signed operation before first sending it and resends the same bytes until its receipt arrives. It reports a name confirmed only on a verified receipt.

Rules (no payments)

Lease 180 days from commit; renewing sets commit time + 180 days. Grace 30 days, during which only the owner can renew and the name still resolves as renewal due. A reserve needs a proof of work of 22 leading zero bits (20 in test registries) over the network, owner, request, base and nonce, and an owner holds at most 8 live names. The sequencer also throttles before committing: 6 submissions a minute per endpoint, 120 a minute overall and at most 1,000 pending. Past that it answers busy and remembers nothing.

Records

A name's registry record is BEP44-salted mutable data under the group key.

The group signs the BEP44 signable bytes themselves. An hourly tick in the log refreshes every live name's record, and the sequencer republishes them every 45 minutes.

An assignment's endpoint record is BEP44-salted under the owner key.

Resolution

A reader asks the sequencer and the DHT at the same time, about 8 seconds each, and keeps the verified record with the highest asOf. That includes its persisted cache, so it never goes backwards.

The bounded tail. A cut-off reader holding a valid record of a released name may still go to the former owner's endpoint until that record's freshUntil, at most 3 hours after release. It never goes to a different owner: a released name cools down for the same 3 hours. A different owner asking for it meanwhile gets the next candidate. Natural expiry has the 30-day grace as its bound.

Using it

25a. Open a device’s public posts

A reader opens a confirmed .mdw name or an iroh://<endpoint-id>/ link at the device’s public post list. Markmallow accepts mdw-node:<endpoint-id> and Iroh endpoint tickets in its address bar. A bare name ending in .mdw goes to the MDW resolver. Ticket coordinates are bounded and subject to public route checks. The canonical device link without a name is mdw://<endpoint-id>/?view=device. An mdw://<publication-key>/<path> link still opens the publication or page using its author key.

The optional MDW peer request 0x0b consists of the kind byte alone. Its success payload is canonical CBOR [truncated: bool, pages: array], with up to 192 rows of [publication: bytes(32), path: text, publicationTitle: text]. Each path is a valid logical path ending in .md or .markdown and the title is limited to 200 UTF-8 bytes. The reply is authenticated by the endpoint connection. The publication title is a hint until the reader opens the page and verifies the author signature and the bytes.

Devices list the Markdown they currently serve, including pages explicitly saved for public serving. Private versions, drafts and ordinary read-cache items are excluded. Serve publications off refuses the request. An older endpoint may refuse it or answer not found. The resulting list uses canonical author links regardless of how the reader reached the device.

Classified catalog (optional 0x11). The request is the kind byte alone, with no body. Its reply keeps [truncated, pages], but each row is [publication, path, publicationTitle, landing: bool]. The path, title, row count and total-byte bounds are the same as 0x0b. The serving device derives landing from the complete verified manifest for that exact hosted file's version, counting files as §5a specifies once per manifest, before filtering to hosted Markdown. An uncached sibling asset still counts. The authenticated endpoint's role is a claim; author signatures and content are verified on open.

The client tries 0x11 first and retries unchanged 0x0b only after not-found or refusal (old clients refuse unknown kinds). It never downgrades invalid/oversized replies, timeouts, or connection failures. A provider without classified roles declines 0x11. 0x0b retains its exact bytes and all Markdown pages, including indexes; its rows have unknown roles and must not nominate a homepage.

A v2 device list omits landing rows while retaining those rows for homepage selection. Only a complete, single-publication catalog with a served root index.md identifies a homepage. A second publication still counts even if all of its Markdown rows are landings. A truncated/legacy catalog, multiple publications or missing root index falls back transparently to its list. A leaf root index may be both a post and the homepage. No per-publication network fetch is needed to classify the catalog.

25b. One address per installation

New app registrations use SetAddress, signed by the installation's existing endpoint key. The base is domain.device.mdw with two lowercase labels of up to 63 ASCII letters, digits or non-terminal hyphens. A registry can prefix a decimal increment from 1 through 9999. It reports exhaustion when all candidates are taken. A signed receipt identifies the exact assigned name and device key. A numbered offer for a replacement requires confirmation.

A replacement commits the new assignment and a redirect from the former name in one entry. A shared device link includes ?device=<endpoint-id>. When the reverse record identifies a newer name for that endpoint, the reader displays the updated address. When a registry cannot confirm the alias, the pinned endpoint can still be opened by its stable key. The covered deployment is a configured test or self-hosted registry.

25c. Independent registry join preview (read only)

xan_names::join::preview_join computes a bounded proposed reconciliation for explicitly trusted test/self-hosted registries. It does not import a bootstrap, allocate a live name, publish a DHT record, change a device key or alter either registry. Client::address_join_evidence reads the saved device operation, its original group-signed SetAddress receipt and a currently valid device-bound name record. The public JSON evidence contains those proofs in lowercase hex, plus the source network and group-key identifiers; it contains no private keys. Evidence cannot grant trust to its own source. The caller supplies and validates the trusted bootstrap files separately.

The verifier checks the owner signature, receipt signature and exact operation digest; the receipt's assigned owner/name/generation; and the current signed record's matching endpoint key, name and generation. Only successful SetAddress receipts participate. Legacy Reserve records, released names, expired proofs, future clock/index inconsistencies and unknown registries fail the whole preview. Renewing or refreshing a record never replaces its original receipt's registered_at. A renamed address needs the receipt for the replacement registration; the first ever use of an endpoint key does not reserve priority for every name it might later choose.

For each requested domain.device base, order unique devices by witnessed registration time, then group key, network id, source assignment generation and device key as deterministic ties. Assign the base to the first device, then increments 1 through 9999. An endpoint registered with the same base in multiple sources participates once, using its earliest verified witness, and retains every source origin. If one endpoint currently claims different bases across sources, refuse the preview until its owner chooses which address to retain. Input ordering and duplicate evidence do not change the result. The limits are eight trusted registries, 4,096 evidence items, 16 KiB per JSON evidence file, and the existing per-proof byte limits.

Every proposed address retains its original endpoint key. The preview exposes the existing mdw://<old-name>/?device=<endpoint-id> links, its proposed name with the same device pin, and the stable mdw://<endpoint-id>/?view=device link. A collision does not authorize a bare old name to redirect to two different devices. Endpoint-pinned links preserve identity even when an alias cannot yet be confirmed; existing publication-key page links remain unchanged.

The result includes the checked signed source indices, heads and times, the earliest proof or assignment expiry, and a deterministic evidence digest. Conflicting heads or times at one source index are refused. A source's newer record supersedes an earlier still-valid record for the same device. Repeated receipts/records are idempotent. A head is evidence of what those selected signers signed, not proof of a complete, latest or atomic export; a record can remain valid during the existing three-hour stale tail. Rebuild and review after any source changes or proof expiry.

Witnessed time means the selected source operators' committed clock, with the existing skew bound. It is not objective global chronology. Unknown sources are refused before ordering. A signature does not prove clock honesty: admitting a malicious trusted quorum would let it claim an ancient registration time. FROST authenticates the source's statement under the current honest-process/crash-only model; it supplies neither cross-registry consensus nor Byzantine finality.

Applying a join is not implemented. It requires complete consistent source checkpoints, a mutual freeze/handoff so neither registry keeps allocating divergent names, approval of the exact merge digest by both source quorums, destination quorum/key-policy compatibility, durable replay and idempotent recovery, and coordinated forward/reverse records while old proofs age out. A preview digest is unsigned and grants no such authority. No public bootstrap, operator ceremony, live registry mutation or production rollout is part of this slice.

The follow-up stopped-role migration tools add complete checkpoint replay, durable source freeze, exact source-quorum approval, fresh destination genesis import, destination-quorum certification and explicit role activation. Native/CLI device adoption checks current gen-0 ownership under an already selected destination; imported leases and endpoint keys survive without another initial registration. Certified genesis provenance preserves original priority through later joins. Source resume, abort and an automatic multi-host cutover remain unavailable. No bootstrap becomes trusted through a migration file or discovery hint.

26. Signed Markdown replies

The writer can enable a reply thread for a public Markdown page. Each reply is a separate signed Markdown document in a canonical JSON envelope. Its target binds the original publication, path, version, page hash, manifest hash and optional parent reply hash. The reply ID is the BLAKE3 hash of the canonical envelope. By default, the reply is signed with a pseudonymous key derived for the publication. The reader can choose to use their public identity instead.

New envelopes are sealed to the writer's X25519 inbox key. Peer request 0x0c carries a publication, path and encrypted envelope. It returns the reply digest after durable receipt by the writer. The acknowledgement does not indicate approval. The writer reviews the exact bytes and approves them into the next author-signed version. The signed manifest contains the thread file at mdw-replies/<BLAKE3 hex of logical page path>.json. The reader verifies that attachment and its reply signatures. Saving the public page retains the verified thread for offline reading and redistribution. Turning off submissions leaves previously approved replies readable.

Format 2: a comment as a W3C Web Annotation

A new comment is a W3C Web Annotation (Web Annotation Data Model) with a pin and a signature. The first format above stays valid and is still read.

{"annotation":{
   "@context":"http://www.w3.org/ns/anno.jsonld",
   "id":"urn:uuid:3f0c6a52-9d1e-4c7b-8a55-0b2f6e9d4c11",
   "type":"Annotation",
   "motivation":"commenting",
   "creator":"did:key:z6Mk…",
   "created":"2026-11-24T18:30:00Z",
   "body":{"id":"mdw://<publication>/mdw-comments/<page hash>/3f0c6a52-9d1e-4c7b-8a55-0b2f6e9d4c11.md",
           "type":"TextualBody","value":"…Markdown…","format":"text/markdown"},
   "target":{"type":"SpecificResource","source":"mdw://<publication>/<path>",
             "selector":{"type":"TextQuoteSelector","exact":"…","prefix":"…","suffix":"…"}}},
 "pin":{"publication":"…","path":"…","pageHash":"…","manifestHash":"…","version":5,"parent":null},
 "signature":"<hex>"}

What the author's version carries for a page with comments, all made in one version so no reader sees one without the others:

Path What
mdw-comments/<page hash>.json The thread in format 2: every approved comment of either format, the inbox key and the keepers.
mdw-replies/<page hash>.json The thread in the first format, for readers that predate format 2: the first-format comments and the same inbox and keepers.
mdw-comments/<page hash>/<uuid>.md One per approved comment: its Markdown, as a document of its own.

Inline replies

Approved comments are rendered inline with author attribution and nested replies. The signed thread authorizes each association by reply hash. Each reply retains its own signed body and identity when a comment is removed from the thread. Disabling submissions changes the inbox state while preserving previous associations. Existing signed threads remain readable.

An author may additionally sign up to four inboxNodes endpoint IDs into the thread. This is a voluntary sealed-mail service, distinct from a public saved copy: a keeper operator must explicitly allow that publication (xan node --comment-inbox mdw://ID/) and hold its verified public thread listing this keeper. Readers try the writer first, then those exact keepers. No keeper is added by default and a director or relay alone is not a comments keeper. The operator's policy cache retains current manifests and at most 4 MiB of thread metadata per publication (32 publications maximum). It does not fetch page/image bodies and sweeps old policy versions after refresh. The opaque mail quota below is separate from this bounded metadata cache.

The 0x0e/0x0f signature domain is mdw/1 comments inbox control. Its message is the request without its final signature, then the keeper's 32-byte endpoint key, then a 32-byte TLS exporter using that domain as label and the preceding message as exporter context. This binds publication key possession to the keeper, operation, publication, path, ciphertext hash where applicable, and fresh QUIC/TLS connection. A proof from another connection, keeper, thread or operation fails. An identical replay within that same connection is nondestructive collection or an idempotent ack. The signed manifest's serving routes confer no inbox-control authority.

The opaque spool is separate from blobs, public catalogs, search and approved threads. Each keeper holds at most 256 envelopes / 16 MiB globally, 64 envelopes / 4 MiB per publication, and eight envelopes / 512 KiB per authenticated source endpoint across publications. Byte caps include the stored envelope metadata. Mail expires after seven days; retries do not extend its original receipt time. Deposits use the normal 60-request/minute source limit; authenticated collection/ack requests have a 256-request/minute ceiling to drain a full bounded spool without weakening deposit limits. The ordinary serving switch apply. A closed or unlisted inbox stops new deposits once the keeper learns its new signed version; an offline keeper cannot promise immediate revocation. Invalid or unpersisted mail is never acknowledged away by the writer. Old approved copies remain readable and cannot be recalled.

27. Direct DHT routes

A publisher, keeper or director can advertise its public QUIC socket addresses in a Mainline BEP 44 mutable item keyed by its endpoint key with salt project-xan/iroh-route/1. The value is a space-separated list of up to eight socket addresses. The sequence is Unix time in microseconds. Readers accept records up to 90 minutes old, with 60 seconds of forward clock tolerance. Public lookup filters local and special addresses. An isolated test DHT permits only loopback routes. Iroh authenticates the endpoint before exchanging MDW data. A reader doing ordinary navigation does not make a direct route announcement.

This supplies a direct path from a publication pointer, keeper advertisement, or director announcement to the peer. Direct routing can run without an HTTP mirror, a relay, or a vendor address lookup. Existing relay paths remain available for peers that need NAT traversal.

28. Device catalogue detail and private writing sync

The optional byte 0x12 requests the detail catalogue from the same authenticated endpoint used by 0x11. It answers with deterministic CBOR [truncated, rows]. A row contains the publication key, logical path, publication title, landing flag, publisher flag, post title and optional RFC 3339 date as text. An empty date indicates no known publication date. Nodes derive their own role from locally verified publication manifests and report saved copies separately. This is an endpoint's report. The page still verifies against its author when opened. Older endpoints retain their existing 0x0b and 0x11 response formats.

The optional 0x13 request exchanges a private writing frame between a linked editor and its publishing host. The transport authenticates both endpoints and encrypts the exchange. The host checks the caller's endpoint ID, membership and the private group identifier before reading the workspace or accepting a change. A new member receives a passphrase-encrypted invitation signed by both the owner and the host endpoint, bound to the recipient endpoint, public site identity and expiry. The member checks the host proof against the device ID supplied independently of the file. The invitation contains no signing keys. A revoked endpoint cannot enter the writing service.

Writing frames are bounded UTF-8 JSON. A request contains the group ID, the randomly generated grant from the encrypted invitation and an action to read the inventory, read a block, send a block, delete a file or request publication of one page revision. The host matches the grant's hash against the membership for the authenticated endpoint. Reissuing an invitation creates a new grant. A write declares its expected base, complete content hash, size and sequential block offset. The host verifies exact bytes before replacing a file under the granted folder. Requests carry at most 128 KiB and responses at most 2 MiB. The largest block of file bytes is 64 KiB. An editor uses the last common revisions to distinguish changes authored on each device. Both copies survive an unresolved clash. Public catalogues and content requests see signed snapshots, while writing sync uses the private working pages.

29. Private Identity Web

Optional request kind 0x14 on the existing authenticated peer protocol exchanges private JSON request and response records. It shares the normal MDW endpoint routes, including DHT lookup and optional relays. The request payload is bounded to 64 KiB and replies to 128 KiB. A peer without the service gives the ordinary not-found reply. No membership record, pairing credential, or private control request appears in a public directory, catalog or DHT value.

Pairing uses a mdw-pair: link containing the exact authority endpoint, an independently random 32-byte secret, and optionally an Iroh endpoint ticket for initial routing. The authority retains the secret's BLAKE3 hash for five minutes. It binds the first accepted request to its authenticated sender. Confirmation compares a short code derived from the hashed secret and both endpoint IDs. The accepted device receives the signed roster. It retains the device's own established keys and no person or publication private key travels in the invitation.

Pairing by address

Your identity → Your devices → Pair a device starts a temporary listener on the selected local or VPN IP address. Enter that address, its TCP port and the eight-digit random code on the other device. A password-authenticated exchange uses SPAKE2 to derive separate keys for the joiner’s confirmation and the encrypted invitation. The listener can try up to six connections over five minutes. The encrypted invitation is the existing endpoint-bound pairing link. It transfers once and the listener closes.

The TCP exchange sends a 33-byte SPAKE2 A message, then a 33-byte B message. The Ed25519 group identity strings are markmallow lan pairing v1 joiner and markmallow lan pairing v1 host. From the SPAKE2 output, BLAKE3 derive-key makes two 32-byte keys with contexts Markmallow LAN pairing v1 joiner confirmation and Markmallow LAN pairing v1 host invitation. A sends a 32-byte HMAC-SHA-256 over markmallow lan pairing v1. B verifies it before returning the invitation. B sends a big-endian u16 length followed by the invitation encrypted with ChaCha20-Poly1305, a 12-byte zero nonce and the same prologue as associated data. The key encrypts one invitation. Length includes the 16-byte tag. The plaintext is a UTF-8 pairing link of at most 4,400 bytes.

Address pairing uses pairPreview (token and device name), pairConfirm (token and confirmation code), and the existing check over authenticated peer streams. The link flow may fall back to legacy join when a host does not answer pairPreview. A new link client still checks the confirmation code before installing an approved roster.

Both screens display the same confirmation code. The authority signs membership after both devices confirm the authenticated pair. Cancel and expiry clear pending pairing. Signed membership is stored by device ID. Moving between network routes affects reachability. The device stays in Your devices until a signed removal applies. QR scanning and Bluetooth are proposed ways to carry the initial invitation through the same confirmation steps.

The authority signs the deterministic JSON serialization of {owner,authority,revision,devices} with domain mdw identity web roster 1. A member is {device,name,manageDirectors}. The receiver checks the exact introductory endpoint, its own membership and the owner's strict Ed25519 signature. Later lists must have the same owner and authority and a strictly higher revision. Active members can exchange the signed list over authenticated connections. A disconnected peer can retain the last revision it saw. The owner signs revisions on the device that manages the identity.

A member's name is for people. It is what the reader called the device, the device's computer name, or a word for what the device is (Phone, Computer). A list never holds the same name twice: the later one gets a number (Phone 2). It never holds the words This device, which every device in the list would read as itself. A list that was saved with those words is corrected by the device that manages it, in a new revision. An implementation shows which row is the reading device by its ID.

Linked keepers expose only public saves and accept new copies after a local opt-in. A request carries the original MDW address, signed version and manifest hash. The keeper resolves and verifies the exact requested copy with the regular reader's manifest and blob checks. A success receipt means the keeper has durably recorded the copy in its local library. The author's signature, address and attribution travel with it.

An owned director's mutation uses a separate mdw identity web director grant 1 signature over caller, expiry, owner roster revision and the target director's exact reviewed action, subject and catalog revision. The authority checks current permission before signing. The target checks the caller and destination against its authenticated connection, signature, lifetime and current local revision. A successful mutation advances the durable revision so the same grant cannot apply again. The owner's authority must be reachable for a fresh remote mutation. Public search and private search credentials provide no admin authorization. These actions change that director's local policy and leave publisher-signed withdrawals unmodified.

An operator can opt a headless xan node director into enrollment using --identity-pair FILE --device-label NAME. FILE contains the temporary pairing link. The operator compares the code printed on the host before approving. Later restarts use the same device key and its persisted signed roster.