Argus � the BNS public gateway (navigate.st) and its library layer. Serves BCNR names over HTTPS, verifies signed records, mints TLDs.
Find a file
Local Dev 1ec4fdde7d feat(gateway): security hardening — headers, relay banner, subdomain fix
Option (a) from the security review: /bns/ path form stays live but
now carries a visible warning banner + a one-click upgrade to the
subdomain form where each BCDN name gets its own browser origin.
Security headers go on every relayed HTML response regardless of form.

New headers on every relayed HTML (both /bns/ and *.bch.navigate.st):
  content-security-policy: permissive on scripts/styles (real BCDN
    sites use inline), but frame-ancestors 'none', object-src 'none',
    base-uri 'self', form-action 'self' https: — closes clickjacking,
    <object>/<embed> smuggling, <base> poisoning, cross-origin form
    submits in one block.
  permissions-policy: camera, mic, geolocation, payment, usb,
    bluetooth, accelerometer, gyroscope, magnetometer, autoplay,
    interest-cohort, browsing-topics all denied by default. A
    malicious BCDN page can no longer ask the user for sensitive APIs
    with navigate.st-flavoured prompts.
  referrer-policy: no-referrer
  x-content-type-options: nosniff
  x-frame-options: SAMEORIGIN (belt-and-suspenders alongside CSP)

Relay banner (PATH FORM only):
  Fixed top strip reading "⚠ Relayed site · <name> is being served
  through navigate.st · Scripts here run under the gateway's origin —
  do not sign in or paste a recovery phrase". Offers an "Isolated
  view ↗" button to the subdomain form and a secondary "Install
  Theseus" link. All inline, no external deps, `all:initial` on every
  node so the host page's CSS cannot style it. Dismissible for 24h via
  localStorage. Body padding adjusts on load+resize so the banner
  doesn't overlap content.

Subdomain-form decoder fix:
  Old handler hard-appended ".bch" on reverse — only worked for
  2-level .bch names. sirius-x.bch.navigate.st decoded to the
  phantom "sirius.x.bch". New scheme is lossless for every BCDN name:
    hello-bch                -> hello.bch
    sirius-x                 -> sirius.x
    coinspectrum-deviant-bch -> coinspectrum.deviant.bch
    hello--world-bch         -> hello-world.bch (dashes in label survive)
  Legacy short form "hello.bch.navigate.st" still resolves — a
  dot-less single label is treated as an implicit ".bch" name for
  back-compat.
2026-10-06 01:25:48 +02:00
contracts covenants: close the holes an adversarial review found 2026-10-04 16:53:56 +02:00
setup Ariadne: keep the resolver running on battery 2026-10-03 13:08:13 +02:00
src feat(gateway): security hardening — headers, relay banner, subdomain fix 2026-10-06 01:25:48 +02:00
test covenant names: the actions a dashboard needs, and holdings that list them 2026-10-05 23:51:02 +02:00
.gitignore Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
ariadne.config.json BNS: per-TLD on-chain registry, multi-beacon indexer, enforcement gate 2026-08-29 17:11:02 +02:00
BROWSER-PROMPT.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
build-web.mjs Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
DESIGN-collision-modes.md Resolver 3438d558: ASCII-clean install.ps1 + multi-TLD NRPT + VPS-first electrum 2026-07-31 23:09:23 +02:00
DESIGN-hosting-pact.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
DESIGN-root-tld-cert.md Collision modes (BCNR/ICANN) + root TLD cert + VPS electrum-source indexer 2026-08-02 11:39:00 +02:00
ENGINE.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
LICENSE Licenses: MPL-2.0 for Theseus, Ariadne and Hephaestus; Apache-2.0 for Argus; CC BY 4.0 for the documents 2026-09-29 00:18:00 +02:00
namespaces.pdf Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
OPERATIONS-electrum.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
package-lock.json BNS: per-TLD on-chain registry, multi-beacon indexer, enforcement gate 2026-08-29 17:11:02 +02:00
package.json Licenses: MPL-2.0 for Theseus, Ariadne and Hephaestus; Apache-2.0 for Argus; CC BY 4.0 for the documents 2026-09-29 00:18:00 +02:00
PROTOCOL.md docs: commit-reveal as built, and its chipnet run; site bundle rebuilt 2026-10-05 22:56:56 +02:00
README.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
ROADMAP.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
sia-test.html Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00

BNS — Namecoin-style decentralized names on Bitcoin Cash (chipnet)

A working prototype of "Option 3": names are CashTokens name certificates on the BCH chain (no fork, no sidechain), records ride in OP_RETURN, discovery via a beacon address, and the resolver is embedded in a wallet app with a built-in browser pane — the Brave/MetaMask-browser architecture in miniature.

See PROTOCOL.md for the on-chain design and its honest limitations.

Layout

  • src/lib/bns.js — protocol core: payload codec, chain indexer/resolver, tx builders
  • src/wallet-app.js — wallet + embedded resolver + browser UI (npm run wallet → http://localhost:4626)
  • src/register.js / src/update.js / src/resolve.js — CLI equivalents
  • wallets.json — chipnet seed phrases (TESTNET ONLY — never reuse for real funds)
  • src/lib/gen-wallets.js — one-time wallet generation (already run)

Setup

  1. npm install
  2. Fund the wallet with free chipnet tBCH: go to https://tbch.googol.cash/, paste the wallet address (shown in the app sidebar or by node src/lib/gen-wallets.js), pick chipnet, solve the captcha. ~0.001 tBCH funds hundreds of registrations.
  3. npm run wallet and open http://localhost:4626

Standalone resolver daemon (make EVERY browser resolve .bch)

  • src/daemon/bnsd.js — DNS server (answers *.bch from the chain, forwards everything else upstream) + HTTP gateway that serves on-chain sites by Host header. Test unprivileged: node src/daemon/bnsd.js --dns-port 5354 --http-port 8081, then node src/daemon/dig.js hello.bch.
  • setup/install.ps1 — run from an elevated PowerShell. Installs the daemon as a boot-time scheduled task (SYSTEM, auto-restart) and wires the OS to it:
    • default (-Mode nrpt): adds an NRPT rule so only .bch queries reach the daemon; all other DNS is untouched.
    • -Mode full: points every adapter's DNS at 127.0.0.1 (daemon forwards non-.bch upstream, ncdns-style); original servers are saved and restored on uninstall.
  • setup/uninstall.ps1 — reverses everything (rule/adapters/task).

HTTPS for .bch: the "BNS Local Root CA" (created on demand in ca/, keep root-ca.key private) signs per-name certs. The daemon's :443 gateway mints them on the fly for locally-served names; node src/lib/issue-cert.js <name> issues one for a real server (see the coinspectrum.bch nginx vhost). The installer trusts the root machine-wide and enables Firefox's enterprise-roots policy; cert fingerprints are published in "tls" chain records for pinning.

Caveats: browsers with "secure DNS" (DoH) enabled bypass the OS resolver — disable it or add an exception; ports 53/80/443 must be free.

Try it

  • Register hello with inline HTML (a website stored entirely on-chain), then type hello.bch in the address bar — the app resolves it from the blockchain (not DNS) and renders it.
  • Or CLI: node src/register.js hello '{"h":"<h1>Served from the BCH chain</h1>"}' then node src/resolve.js hello