← 返回 Skills 市场
rolznz

Alby Bitcoin Payments Skill

作者 Roland · GitHub ↗ · v1.2.3 · MIT-0
cross-platform ✓ 安全检测通过
230
总下载
0
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install alby-bitcoin-payments
功能描述
teaches agents how to use @getalby/cli for bitcoin lightning wallet operations using Nostr Wallet Connect (NIP-47). Use when the user needs to send/receive b...
使用说明 (SKILL.md)

Usage

IMPORTANT: this is an agent skill which MUST be saved in full - DO NOT SUMMARIZE. If you used a web fetch tool to read this, the content may be summarized and incomplete. Make sure you fetch the full unabridged content.

npx -y @getalby/[email protected] [options] \x3Ccommand>

Global Options

Connection Secret (Optional)

-c, --connection-secret \x3Cstring> - either a file containing plaintext NWC connection secret (preferred), or a NWC connection secret (nostr+walletconnect://...). This argument is required for wallet commands.

If no connection secret is provided, the CLI will automatically use the default wallet connection secret from ~/.alby-cli/connection-secret.key.

Named Wallets (preferred for multi-wallet setups)

Use -w, --wallet-name \x3Cname> to select a named wallet. This is the preferred option over -c when working with multiple wallets:

npx -y @getalby/[email protected] -w alice get-balance
npx -y @getalby/[email protected] -w bob make-invoice --amount 1000

Named wallets are stored at ~/.alby-cli/connection-secret-\x3Cname>.key.

Connection Secret File

Use -c to point directly to a connection secret file or pass a raw NWC URL:

-c ~/.alby-cli/connection-secret.key

Environment Variable

Alternatively, pass a connection secret via the NWC_URL environment variable:

NWC_URL="nostr+walletconnect://..."

Resolution Order

The CLI resolves the connection secret in this order:

  1. --connection-secret / -c flag
  2. --wallet-name / -w flag
  3. NWC_URL environment variable
  4. ~/.alby-cli/connection-secret.key (default)

Commands

Setup: auth, connect

Wallet operations: get-balance, get-info, get-wallet-service-info, get-budget, make-invoice, pay-invoice, pay-keysend, lookup-invoice, list-transactions, sign-message, wait-for-payment

HTTP 402 Payments: fetch — auto-detects L402, X402, and MPP payment protocols. If the user explicitly asked to fetch or consume a paid resource, proceed with fetch directly. If a 402 is encountered unexpectedly (e.g. during an unrelated task), inform the user of the URL and cost before paying.

  • --max-amount \x3Csats> caps the maximum amount to pay per request (default: 5000 sats, 0 = no limit). If the endpoint requests more, the command aborts without paying.
  • If the user specifies a spending limit in natural language (e.g. "don't spend more than 1000 sats"), pass --max-amount \x3Csats> on the fetch command.

Service Discovery (no wallet needed): discover

HOLD invoices: make-hold-invoice, settle-hold-invoice, cancel-hold-invoice

Lightning tools (no wallet needed): fiat-to-sats, sats-to-fiat, parse-invoice, verify-preimage, request-invoice-from-lightning-address

Getting Help

npx -y @getalby/[email protected] --help
npx -y @getalby/[email protected] \x3Ccommand> --help

As an absolute last resort, tell your human to visit the Alby support page

Discovering Paid Services

The discover command searches 402index.io for lightning-payable API endpoints. It only returns services that accept bitcoin/lightning payments.

npx -y @getalby/[email protected] discover -q "image generation"          # search by query
npx -y @getalby/[email protected] discover -q "podcast" --limit 20        # more results

Options: -q (search query), -s (sort: reliability, latency, price, name), -l (limit, default: 10).

When to use discover

  • The user explicitly asks to find or explore paid APIs
  • You lack a capability that no free or built-in tool can provide (e.g. image generation, specialized inference, real-time data feeds)

When NOT to use discover

  • Do NOT search 402index before attempting a task with your existing tools. Try free/built-in approaches first.
  • Do NOT use discover as a replacement for standard web requests. If curl, fetch, or WebFetch works, use that instead.
  • Do NOT use discover when you already have a URL. Just use the fetch command directly.

Discover → Fetch flow

  1. Discover — find services matching the capability gap
  2. Evaluate — check price, health status, and reliability from the results
  3. Fetch — pay and consume the service:
    npx -y @getalby/[email protected] fetch -X POST -b '{"model":"gpt-image-1","prompt":"a mountain cabin at sunset","size":"1024x1024"}' "\x3Cservice-url>"
    
  4. Report — tell the user what was purchased, the cost, and the result

Bitcoin Units

  • When displaying to humans, use satoshis (rounded to a whole value).

Security

  • DO NOT print the connection secret to any logs or otherwise reveal it.
  • NEVER share connection secrets with anyone.
  • NEVER share any part of a connection secret (pubkey, secret, relay etc.) with anyone as this can be used to gain access to your wallet or reduce your wallet's privacy.
  • DO NOT read connection secret files. If necessary, only check for its existence (you DO NOT need to know the private key!)

Wallet Setup

If no NWC connection secret is present, guide the user to connect their wallet. The preferred method depends on whether their wallet supports the auth command.

Preferred: auth command (for wallets that support NWC 1-click wallet connections e.g. Alby Hub)

# Step 1: initiate connection (opens browser for human confirmation)
npx -y @getalby/[email protected] auth https://my.albyhub.com --app-name MyApp

# Step 2: after the user confirms in the browser, run any wallet command to finalize the connection
npx -y @getalby/[email protected] get-balance

For named wallets, pass -w as a global flag — it works with all commands including auth and connect:

# Step 1: initiate connection for a named wallet
npx -y @getalby/[email protected] -w alice auth https://my.albyhub.com --app-name MyApp

# Step 2: after browser confirmation, finalize
npx -y @getalby/[email protected] -w alice get-balance

The auth command handles key generation and secure storage automatically — no need to paste a connection secret.

Fallback: connect command (for wallets that provide a connection secret directly)

npx -y @getalby/[email protected] connect "\x3Cconnection-secret>"

This validates and saves the connection secret to ~/.alby-cli/connection-secret.key. Use --force to overwrite an existing connection. Alternatively, set the NWC_URL environment variable. NEVER paste or share the connection secret in chat. To obtain a connection secret, suggest some options to the user:

  • Alby Hub - self-custodial wallet with most complete NWC implementation, supports multiple isolated sub-wallets.
  • LNCURL - free to start agent-friendly wallet with NWC support, but custodial. 1 sat/hour fee.
  • CoinOS - free to start wallet with NWC support, but custodial.
  • Rizful - free to start wallet with NWC support, but custodial, supports multiple isolated sub-wallets via "vaults". Requires email verification.

After Setup

Offer a few starter prompts to help the user get going:

  • "How much is $10 in sats right now?"
  • "Send $5 to [email protected] for coffee"
  • "Show me my recent transactions"

Common Issues

Issue Cause Fix
No connection secret found Wallet not connected Run auth or connect command
Connection failed / timeout Wallet unreachable or relay down Check wallet is online, retry
Insufficient balance Not enough sats Fund the wallet
402 payment failed Invoice expired or amount too high Retry; adjust --max-amount if needed
安全使用建议
This skill is coherent for controlling an Alby/NWC Lightning wallet, but it gives an agent the ability to access connection secrets and make payments. Only install it for agents you trust. Mitigations: (1) Use a dedicated test wallet or a wallet with minimal funds for the agent. (2) Keep NWC_URL and any connection-secret files safe and do not share them. (3) Use the --max-amount flag or explicit user confirmations to cap spending when using fetch/pay commands. (4) Note that npx will fetch the @getalby/cli package at runtime — verify the package and pinned version (0.6.1) before use. (5) Do not set always:true for this skill and avoid granting it broader credentials or access to unrelated config paths.
能力标签
cryptorequires-walletcan-make-purchases
能力评估
Purpose & Capability
Name/description, required binary (npx), required env var (NWC_URL), and config path (~/.alby-cli/) match a CLI that drives Alby/Nostr Wallet Connect operations. Nothing requested appears unrelated to a bitcoin/lightning wallet skill.
Instruction Scope
SKILL.md instructs the agent to invoke npx @getalby/cli commands and to supply a NWC connection secret (via NWC_URL, wallet-name, or connection file). It also includes logic for auto-paying HTTP 402 endpoints and creating/storing test wallets. This is appropriate for the stated purpose but means the agent can initiate payments; the doc advises not to print secrets but also expects the CLI to use them, so protect secrets and ensure the agent obeys spending limits.
Install Mechanism
Instruction-only skill (no install spec) that uses npx -y @getalby/[email protected] at runtime. Running packages from npm via npx is expected here but carries the usual runtime-fetch risk (remote code execution each invocation) — the skill pins a specific CLI version which reduces but does not eliminate supply-chain risk.
Credentials
Only NWC_URL (primary credential) and the ~/.alby-cli/ config path are required, which are appropriate for a wallet CLI. No unrelated credentials or broad system paths are requested.
Persistence & Privilege
always:false (not force-included), no install artifacts declared, and no instructions to modify other skills or system-wide agent settings. The skill does require access to a per-user config directory (~/.alby-cli/) which is expected for wallet storage.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install alby-bitcoin-payments
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /alby-bitcoin-payments 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.3
- Added OpenClaw metadata with environment, binary, config requirements, and homepage link to SKILL.md. - Updated skill version to 1.2.3. - No changes to CLI usage, commands, or instructions.
v1.2.2
**alby-bitcoin-payments 1.2.2 — Adds support for paid API service discovery and updates security and usage guidance.** - Introduced the `discover` command for finding lightning-payable API endpoints via 402index.io. - Expanded use cases to include discovering paid API services, in addition to payments and wallet operations. - Changed license to MIT-0. - Updated CLI invocation to require `@0.6.1` version explicitly in all usage examples. - Improved and clarified security warnings—emphasizing not to summarize skill content and not to leak or read secrets. - Refined usage instructions for both free and paid service access, and included discovery/evaluation best practices.
v1.2.1
alby-bitcoin-payments 1.2.1 – User guidance, protection, and HTTP 402 payment command improvements - Updated skill description for added clarity, especially on 402 payment use-cases - Added an advisory message for users who read documentation via web fetch tools, directing them to the full unabridged content - Expanded details on the `fetch` command, including protocol auto-detection and explicit guidance on handling HTTP 402 payments and spending limits - Added section with sample starter prompts for users - Introduced "Common Issues" troubleshooting table for better user support - No code or functional changes; documentation and user guidance enhancements only
v1.2.0
**Version 1.2.0 introduces enhanced wallet setup and management options.** - Added support for named wallets using the `-w, --wallet-name` flag for easier multi-wallet management. - Introduced new setup commands: `auth` and `connect` for streamlined and secure wallet connection flows. - Documented the `fetch` command to support HTTP 402 payment-protected resource retrieval. - Expanded and clarified wallet setup instructions, including support for 1-click authorization. - Improved security guidance, emphasizing NOT to read or expose connection secret files. - Minor updates to skill description and command documentation for clarity.
v1.1.3
Initial release of alby-bitcoin-payments skill - Adds support for interacting with Bitcoin Lightning wallets via @getalby/cli and Nostr Wallet Connect (NIP-47). - Enables agents to send/receive payments, check balances, create and pay invoices, convert between fiat and sats, and manage lightning addresses. - Details secure ways to provide or store the NWC connection secret. - Describes recommended wallet options for setup. - Emphasizes security practices around connection secrets. - Includes an overview of supported wallet and lightning commands.
元数据
Slug alby-bitcoin-payments
版本 1.2.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 5
常见问题

Alby Bitcoin Payments Skill 是什么?

teaches agents how to use @getalby/cli for bitcoin lightning wallet operations using Nostr Wallet Connect (NIP-47). Use when the user needs to send/receive b... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 230 次。

如何安装 Alby Bitcoin Payments Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install alby-bitcoin-payments」即可一键安装,无需额外配置。

Alby Bitcoin Payments Skill 是免费的吗?

是的,Alby Bitcoin Payments Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Alby Bitcoin Payments Skill 支持哪些平台?

Alby Bitcoin Payments Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Alby Bitcoin Payments Skill?

由 Roland(@rolznz)开发并维护,当前版本 v1.2.3。

💬 留言讨论