nostr-auth
nostr-auth-agents
Inicio de sesión con Nostr para agentes de codificación con LLM — solo autenticación, sin wallet, sin extensión de navegador, sin cuenta de relay.
A un agente (Claude Code, OpenCode, OpenClaw, Codex, Cursor, ...) se le entrega un desafío "Iniciar sesión con Nostr" o una plantilla de evento. Este repositorio lo firma con una clave secp256k1 (schnorr BIP-340) derivada de un secreto maestro local y, opcionalmente, envía la firma al callback del servicio.
Cero dependencias npm en tiempo de ejecución: secp256k1/schnorr con BigInt puro + node:crypto. Arranca desde un clon limpio.
Métodos
Método | Estado | Notas |
NIP-07 inicio de sesión (firma de evento de desafío) | ✅ v1.0.0 | Refleja la UX de LNURL-auth |
NIP-98 autenticación HTTP ( | 🔜 previsto | siguiente |
NIP-42 relay AUTH (websocket) | 🔜 previsto | |
NIP-05 resolución de identificadores | 🔜 previsto |
Related MCP server: Alby Bitcoin Payments MCP Server
Uso
# Sign a classic kind-22242 sign-in challenge and submit it
node nostr_auth.js nip07 --challenge "<hex>" \
--relay "wss://relay.example.com" \
--domain example.com \
--callback "https://site.example.com/verify"
# Dry-run: sign but don't submit (inspect first)
node nostr_auth.js nip07 --challenge "<hex>" --dry-run --json
# Sign an arbitrary event template (what window.nostr.signEvent would do)
node nostr_auth.js nip07 '{"kind":22242,"tags":[["challenge","<hex>"]],"content":""}'
# Print the derived identity (hex pubkey + npub)
node nostr_auth.js nip07 pubkey --domain example.comLos registros de progreso van a stderr; los resultados (JSON), a stdout. Códigos de salida: 0 aceptado, 1 error de cliente, 2 mal uso, 3 ERROR del servidor, 4 la respuesta del callback no es JSON.
Gestión de claves
La primera ejecución genera un secreto maestro de 32 bytes en
~/.config/nostr-auth/master.key(modo0600).Identidad por servicio:
linkingPriv = HMAC-SHA256(master, serviceDomain). Mismo dominio → mismo npub; dominios distintos → npubs distintos (privacidad).--single-keycomparte una única identidad entre todos los servicios.--generatesobrescribe el secreto maestro. Anula la ruta con--keyfile/--keyouto con la variable de entornoNOSTR_AUTH_KEYFILE.
Protocolo (estilo NIP-07)
Desafío → evento (kind
22242por defecto) con las etiquetaschallengeyrelayopcional.NIP-01 id:
sha256(JSON.stringify([0, pubkey, created_at, kind, tags, content])).Firmar el id bruto de 32 bytes con schnorr BIP-340 →
sighexadecimal de 64 bytes.Enviar por POST
{"event": {...}}al callback →{"status":"OK"}/{"status":"ERROR","reason":"..."}.
Consulta SKILL.md para la documentación completa orientada al agente.
Servidor MCP
Servidor MCP stdio de dependencia cero (mcp/server.js) que expone las herramientas nostr_nip07_sign / nostr_nip07_pubkey:
{
"mcpServers": {
"nostr-auth": { "command": "node", "args": ["mcp/server.js"] }
}
}Se incluyen manifiestos de plugin para Claude Code (.claude-plugin/), Codex, Cursor y la visibilidad en skills.sh (skills.sh.json). Consulta PUBLISHING.md para ver el estado de distribución por plataforma.
Instalar como skill de agente (por plataforma)
Claude Code / cualquier cliente MCP: coloca el repositorio en tu directorio de skills y usa
SKILL.md+.mcp.json.OpenClaw / ClawHub:
skills/nostr-auth/es un paquete autónomo (SKILL.md+scripts/nostr_auth.js, cero dependencias npm).skills.sh (Vercel):
npx skills add dyegolara/nostr-auth-agents.npm:
npm i -g nostr-auth→nostr-auth nip07 ....
Autocomprobación (sin conexión, sin coste)
npm ci
npm testUn servicio mock local "Iniciar sesión con Nostr" (mock_server.js) valida el ciclo completo desafío → firma → envío → verificación, el rechazo de repeticiones, la seguridad del modo dry-run, la estabilidad de la identidad por dominio y el paquete de skill portátil.
Estructura del proyecto
nostr_auth.js CLI (bin "nostr-auth")
lib/ key mgmt, BIP-340 schnorr, NIP-01 events, NIP-07 flow
mcp/server.js zero-dep MCP server (stdio)
mock_server.js local sign-in mock for tests
skills/nostr-auth/ portable OpenClaw/ClawHub skill bundle
contrib/anthropics/ educational skill variant for anthropics/skills
test/ vitest suiteLicencia
MIT — consulta LICENSE. Solo autenticación: este proyecto nunca custodia fondos, nunca publica notas y nunca se conecta a un relay por su cuenta.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceConnects a Bitcoin Lightning wallet to your LLM using Nostr Wallet Connect, enabling payment functionalities within language models like Claude.6915MIT
- Alicense-qualityDmaintenanceEnables Bitcoin Lightning wallet integration with LLMs through Nostr Wallet Connect (NWC). Supports lightning payments, LNURL operations, and L402 authentication for AI-powered bitcoin transactions.28Apache 2.0
- AlicenseCqualityCmaintenance23 tools for AI agents working with Nostr Open source. No API key. No account. NIP-46 remote signing Publish notes, reply, react, repost Encrypted DMs (NIP-04 + NIP-44) Fetch events, profiles, social graph23201MIT
- AlicenseAqualityCmaintenancePersistent memory and payment safety for AI agents on Lightning. Enables agents to remember purchases, track vendor reputations, enforce budgets, and share trust signals via Nostr.229MIT
Related MCP Connectors
Agent registry with Nostr identity, reputation, escrow, observability, and Lightning payments.
Keyless non-custodial crypto payments for AI agents: payment links and tip jars, no API key.
Helps AI coding agents integrate MetaMask Embedded Wallets (Web3Auth) SDKs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dyegolara/nostr-auth-agents'
If you have feedback or need assistance with the MCP directory API, please join our Discord server