Community寫作與編輯github.com

dyegolara/lnurl-auth-agents

LNURL-auth (LUD-04) signer for LLM coding agents — Sign in with Lightning, no wallet required

lnurl-auth-agents 是什麼?

lnurl-auth-agents is a Claude Code agent skill that lNURL-auth (LUD-04) signer for LLM coding agents — Sign in with Lightning, no wallet required.

相容平台Claude CodeCodex CLICursorOpenCode
npx skills add dyegolara/lnurl-auth-agents

Installed? Explore more 寫作與編輯 skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

lnurl-auth (LUD-04)

Authenticate to a service using LNURL-auth (Lightning "Sign in with Lightning") entirely client-side. This is auth-only: the server sends a k1 challenge, you sign the raw 32-byte k1 with a secp256k1 private key and return sig + key via a GET to the callback. No invoice, no payment, no Lightning node.

When to use

  • A site shows "Sign in with Lightning" / LNURL-auth (e.g. bitsimp.com, lightninglogin.live).
  • You are handed an lnurl1... string (from a QR code, a link, or pasted text).
  • You must NOT spend money or run a Lightning node.

Command

Run with Node (already installed). The script lives at:

<skill_dir>/lnurl_auth.js
node <skill_dir>/lnurl_auth.js --lnurl <lnurl1...> [options]
# or pass the lnurl positionally:
node <skill_dir>/lnurl_auth.js <lnurl1...>

Options

OptionDescription
--lnurl <str>The lnurl1... string (or pass it positionally)
--key <hex>Use this hex private key as the master secret
--keyfile <path>Read the master secret (hex) from a file
--keyout <path>Where to persist a generated master secret (default ~/.config/lnurl-auth/master.key)
--generateForce-generate a new master secret, overwriting any existing keyfile
--single-keyUse one global linking key for all services (no per-domain derivation)
--no-tOmit &t=<action> from the callback
--action <a>Assert/override action: register, login, link, or auth
--callback <url>Override the URL the signature is submitted to
--dry-runDecode, fetch k1, sign — but do not submit the callback
--jsonEmit machine-readable JSON
-v, --verboseVerbose logging
-q, --quietSuppress progress logs
-h, --helpShow help

Key management (default, privacy-preserving)

  • On first use a 32-byte master secret is generated and saved to ~/.config/lnurl-auth/master.key (mode 0600).
  • For each service a linking key is derived deterministically: linkingPriv = HMAC-SHA256(master, serviceDomain).
  • Same service → same key (returning user). Different services → different keys (privacy — in the spirit of LUD-05/LUD-13).
  • Use --single-key for one global linking key across all services.

Protocol flow (LUD-04)

  1. lnurl1... is bech32("lnurl", utf8(serviceURL)). Decode → URL containing k1 (32-byte hex challenge) and optionally action.
  2. Sign the raw 32-byte k1 with the linking private key using ECDSA (secp256k1, prehash: false), then DER-encode the signature.
  3. GET the service URL with &sig=<hex DER sig>&key=<hex compressed pubkey> (and &t=<action> when known) appended.
  4. Server verifies the signature and responds {"status":"OK"} or {"status":"ERROR","reason":"..."}.

Reference: https://github.com/lnurl/luds/blob/luds/04.md

Output

  • Progress messages go to stderr.
  • Server response (JSON) goes to stdout.
  • {"status":"OK"} → exit code 0.
  • {"status":"ERROR",...} → exit code 3.
  • Non-JSON or non-200 response → exit code 4.

Examples

Basic login

node <skill_dir>/lnurl_auth.js --lnurl "lnurl1dp68gurn8ghj7..."

Dry-run first (inspect without submitting)

node <skill_dir>/lnurl_auth.js "lnurl1..." --dry-run --json

Use a specific key

node <skill_dir>/lnurl_auth.js "lnurl1..." --key <64-char-hex-private-key>

Force new identity

node <skill_dir>/lnurl_auth.js "lnurl1..." --generate

Dependencies

  • Node.js v18+ (v22 recommended).
  • Two tiny pure-JS npm packages, vendored inside node_modules/:
    • @noble/secp256k1 (sign/verify, audited, zero-dependency)
    • bech32 (lnurl decode/encode)
  • No native build, no network at runtime (except the callback GET).
  • No cost, no Lightning node.

Installing / refreshing vendored deps

cd <skill_dir>
npm install

Self-test (no external services, no cost)

A local mock LUD-04 server validates the full sign → submit → verify roundtrip:

cd <skill_dir>
node selftest.js

Covers: happy path, replay rejecton, dry-run safety, tampered k1 rejection, per-domain key stability, --generate overwrite, and odd-hex validation.

Real-world verification

Verified against two public services:

ServiceResponse
bitsimp.com{"status":"OK"}
lightninglogin.live{"status":"OK"}

Limitations

  • This performs the cryptographic handshake; account creation/login depends on the remote service recognising the key.
  • The default linking key is per-domain derived from a local master secret — it is not the same identity a user's phone wallet would produce. Sufficient for agent auth.
  • Requires network egress to the service's callback URL at submit time only (no payment, no Lightning node).

相關技能

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community