argus/README.md
Local Dev a45320db7d Initial commit — Silent Mode baseline (2026-07-29)
Snapshot of the decentralized-web stack at the point of the resolver+Theseus
rebuild deploy. Includes:

- Argus (BNS engine + resolver daemon + Sia gateway)
- AriadneResolver (Windows Inno installer bundle + Android APK sources +
  Firefox extension)
- TheseusNavigator (Electron browser)
- site/ (silentmode.st content, deployed to Sia at bns/silentmode/)
- design docs, roadmap, protocol spec

Secrets excluded via .gitignore: Argus/sia-s3.json, Argus/wallets.json,
Argus/ca/*.key,*.crt. Build outputs, node_modules, and bundled runtimes
also excluded.

Shipped hashes on dl.silentmode.st at this commit:
  AriadneResolver-Setup-0.1.0.exe    5bcb216eef31ea28ed767e4134ab74bd5ac69dfbd365fd249e9e6938e55c986a
  TheseusNavigator-Setup-0.0.1.exe   7c735e88bad2da3347145adba3016c8f626a18b8422289c8c6ba471972e2952b
  TheseusNavigator-0.0.1-portable.exe 008fd84445babeabb401b2bca40ea9466b24b0e6d6c85104da7640c5c5c84521
  ariadne-v0.2.apk                   635c8f04d44ef855a8390b9eeddb8cd2d50622e81cc4e5004e8daffc1bb0425c
2026-07-29 13:54:34 +02:00

59 lines
3 KiB
Markdown

# 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](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`