Publish a Nostr kind:1 note to the standard public relay set plus
wss://relay.testls.bit/ — a Namecoin-gated relay that requires:
- A Namecoin-verified
.bitNIP-05 (_@<name>.bit) on the author pubkey. - A custom TLS handshake pinned against the
tlsarray stored on-chain underd/<base>/map/<sub>(DANE-TA / SPKI / SHA-256).
The relay's TLS scheme is unusual: the TLSA pin matches the AIA Parent CA
SPKI, which the cert chain staples as a JSON {"pubb64":"..."} blob inside
the issuer's serialNumber RDN. The script unescapes that, base64-decodes it,
hashes it, and compares to the on-chain TLSA. If the pin matches, the
validated TLS socket is handed to the WebSocket client (no second handshake).
See prereqrelaytestlsbit.txt (or your local
copy) for the full prerequisites.
npm install ws nostr-tools
cp config.example.js config.js
# edit config.js with your real Nostr key + Namecoin RPC credsYou also need:
- A running local Namecoin Core node with RPC enabled (default
127.0.0.1:8336). - A
lib.jsmodule exposingpublishToRelays(event, relays, timeoutMs)andprintRelayResults(results, label)(the script's only non-stdlib runtime dependency besidesws/nostr-tools). - An
announce.txtfile in the parent directory containing the note body. - The
id/<bitName>Namecoin record published withnostr.pubkeymatching your hex pubkey, andd/<bitName>mirroring it.
node publish-announce-bit.jsThe script will:
- Resolve
relay.testls.bitvia Namecoin (name_show d/testls→map.relay). - Open a TCP/TLS socket to that IP with SNI=
relay.testls.bit. - Validate the TLSA pin against the chain's stapled AIA Parent CA SPKI.
- Publish
kind:0(profile w/.bitNIP-05),kind:10002(relay list incl..bit), and thekind:1announce, in that order, to public relays plus the pinned.bitrelay. - Print an
njump.meURL for the resulting event.
Exit code: 0 if any relay accepted the announce, 2 otherwise.
Nothing in this repo holds secrets. config.js is gitignored — keep it that
way. The Nostr private key, Namecoin RPC password, and any wallet backups
must never leave the machine.
MIT