LNS web Draft · 27 November 2026

5. Site format

A site is a tree of folders. Each folder is described by one short text file, its list, in the format lns-links/1. The record pins the root list, and every list pins what it contains.

Describes lns-links/1 as parsed by Names Browser core 0.3.6 (links.rs) and by the shared parser in logic.mjs, which the gateway and lns publish import. The two parsers are kept in step and tested against each other.

5.1 Overview

A list is a UTF-8 text file. Its first line names the format. Each other line names one file or one subfolder of that folder, with the Logos Storage content ID (CID) where its bytes are, and the SHA-256 of those bytes. A subfolder's line points at the subfolder's own list.

Because each list holds the hash of everything below it, a change to one file changes its folder's list, then that list's parent, and so on up to the root. The root list's hash goes in the record. Folders that did not change keep the same bytes, hash and CID, so a publisher can reuse them.

A tree for a site with a home page, a stylesheet and one page in a folder:

record   cid = CIDrootlist  cid.sha256 = 46e9b706…
└ /      root list
  ├ docs/       CIDdocslist   46340f14…
  │ └ intro.html  CIDintrohtml  8986a160…
  ├ index.html  CIDindexhtml  a9976790…
  └ style.css   CIDstylecss   e78baba7…

Appendix C has the full lists and the real hashes for this tree.

5.2 Encoding and size

A client MUST reject a list larger than 2 MiB, with more than 10,000 entries, or containing a control character other than TAB, CR or LF.

Enforced in links.rs parse_links_list and logic.mjs parseLinksList.

5.3 Header

The first line, after trimming, is exactly:

# lns-links/1

A client MUST reject a list whose first line is not # lns-links/1.

Enforced in parse_links_list and parseLinksList.

5.4 Directives and comments

A line that starts with # is a directive or a comment. Spaces after the # are allowed.

LineMeaning
# index <name>The file shown when the folder itself is requested. Default index.html. The value follows the name rules in 5.5. At most one per list.
# title <text>A title for the folder, shown in the browser's interface. Capped at 200 characters. The Names Browser removes BiDi and control characters before showing it.
any other # lineA comment. Ignored.

A client MUST reject a list with two # index lines, or with an # index value that is not a valid name.

Enforced in parse_links_list and parseLinksList.

5.5 Entries

Every other non-empty line is an entry. Its fields are separated by one or more spaces or tabs.

<name>  <cid> <sha256>     a file
<name>/ <cid> <sha256>     a subfolder (its list)
FieldRule
nameOne path segment: 1 to 255 bytes of UTF-8. Not . or ... No whitespace, no control or BiDi characters, and none of / \ ? # < > " '. A trailing / marks a folder and is not part of the name.
cid8 to 128 ASCII letters and digits. Only the format is checked (see 6.2).
sha25664 hex digits, the SHA-256 of the bytes the CID names. Either case is accepted; it is compared in lower case.

Names are compared byte for byte. There is no case folding, so About.html and about.html are different entries.

A client MUST reject the whole list if a line has fewer than two or more than three fields, a name breaks the rules above, a CID or hash is malformed, or two entries share a name. A file and a folder with the same name count as a duplicate.

Enforced in parse_links_list and parseLinksList.

5.5.1 Entries without a hash

The grammar still accepts an entry with two fields, a name and a CID, from an earlier form of the format. No current client will fetch one.

A publisher MUST write a SHA-256 on every entry.

A client MUST NOT fetch or show a file or folder whose entry has no SHA-256.

The Names Browser skips such entries with "Unverified file skipped" (Main.qml). The gateway resolves with requireSha256: true and answers 502 (serve.mjs). lns publish always writes the hash (publish.mjs publishDir).

5.6 Canonical form

The bytes of a list are hashed, so the same folder should always produce the same bytes. lns publish writes this form (formatLinksList in logic.mjs, format_links_list in links.rs):

  1. The header line.
  2. # title <text>, on the root list only, when a title is set.
  3. # index index.html, when the folder has an index.html.
  4. One line per entry, sorted by the UTF-8 bytes of the name in ascending order (the folder / is not part of the sort key), with single spaces and the hash in lower case.
  5. LF after every line, including the last. No blank lines and no comments.

A publisher SHOULD write lists in canonical form, so that an unchanged folder keeps its hash and CID.

Not a client requirement: both parsers accept entries in any order and sort them after parsing.

The root list of the example tree, as lns publish writes it:

# lns-links/1
# title Alice
# index index.html
docs/ CIDdocslist 46340f143bb7c2c8…dbc6647d
index.html CIDindexhtml a997679004baf5f6…7313c1b9
style.css CIDstylecss e78baba75d251d30…b5557574

Hashes are shortened here to fit the page. Appendix C has them in full.

5.7 Paths and resolution

A client turns the path of an lns:// address into an entry like this.

5.7.1 Normalising the path

  1. Refuse a path with control characters.
  2. Cut off the fragment (from the first #), then the query (from the first ?). The query plays no part in resolution.
  3. Note whether the path ends with /. An empty path counts as /.
  4. Split on /. Drop empty segments and .. A .. removes the segment before it, and never climbs above the root.

5.7.2 Walking the lists

  1. Start at the root list, at the first segment.
  2. Look the segment up by name in the current list. If there is no entry, the path is not found.
  3. If the entry is a folder, fetch its list, check its hash (section 6), parse it, and continue with the next segment in that list.
  4. If the entry is a file, it must be the last segment and the path must not end with /. Otherwise the path is not found.
  5. When the segments run out on a folder, return that folder's index entry (# index, default index.html). If it is missing or is a folder, the path is not found.

So /docs and /docs/ both resolve to the index of docs. The canonical address of a folder ends with /.

A client MUST stop and report an error when folder nesting along a path exceeds 32.

Enforced in resolve_links_tree (MAX_LINKS_DEPTH) and in the gateway's resolveLinksTree.

Encoding. The Names Browser compares segments as written, with no percent-decoding. The gateway accepts only the canonical percent-encoding of each segment and answers any other spelling with 404 (section 8.3). Names with spaces or quotes cannot occur, because the name rules forbid them.

5.8 Pinning the root

There are two ways to pin the root list.

5.8.1 In Logos Storage (the usual way)

Upload the root list to Logos Storage and set three text entries in the record:

EntryValue
cidThe root list's CID.
cid.sha256The SHA-256 of the root list's bytes.
cid.typelinks

Changing a site of any size is then one record update (section 9.6).

5.8.2 On chain

Store the root list itself as the name's on-chain page, with the content type text/vnd.logos.lns-links; version=1. Subfolders and files still come from Logos Storage. The record then needs no cid entry, and the root list is read with the record through the RPC.

An on-chain root list MUST be smaller than 10,240 bytes. A client MUST refuse one of 10,240 bytes or more.

Enforced in Main.qml (MAX_ONCHAIN_LINKS_BYTES), serve.mjs loadSiteRoot and publish.mjs.

The Names Browser needs Basecamp's Storage module to follow an on-chain root list into Storage.

5.9 Other root forms

Clients still read two older forms. lns publish writes neither.

A client decides which form a root is from cid.type, and otherwise from the bytes: a first line of # lns-links/1 means a list, a parseable manifest means a manifest, and anything else is a single file.

5.10 Limits

LimitValue
List size2 MiB (2,097,152 bytes)
Entries per list10,000
Folder depth along a path32
Name (segment) length255 bytes
CID length8 to 128 characters
Folder title200 characters
On-chain root listunder 10,240 bytes
Site size in lns publish2,000 files, 200 MiB in all, 100 MiB per file (defaults, configurable)
Previous tree read by lns publish when diffing50,000 files and 50,000 folders

Appendix B lists every limit across the browser, the gateway and the publisher.

5.11 Logos Storage

Site files and folder lists live on Logos Storage, a peer-to-peer content-addressed network. This section describes how LNS web uses it today.