REALLY SMALL WEB (RSW)
RSW-0005 — Address Resolution
Revision 0.01 | Protocol rsw/1 | Format 1
MVP — experimental normative proposal
Developed by Pablo Murad
Pablo Murad — November 23, 2026
pablo@pablomurad.com

MUST and MUST NOT indicate requirements of the described profile; SHOULD indicates a recommendation; MAY indicates an option. Experimental document, not yet ratified or implemented. The rules of RSW-0001 through RSW-0003 remain applicable.

## 01. Objective

Defines the resolver for RSW-0004 URIs, without its own DNS, relay, or global discovery service. A successful resolution delivers a validated object and a reference to the page. There is no rendering before RSW-0001 to 0003 validation. RSW-0006 defines the index and RSW-0013 defines version selection.

## 02. Library and Sources

Store objects by H_png, preserving exact bytes, and a catalog of (key, name, version, hash), domain/key bindings, the largest observed edition, and previously validated locations. Sources are: the requested domain's index, indexes of explicitly added domains, local import, and exact HTTPS URLs authorized by the user. A peer by key contains no location; do not consult an unknown directory. The catalog is not proof of integrity: validate objects when used, or trust a validation cache tied to file integrity and validator version.

## 03. Algorithm

1. Validate the URI. Determine offline, normal, or explicit-update mode. Apply the network policy before any DNS.
2. SHA-256: look up the exact H_png locally; if absent and online, use a known source for that hash. Compare the hash before interpreting, then verify structure, manifest, and signature. Unsigned content can only be opened from explicit local import, never from an authenticated RSW download.
3. Key/name: search the catalog of verified publications. If v is present, select only edition v; in conflict, request the exact hash. Without v, select the head accepted by RSW-0013. When absent locally or during an update, search authorized indexes associated with the key, verify each one, and compare candidates per RSW-0013. Do not promote an unknown source or choose by response time.
4. Domain/name: consult the stored binding and index. Offline: use only a previously accepted association. Normal online: use the cache if available; if the object or binding is missing, fetch /.well-known/rsw.json over HTTPS. On explicit update, fetch the index even if cached. Verify signature, domain, and key; the first association is TOFU, presented to the user before being persisted. A key change blocks automatic promotion.
5. From the accepted index, find name; check version, hash, identity, and URL. A historical query may use cache or a known source of the edition; if unavailable, do not return a different edition. An older entry does not demote the head.
6. Download only the requested object, respecting the budget; compare the expected H_png, key, name, and version, and validate RSW-0001..0003. Apply RSW-0013 and write object and catalog state atomically. If the candidate version is in conflict, preserve it as evidence, not as head.
7. Resolve file or entrypoint within the inventory; check supported profile and RSW-0011 rules. The fragment stays local. Rendering is a separate step.

## 04. Secure Transport

HTTPS with TLS and hostname validation; port 443, without credentials, cookies, Referer, or automatic authentication. Index and object: GET, status 200, Content-Encoding absent or identity. Do not follow redirects in the MVP. Index limited to 256 KiB, object to 2 MiB, even if Content-Length is absent or incorrect; abort reading when exceeded. No unlimited reading, HTTP decompression, or implicit environment proxy. Validate all returned A/AAAA addresses; reject non-public, loopback, private, link-local, multicast, reserved, mapped addresses, and metadata services. Pin the approved IP to the connection while keeping hostname/SNI and TLS validation. Do not trust a second DNS resolution performed by another layer. No external connection initiated by content.

Recommended policy: 5 s connection timeout, 10 s headers, 30 s operation, up to two concurrent operations per origin. Local adjustments are allowed, with a finite budget. A local development mode only by explicit operator configuration and exact allowlist, never by manifest, and it is not equivalent to interoperable public publication. In offline mode, no DNS, HTTP, or remote verification.

## 05. Cache and Errors

A normal cache does not prove currency; present the last-consulted date, offline state, and manual update. A network failure allows opening a known copy with a warning, but does not present an update success. An invalid index, divergent hash, or key change does not erase the last accepted edition. Never merge fields from unauthenticated indexes. Limit sources consulted per operation (recommendation: 8); manual selection to exceed. No recursive search.

Errors: INVALID_URI, OFFLINE_MISS, NO_KNOWN_SOURCE, NOT_FOUND, TLS_ERROR, NETWORK_POLICY, NETWORK_ERROR, INVALID_INDEX, DOMAIN_KEY_CHANGED, IDENTITY_MISMATCH, OBJECT_HASH_MISMATCH, VERSION_CONFLICT, VERSION_UNAVAILABLE, FILE_NOT_FOUND, UNSUPPORTED_PROFILE. Security refusals and cancellation are distinguishable from content nonexistence.

## 06. Tests and Delivery

Test cache hit without network, offline mode with cache miss, new domain, key change, wrong hash, truncated response, private address after DNS, redirects, invalid TLS, multiple conflicting candidates, and historical edition. Use simulated transports in Go for tests without depending on external servers. Demonstrate three independent domains with links and offline operation. Pending: code, signed fixtures, concurrency tests, and SSRF review. References: RSW-0004/0006/0007/0011/0013; RFC 9110 https://www.rfc-editor.org/rfc/rfc9110.html .

License: CC0 1.0 (public domain dedication; see CC0-1.0.txt in the downloads area).
Developed by Pablo Murad | pablo@pablomurad.com
END — RSW-0005
