Open a site without its DNS name: site reference v0, discovery hint, open-site resolver (#7) #12

Merged
rhelwig merged 3 commits from feat/no-dns-test-site into main 2026-10-10 20:45:13 +00:00
Owner

First increment for #7: open a published site by Dash identity + contract + site key, without looking up its hostname. No browser extension yet; this is the groundwork it will reuse. No Platform writes, no Dash spend.

What's in it

  • packages/core/src/site-ref.ts: provisional site reference v0 (decentsite:?v=0&net=…&contract=…&layout=…&owner=…&site=…[&release=…][&path=…][&name=…][&host=…], JSON also accepted). name and host are hints only; lookup uses network/contract/owner/site(/release).
  • Stub: GET /.well-known/decentsite.json discovery hint (CORS-open, 60 s cache) and siteReference in /health. Built from Stub config only, never from the request Host header. Optional DECENT_SITE_OWNER_NAME.
  • scripts/open-site.mjs (npm run open-site -- …): resolve [--verify] (Platform read + SHA-256 check of every blob), serve (local Stub for a reference on 127.0.0.1), discover <https-url>, ref. Read-only: no keys, no writes, no fees.
  • scripts/no-dns-test-site.mts: dry-run test-ronhelwig-com site (host hint test.ronhelwig.com) in a separate local data dir with the local backend. It refuses to use the real Admin data dir.
  • docs/NO-DNS-SITE-REFERENCES.md: design, resolution steps, gaps, a mainnet publish plan that needs approval, and LibreWolf/Brave/Chromium/Firefox/Safari notes.

Verified

  • npm test: 180/180 pass (4 new in tests/site-ref.test.ts); typecheck is clean.
  • Live ronhelwig.com resolved by reference alone from the laptop (read-only): active release release_5424b47e…, 18/18 blobs hash-verified in about 10 s, and serve rendered it on 127.0.0.1:8792 with Recent posts and Markdown.
  • Dry-run no-DNS site served on 127.0.0.1:8793, and test.ronhelwig.com has no DNS record.

Gaps found (in the doc)

  1. The Platform site record has publicBaseUrl: null, so there is no owner-signed hostname claim yet. Proposal: put a hostnames list in the site record JSON (no schema change).
  2. The only preferred content source is ipfs.ronhelwig.com, which goes down with the domain if it's blocked. Add a source on an unrelated domain.
  3. Check the SDK's trusted quorum service and DAPI seed discovery for DNS dependence.
  4. Clickable links will probably need web+decentsite: (browsers only allow web+/ext+ custom schemes).
  5. Exact-edition serve and DPNS-name lookup are still to do.

Deploying this Stub change to the VPS is not part of this PR.

First increment for #7: open a published site by **Dash identity + contract + site key**, without looking up its hostname. No browser extension yet; this is the groundwork it will reuse. No Platform writes, no Dash spend. **What's in it** - `packages/core/src/site-ref.ts`: provisional **site reference v0** (`decentsite:?v=0&net=…&contract=…&layout=…&owner=…&site=…[&release=…][&path=…][&name=…][&host=…]`, JSON also accepted). `name` and `host` are hints only; lookup uses network/contract/owner/site(/release). - Stub: `GET /.well-known/decentsite.json` discovery hint (CORS-open, 60 s cache) and `siteReference` in `/health`. Built from Stub config only, never from the request `Host` header. Optional `DECENT_SITE_OWNER_NAME`. - `scripts/open-site.mjs` (`npm run open-site -- …`): `resolve [--verify]` (Platform read + SHA-256 check of every blob), `serve` (local Stub for a reference on 127.0.0.1), `discover <https-url>`, `ref`. Read-only: no keys, no writes, no fees. - `scripts/no-dns-test-site.mts`: dry-run `test-ronhelwig-com` site (host hint `test.ronhelwig.com`) in a **separate** local data dir with the local backend. It refuses to use the real Admin data dir. - `docs/NO-DNS-SITE-REFERENCES.md`: design, resolution steps, gaps, a mainnet publish plan that needs approval, and LibreWolf/Brave/Chromium/Firefox/Safari notes. **Verified** - `npm test`: 180/180 pass (4 new in `tests/site-ref.test.ts`); typecheck is clean. - Live ronhelwig.com resolved **by reference alone** from the laptop (read-only): active release `release_5424b47e…`, 18/18 blobs hash-verified in about 10 s, and `serve` rendered it on 127.0.0.1:8792 with Recent posts and Markdown. - Dry-run no-DNS site served on 127.0.0.1:8793, and `test.ronhelwig.com` has no DNS record. **Gaps found (in the doc)** 1. The Platform site record has `publicBaseUrl: null`, so there is no owner-signed hostname claim yet. Proposal: put a `hostnames` list in the site record JSON (no schema change). 2. The only preferred content source is `ipfs.ronhelwig.com`, which goes down with the domain if it's blocked. Add a source on an unrelated domain. 3. Check the SDK's trusted quorum service and DAPI seed discovery for DNS dependence. 4. Clickable links will probably need `web+decentsite:` (browsers only allow `web+`/`ext+` custom schemes). 5. Exact-edition `serve` and DPNS-name lookup are still to do. Deploying this Stub change to the VPS is not part of this PR.
- core: provisional site reference v0 (decentsite:?v=0&...), validate/format/parse
- stub: /.well-known/decentsite.json discovery hint + siteReference in /health,
  built from config only (never the Host header); optional DECENT_SITE_OWNER_NAME
- scripts/open-site.mjs: read-only resolve (--verify hashes), serve, discover, ref
- scripts/no-dns-test-site.mts: local dry-run site for test.ronhelwig.com
- docs/NO-DNS-SITE-REFERENCES.md: design, gaps, mainnet plan, browser notes
Per Ron's direction, the test publication for test.ronhelwig.com is small,
unique and self-explaining instead of a stand-in that could be dismissed as
a passthrough of an existing site.

- acceptance/no-dns-test-site/: three original Markdown templates (home,
  "Check it yourself", "Why there is no DNS record") that name DecentSite and
  link the repository. The builder inserts a random per-build fingerprint
  sentence that is never committed.
- "Check it yourself" walks readers through proving the site record and
  release are on Dash Platform (independent Platform Explorer), the bytes are
  on IPFS (sha256sum), and the two are bound (bodyHash, and the SHA-256
  inside bafkrei CIDs). Steps checked against ronhelwig.com's live records.
- scripts/no-dns-test-site.mts: fills templates for the intended mainnet
  reference, separate data dir, local backend only; --fresh, --marker,
  --export; removes stale dry-run pages.
- scripts/open-site.mjs proof: read-only evidence chain (site -> release ->
  CID + SHA-256 per blob, CID-embedded hash check, explorer/gateway URLs,
  fetch + hash). Passes for ronhelwig.com (18/18 blobs).
- docs/NO-DNS-SITE-REFERENCES.md: test-site rules, manual steps, updated
  publish plan, and new gap 0: ipfs.io/dweb.link now return a notice page
  instead of bytes, so the default fallback gateway is effectively dead.

No Platform writes, no IPFS uploads, no Dash spend.
Author
Owner

Second increment pushed (3759e10), following Ron's direction for the test site.

Test site is now small, original and self-explaining (not a copy of ronhelwig.com, so it can't be dismissed as a passthrough):

  • acceptance/no-dns-test-site/: three short Markdown templates, "No Address Needed": home (what this is, names DecentSite, links this repo), /verify/ "Check it yourself", and one post /posts/why-no-dns/ (a name is a label; extension plans for LibreWolf + Brave first).
  • The builder adds a random per-build fingerprint sentence that is never committed, so the published wording exists nowhere on the DNS web, not even in this repo. Keep the printed marker and pass --marker to publish that exact text.
  • Text describes the intended mainnet reference (owner rhelwig7.dash, contract Hm7T6…, site key test-ronhelwig-com, host hint test.ronhelwig.com, no DNS), so it can be published without edits.

Manual verification page walks a reader through, with only dig/curl/sha256sum (optional ipfs) and the independent Platform Explorer:

  1. dig shows no DNS record; 2. explorer site document by siteKey → owner + activeReleaseId; 3. release document → the full list of version ids; 4. contentVersion → bodyStorageId (CID) + bodyHash (SHA-256); 5. fetch from IPFS and sha256sum = bodyHash; 6. for bafkrei… CIDs, ipfs cid format -b base16 shows f01551220<sha256>, so the CID itself is the signed hash; 7. compare with the page / View Markdown (the .md route is byte-identical to the blob). Plus what this proves and doesn't. All steps checked by hand against ronhelwig.com's live records.

Tooling

  • scripts/no-dns-test-site.mts: fills the templates, separate data dir, local backend only; --fresh, --marker, --export <dir> (filled Markdown for pasting into Admin); drops stale dry-run pages.
  • scripts/open-site.mjs proof '<ref>': read-only evidence chain (site → release → per-blob CID + SHA-256, CID-embedded hash check, explorer/gateway URLs, fetch + hash). ronhelwig.com: 18/18 blobs pass; 17 raw CIDs carry the signed hash, 1 chunked JPEG checked by fetch.
  • docs/NO-DNS-SITE-REFERENCES.md updated (test-site rules, manual steps, publish plan).

New gap found (gap 0): ipfs.io and dweb.link now return a "switching to a service worker gateway" notice page (HTTP 200) instead of file bytes. The hash check rejects it correctly, but our default fallback gateway (https://ipfs.io) is effectively dead. Options listed in the doc (trustless raw-block fetch, another default, pinning service, local node); needs a decision.

Verified: dry run builds and serves 3 pages on 127.0.0.1:8793, test.ronhelwig.com has no DNS, npm test 180/180.

Not done (waits for Ron): mainnet publish of test-ronhelwig-com, VPS Stub update, merge. No Platform writes, no IPFS uploads, no Dash spent.

Second increment pushed (`3759e10`), following Ron's direction for the test site. **Test site is now small, original and self-explaining** (not a copy of ronhelwig.com, so it can't be dismissed as a passthrough): - `acceptance/no-dns-test-site/`: three short Markdown templates, "No Address Needed": home (what this is, names DecentSite, links this repo), **`/verify/` "Check it yourself"**, and one post `/posts/why-no-dns/` (a name is a label; extension plans for LibreWolf + Brave first). - The builder adds a **random per-build fingerprint sentence** that is never committed, so the published wording exists nowhere on the DNS web, not even in this repo. Keep the printed marker and pass `--marker` to publish that exact text. - Text describes the intended **mainnet** reference (owner `rhelwig7.dash`, contract `Hm7T6…`, site key `test-ronhelwig-com`, host hint `test.ronhelwig.com`, **no DNS**), so it can be published without edits. **Manual verification page** walks a reader through, with only `dig`/`curl`/`sha256sum` (optional `ipfs`) and the independent Platform Explorer: 1. `dig` shows no DNS record; 2. explorer `site` document by `siteKey` → owner + `activeReleaseId`; 3. `release` document → the full list of version ids; 4. `contentVersion` → `bodyStorageId` (CID) + `bodyHash` (SHA-256); 5. fetch from IPFS and `sha256sum` = `bodyHash`; 6. for `bafkrei…` CIDs, `ipfs cid format -b base16` shows `f01551220<sha256>`, so the CID itself is the signed hash; 7. compare with the page / View Markdown (the `.md` route is byte-identical to the blob). Plus what this proves and doesn't. All steps checked by hand against ronhelwig.com's live records. **Tooling** - `scripts/no-dns-test-site.mts`: fills the templates, separate data dir, local backend only; `--fresh`, `--marker`, `--export <dir>` (filled Markdown for pasting into Admin); drops stale dry-run pages. - `scripts/open-site.mjs proof '<ref>'`: read-only evidence chain (site → release → per-blob CID + SHA-256, CID-embedded hash check, explorer/gateway URLs, fetch + hash). **ronhelwig.com: 18/18 blobs pass**; 17 raw CIDs carry the signed hash, 1 chunked JPEG checked by fetch. - `docs/NO-DNS-SITE-REFERENCES.md` updated (test-site rules, manual steps, publish plan). **New gap found (gap 0):** `ipfs.io` and `dweb.link` now return a "switching to a service worker gateway" notice page (HTTP 200) instead of file bytes. The hash check rejects it correctly, but our default fallback gateway (`https://ipfs.io`) is effectively dead. Options listed in the doc (trustless raw-block fetch, another default, pinning service, local node); needs a decision. Verified: dry run builds and serves 3 pages on 127.0.0.1:8793, `test.ronhelwig.com` has no DNS, `npm test` 180/180. **Not done (waits for Ron):** mainnet publish of `test-ronhelwig-com`, VPS Stub update, merge. No Platform writes, no IPFS uploads, no Dash spent.
Public path gateways ipfs.io/dweb.link stopped serving programs on
2026-09-21. Readers now ask each gateway for a verifiable response first
(?format=raw for raw CIDs, ?format=car for chunked UnixFS files, every
block checked against its CID, file reassembled locally) and fall back to
the plain file. Wrong bytes move on to the next gateway instead of
failing the read. Defaults switch to independent public gateways that
still return bytes (Filebase, Pinata; tested 2026-10-10).

open-site.mjs gains --gateways, --local-ipfs and --no-preferred; proof
reports fetchedFrom and an independentCheck command per blob.
ronhelwig.com verified 18/18 without ipfs.ronhelwig.com.

The no-DNS test site lists a second, domain-independent preferred
source and can be added to the real Admin as drafts (--admin).
Author
Owner

Third increment pushed (4b46a8d): verify content without the owner's gateway.

  • ipfs.io / dweb.link retired programmatic service on 2026-09-21 (429 + "switching to a service worker gateway"); trustless-gateway.link timed out / 525. Working on 2026-10-10: https://ipfs.filebase.io (fast) and https://gateway.pinata.cloud (slower, rate-limited) — both plain, ?format=raw and ?format=car.
  • New packages/storage/src/trustless.ts (no deps): raw CIDs fetched as ?format=raw blocks and checked against the CID; chunked files fetched as ?format=car, every block checked, file reassembled locally. Plain file only as fallback (DECENT_IPFS_TRUSTLESS=prefer|only|off). Wrong bytes / notice pages move on to the next gateway instead of failing.
  • Default gateways (DEFAULT_PUBLIC_GATEWAYS) are now Filebase + Pinata instead of ipfs.io; Stub setup, example config, DEPLOY, SPECS reader algorithm and Auth's Stub-config/review defaults updated (Auth ships with the next APK; protocol tests pass).
  • open-site.mjs: --gateways, --local-ipfs, --no-preferred; proof shows fetchedFrom and an independentCheck curl per blob. ronhelwig.com verified 18/18 with --no-preferred (17 raw blocks + the 2.5 MB JPEG via CAR, all from Filebase, never touching ipfs.ronhelwig.com).
  • Test site: preferred sources are now ipfs.ronhelwig.com + ipfs.filebase.io; "Check it yourself" uses the independent gateway. no-dns-test-site.mts --admin adds it to the real Admin as drafts (backs up platform.json; no upload/publish).

Remaining (not code): availability still depends on some node providing the CIDs (today Ron's Kubo) — pin with a second provider. npm test 186/186, typecheck clean.

Third increment pushed (`4b46a8d`): **verify content without the owner's gateway.** - `ipfs.io` / `dweb.link` retired programmatic service on 2026-09-21 (429 + "switching to a service worker gateway"); `trustless-gateway.link` timed out / 525. **Working on 2026-10-10:** `https://ipfs.filebase.io` (fast) and `https://gateway.pinata.cloud` (slower, rate-limited) — both plain, `?format=raw` and `?format=car`. - New `packages/storage/src/trustless.ts` (no deps): raw CIDs fetched as `?format=raw` blocks and checked against the CID; chunked files fetched as `?format=car`, every block checked, file reassembled locally. Plain file only as fallback (`DECENT_IPFS_TRUSTLESS=prefer|only|off`). Wrong bytes / notice pages move on to the next gateway instead of failing. - Default gateways (`DEFAULT_PUBLIC_GATEWAYS`) are now Filebase + Pinata instead of ipfs.io; Stub setup, example config, DEPLOY, SPECS reader algorithm and Auth's Stub-config/review defaults updated (Auth ships with the next APK; protocol tests pass). - `open-site.mjs`: `--gateways`, `--local-ipfs`, `--no-preferred`; `proof` shows `fetchedFrom` and an `independentCheck` curl per blob. **ronhelwig.com verified 18/18 with `--no-preferred`** (17 raw blocks + the 2.5 MB JPEG via CAR, all from Filebase, never touching ipfs.ronhelwig.com). - Test site: preferred sources are now `ipfs.ronhelwig.com` + `ipfs.filebase.io`; "Check it yourself" uses the independent gateway. `no-dns-test-site.mts --admin` adds it to the real Admin as drafts (backs up platform.json; no upload/publish). Remaining (not code): availability still depends on some node providing the CIDs (today Ron's Kubo) — pin with a second provider. `npm test` 186/186, typecheck clean.
Sign in to join this conversation.
No reviewers
No labels
feature request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rhelwig/DecentSite!12
No description provided.