Commit graph

3 commits

Author SHA1 Message Date
Local Dev
755e97b5bb Ship Theseus 0.0.8: window.bcnr dApp API + eTLD+1 permission origins
Merges a parallel session's work with the multi-source BNS story from 0.0.7.

The dApp side (parallel session)
--------------------------------
* bcnr-preload.js — installs `window.bcnr` on every page via contextBridge.
  Read-only surface: resolveName(name), isRegistered(name), getBcnrTlds(),
  getRecordVersion(name), plus getPermissionOrigin() for diagnostics. All
  Promises; a missing name returns null (not throw). No signing, no wallet
  unlock — that surface is designed but deliberately out of scope for 0.0.8
  (see TheseusNavigator/DESIGN-integrated-wallet.md).
* bcnr-origin.js — pure function that computes the eTLD+1 permission origin
  for a URL. ICANN suffixes via `psl` (same PSL Chromium uses, handles
  .co.uk / .github.io / etc); BNS names key off the on-chain TLD list so
  foo.wallet becomes a public suffix as soon as `wallet` appears there.
  Match browser cookie / MetaMask semantics: a grant on pay.merchant.com
  covers account.merchant.com but not evil.com.
* dev/bcnr-selftest.js, dev/origin-selftest.mjs — self-tests, no I/O.
* main.js wires bcnr-preload.js into session.defaultSession.setPreloads() so
  it runs BEFORE per-WebContentsView preloads; adds bcnr:* IPC handlers.
* preload.js + chrome.html — small hooks so the shell picks up window.bcnr
  the same way regular content does.
* package.json — psl dep, bcnr-preload.js/bcnr-origin.js in `files`.

Also included
-------------
* AriadneResolver/mobile/.../UpdateCheck.java — in-app update-check for the
  Android app; already active in the shipped 0.11 APK (build.ps1 -Recurse
  picked it up), formalising the source now.
* TheseusNavigator/snapshots/bns-name-snapshot.json — refreshed bundled
  starter (73 beacon txs, root c37b8596…c54e414ba).
* Site pages + manifest updated to point at 0.0.8.

  TheseusNavigator-Setup-0.0.8.exe    95.4 MB
    21939743eafdfe8742a6b7c4b987bd2782384d7bc41289cb80a7e08019dc9f02
  TheseusNavigator-0.0.8-portable.exe 92.7 MB
    2aa429fe39dc0fa4ac040fc6d6eb31b0f890c8a83175c49fcb50f052c480d39d
2026-08-31 01:38:55 +02:00
Local Dev
2fc428c220 Theseus 0.0.7: multi-source BNS with continuous delta refresh
The first .bch page now opens with zero user-visible latency and stays fresh
for as long as the browser runs. Four sources conspire in parallel — none of
them can block a navigation:

 1. Warm start from disk (sync)
    warmFromSnapshot loads the user-cache snapshot first, then falls back to
    the copy bundled with the build. sharedIndex is set BEFORE the first
    navigation can even fire.

 2. Continuous background delta refresh (every 30 s)
    startBnsPolling opens one electrum connection, fetches the beacon
    history (a single call), and only pulls verbose tx bodies for txids we
    don't already have — mergeFreshHistory-style. Merges into memory,
    rebuilds the index locally, persists the enlarged snapshot to disk.
    Turns a ~60 s full walk into ~1 s per new event.

 3. Sia snapshot pull on boot (one-shot, wins the NEXT boot)
    refreshSnapshotFromSia downloads the operator's published snapshot from
    s3.silentmode.st for the next launch. After a long idle period the
    browser resumes from that fresher snapshot instead of walking days of
    events.

 4. ensureIndex full-walk fallback
    Still runs on boot for the case where there's no bundled snapshot AND
    the poll hasn't landed yet — very first launch, offline install, etc.

resolveHost now prefers sharedIndex (which the poll keeps live) and, on a
miss with a stale index, triggers pollAndMerge (delta fetch) instead of
ensureIndex (full walk). The old full-walk fallback is only taken if the
delta primitives aren't available (running against an older resolver-web).

Argus/src/lib/resolver-web.js exports connectElectrum so the Theseus poll
can drive its own ad-hoc queries against the pool without duplicating the
Electrum wrapper.

Bundled starter snapshot refreshed: 73 beacon txs, root c37b859682…54e414ba.

Artifacts:
  dist-public/TheseusNavigator-Setup-0.0.7.exe    (95.4 MB)
    sha256 1b0dabcd2b13067aa1fd89c3271708b35ba22dfc7a620e248b35e0487b7a104f
  dist-public/TheseusNavigator-0.0.7-portable.exe (92.7 MB)
    sha256 706dc01b21a88d3c2fbc3eeced0cab6ace873630bf3edc2d40915ca5be5c8cae
2026-08-30 15:57:01 +02:00
Local Dev
af522f812a BNS: Sia+Nostr snapshot mirror, Theseus warm-start, VPS playbook, electrum.bch
Four independent pieces of one story — make cold-start .bch resolution fast,
survive individual electrum outages, and turn adding a Silent Mode BNS server
into a checklist run.

* Argus/src/lib/snapshot-name.js — pure, interpretation-free snapshot format
  for the name beacon (raw history + verbose tx cache + deterministic root).
* Argus/src/publish-name-mirror.mjs — mirror the snapshot to Sia S3
  (floating + content-addressed) and Nostr NIP-33 (kind 30078,
  d-tag bns-name-list). Same pattern as publish-tld-mirror.mjs.
* Argus/src/snapshot-name-to-file.mjs — dump the snapshot to a file for
  bundling. Writes to TheseusNavigator/snapshots/bns-name-snapshot.json.
* Argus/src/lib/resolver-web.js — new export buildIndexFromSnapshot() runs
  the same REG/UPD reduction as buildIndex() but from a pre-fetched snapshot,
  no electrum required. Warm-start path in Theseus depends on this.
* TheseusNavigator/main.js — warmFromSnapshot() and refreshSnapshotFromSia()
  wired into app.whenReady(). First .bch navigation returns from a warm index
  instead of waiting on a full electrum walk.
* TheseusNavigator/package.json — bundles the starter snapshot as an
  extraResource so packaged builds ship with a floor.
* TheseusNavigator/snapshots/bns-name-snapshot.json — first starter snapshot
  (70 beacon txs, root 8cc859aa…).
* VPS/BNS-SERVER-PLAYBOOK.md — turn-key checklist for spinning up a second
  or third Silent Mode BNS server, distilled from what actually worked on
  the silentmode box (BCHN 29 [chip]-not-[chipnet], multi-beacon indexer,
  wss:// nginx, on-chain publish via electrum.bch, common gotchas table).
* Argus/src/register-electrum-list.mjs — publish the current chipnet
  server pool as `el` on electrum.bch. Fits inside the 200-byte OP_RETURN
  cap by sizing the record (drops fallback IP pins in favour of URL-only
  tokens until they fit). NAME was chosen deliberately: two-part `electrum.bch`
  normalises to the bare distinct name `electrum`, whereas the earlier
  candidate `electrum.silentmode.bch` collapsed to silentmode.bch and would
  have inherited/overwritten that name's records.
* Argus/src/revert-silentmode-bch.mjs — one-off recovery from the earlier
  register-electrum-list revision that hit exactly that subdomain-collapse
  bug (broadcast an UPD to silentmode.bch and clobbered its s3 record).
  Records recovered from the local snapshot cache; safe to leave in the
  tree as documentation of what happened.
2026-08-30 09:59:01 +02:00