Server-side mirror hook on bns-gateway landed, so the "primary vs mirror"
split from the previous commit collapses: the primary URL is now itself
Sia-backed via the BNS gateway. One URL in the OP_RETURN, zero HTTPS
single-point-of-failure, every genesis's metadata survives a silentmode.st
outage because any bns-gateway (Theseus, Ariadne, self-hosted) resolves
the same bytes from Sia and the on-chain SHA-256 confirms integrity.
Server (deployed to silentmode:/opt/bns-gateway/public-gateway.mjs,
service restarted + active):
- NEW /api/bcmr-upload/<network>/<categoryId>.json handler modelled on
the existing /api/icon-upload sibling. POST only, 32 KB cap, strict
path validation (chipnet|mainnet + 64 lowercase hex), parse-and-
discard JSON validity check, PUT to Sia at
bns/deviant.x/bcmr/<network>/<categoryId>.json.
- Returns { url, sha256, bytes, path }. No auth: on-chain sha256 is the
trust root, so a wrong-hash upload is simply ignored by every reader.
- Backup written: public-gateway.mjs.bak-bcmr-<timestamp>.
End-to-end verified (browser → gateway → Sia → gateway → browser):
- POST 200, Sia PUT success, response carries the public URL
- GET from the public URL returns 200, 483 bytes
- Client SHA-256 == response.sha256 == fetched-bytes SHA-256
- Negative paths: wrong network/short/upper-case categoryId → 400,
GET → 405, invalid JSON → 400 with parser detail
Client (design/potidaea/src/bcmr.ts + genesis.ts):
- bcmrPublicUrl now returns
https://navigate.st/bns/deviant.x/bcmr/<network>/<categoryId>.json —
the Sia-backed primary. Replaces the never-working silentmode.st/bcmr
URL that was 404'ing in production.
- bcmrSiaUrl kept as an alias of bcmrPublicUrl so step 2's earlier
opt-in callers still compile.
- Genesis emitter: dropped the VITE_BCMR_SIA_MIRROR flag — the primary
is Sia-backed now, no gating needed. Encoder stays variadic so future
mirrors (IPFS pin, alternate gateway) can be added without API churn.
ADR-0057 updated: step 2 marked SHIPPED with the gateway + Sia +
end-to-end verification notes.
Potidaea tsc clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>