Authenticate to LNURL-auth (LUD-04) services without a wallet, node, or payment. Use when a site provides an lnurl1... challenge for Sign in with Lightning.
浏览器
nostr-auth
试用Authenticate to Nostr sign-in challenges (NIP-07 style) without a wallet or browser extension. Signs kind-22242 AUTH challenge events with a secp256k1 (BIP-340) key derived from a local master secret and optionally submits them to the service callback. Use when a site or API asks for a signed Nostr event to prove key ownership. More methods coming: NIP-98 HTTP Auth, NIP-42 relay AUTH, NIP-05.
它能做什么
Authenticate to Nostr sign-in challenges (NIP-07 style) without a wallet or browser extension. Signs kind-22242 AUTH challenge events with a secp256k1 (BIP-340) key derived from a local master secret and optionally submits them to the service callback. Use when a site or API asks for a signed Nostr event to prove key ownership. More methods coming: NIP-98 HTTP Auth, NIP-42 relay AUTH, NIP-05.
技能文档
Nostr sign-in (NIP-07)
Use this skill for authentication only — signing sign-in events that prove ownership of a Nostr identity. It never publishes notes, connects to relays beyond the configured callback, or requires a wallet or browser extension.
Inputs
- A sign-in challenge from a "Sign in with Nostr" page or API — either an
event template (
kind,tags,content) or a challenge string. - Optional
--domainfor the service host (used for deterministic key derivation),--callbackURL to submit the signed event to. - Optional
--dry-runwhen the signed event must be inspected before submission.
Do not invent or alter challenges. Ask for a fresh challenge when the service reports it was already used.
Run
The bundled helper uses only Node.js built-ins and lives at:
/scripts/nostr_auth.js
Inspect the identity and signature without authenticating:
node /scripts/nostr_auth.js pubkey --domain example.com
node /scripts/nostr_auth.js --challenge "" --relay "wss://..." --dry-run --json
After confirming the service and callback are expected, submit:
node /scripts/nostr_auth.js --challenge "" --relay "wss://..." --callback "https://example.com/verify" --json
Or sign a full event template:
node /scripts/nostr_auth.js sign '{"kind":22242,"tags":[["challenge",""]],"content":""}' --domain example.com --callback https://example.com/verify --json
The helper requires Node.js 20.19 or newer. The only network request is the final callback POST.
Protocol
- Derive a per-service secp256k1 private key:
HMAC-SHA256(master, domain), from the persisted master secret (~/.config/nostr-auth/master.key, mode0600). - Build the event (kind 22242 for challenges by default), compute the NIP-01
id
sha256(JSON.stringify([0, pubkey, created_at, kind, tags, content])). - Sign the raw 32-byte id with BIP-340 schnorr; store the 64-byte signature
as hex in
event.sig. - POST
{"event": }to the callback. Interpret{"status":"OK"}as accepted; a fresh challenge is needed after{"status":"ERROR"}.
Identity and safety
- Keep the master secret local (
0600); expose the nsec to nobody. - Per-domain derivation keeps unrelated services from correlating identity.
- Inspect the callback URL and signed event in
--dry-runbefore submitting. - The
npubderived here is an agent identity — it is not the same key as a user's browser extension unless the master secret comes from it.
Failure handling
Invalid hex/odd length— malformed key or challenge input.Callback returned non-JSON or HTTP— the service is down or the URL is wrong; verify--callback.{"status":"ERROR"}— challenge may already be used; request a fresh one.
Self-test (offline, cost-free)
cd
npm test
The local mock service validates the full sign → submit → verify roundtrip.
相关技能
Use when the user wants a local-first TOTP helper for accounts they personally own or are explicitly authorized to access. This skill stores TOTP seeds in sy...
Expose a local @moneydevkit/agent-wallet as a Nostr Wallet Connect (NIP-47) wallet-service (systemd user service).
Connect safeTok Nostr DMs to your OpenClaw agent. Use OpenClaw with Claude OAuth — no Anthropic API key needed. Communicate via safeTok NIP-44 encrypted DMs...
Use when adding, fixing, or improving authentication in any app — login, logout, signup, route protection, JWT/access token validation, refresh token rotatio...
Verify and cross-sign the active Matrix device for one OpenClaw-managed account. Use when a user needs to repair trust for an OpenClaw Matrix device, confirm...