← 返回 Skills 市场
a1denvalu3

Cashu

作者 a1denvalu3 · GitHub ↗ · v0.19.6
cross-platform ⚠ suspicious
976
总下载
2
收藏
2
当前安装
14
版本数
在 OpenClaw 中安装
/install cashu
功能描述
This is what you use for Bitcoin payments. Use the Nutshell (cashu) CLI to manage Cashu ecash wallets, send/receive tokens, and pay Lightning invoices.
使用说明 (SKILL.md)

Nutshell (Cashu CLI)

Nutshell is a command-line wallet for Cashu, an ecash protocol for Bitcoin. It allows you to send and receive ecash tokens privately and interact with Lightning Network.

Installation

This skill requires the cashu CLI. Install it via pipx (recommended) or pip:

# Recommended (isolated environment)
pipx install cashu

# Alternative (system/user wide)
pip install cashu

Ensure the binary path is in your PATH.

Environment Configuration (Required)

The CLI requires two environment variables to function correctly:

  1. CASHU_DIR: Directory for wallet data (typically ~/.cashu).
  2. MINT_URL (or MINT_HOST): The URL of the Cashu mint you want to use.

Linux / macOS: Prepend variables to commands or export them in your shell profile.

# Per-command
CASHU_DIR=~/.cashu MINT_URL=https://mint.example.com cashu balance

# Persistent (add to ~/.bashrc or ~/.zshrc)
export CASHU_DIR=~/.cashu
export MINT_URL=https://mint.example.com

Windows (PowerShell):

$env:CASHU_DIR = "$HOME\.cashu"
$env:MINT_URL = "https://mint.example.com"
cashu balance

CLI Usage

All examples below assume CASHU_DIR and MINT_URL are set. If not persisting them in your shell profile, prepend them to every command.

Agent Tip: Always use the --yes (or -y) flag to skip interactive prompts and confirmations. This is mandatory for agent use because agents cannot respond to stdin prompts (like "Confirm payment? [y/N]"); omitting it will cause the command to hang and time out.

Balance & Info

# Check wallet balance
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes balance

# Check pending tokens
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes pending

# Get wallet info
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes info

# List wallets
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes wallets

Sending & Receiving

Send Cashu tokens (ecash):

# Send amount (generates a token string to share)
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes send \x3Camount>
# Example: CASHU_DIR=~/.cashu MINT_URL=https://8333.space:3338 cashu --yes send 100

Receive Cashu tokens:

# Receive a token string
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes receive \x3Ctoken_string>

Lightning Network

Pay a Lightning Invoice (melt):

# Pay an invoice
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes pay \x3Cbolt11_invoice>

Pay a Lightning Address (LNURL):

# Pay an LNURL/Lightning Address (automatically resolves the invoice)
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes pay \[email protected]> \x3Camount_sats>
# Example: CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes pay [email protected] 100

Create a Lightning Invoice (mint):

# Create an invoice to receive funds into the wallet
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes invoice \x3Camount>

Lightning Address (LNURL)

Manage your Nostr Lightning Address (e.g., [email protected]) to receive payments.

# Create (or display) your static Lightning Address
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes lnurl create

# Check for pending payments sent to your address
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes lnurl check

# Mint (claim) the pending payments
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes lnurl mint

Paying Cashu 402s (Agentic Pattern)

Cashu-enabled APIs may return a 402 Payment Required error with a payment request in the X-Cashu header. This is common for metered APIs or paid endpoints.

The flow:

  1. Make your HTTP request
  2. If you get a 402 with X-Cashu: creqA... header, extract the payment request
  3. (Optional) Decode it to check accepted mints: cashu decode \x3Cpayment_request>
  4. Pay it: cashu --yes pay \x3Cpayment_request>
  5. Get the token from the response
  6. Retry the original request, including the token in the X-Cashu header

Mint compatibility: Payment requests may encode specific mints from which ecash is accepted. If you try to pay with a wallet backed by a mint not in the allowed list, it will error. Use cashu decode \x3Ccreq> to see which mints are accepted before attempting payment.

Example:

# 1. Initial request (returns 402)
curl -s -i https://api.example.com/data

# Response includes:
# HTTP/1.1 402 Payment Required
# X-Cashu: creqA1...

# 2. Pay the payment request
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes pay "creqA1..."

# Returns a token like: cashuA...

# 3. Retry with token
curl -s -H "X-Cashu: cashuA..." https://api.example.com/data

This pattern is agentic-friendly: handle 402 automatically, pay, retry — just like handling rate limits or auth redirects.

Advanced

# Burn spent tokens
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes burn

# View all invoices
CASHU_DIR=~/.cashu MINT_URL=\x3Curl> cashu --yes invoices

Configuration

Nutshell uses a .env file inside CASHU_DIR for additional configuration. If MINT_URL is not provided, it may default to a public test mint or fail. Always specify your trusted mint.

Notes

  • Tokens are large strings starting with cashuA... (V3) or cashuB... (V4).
  • Ensure you back up your mnemonic if using significant funds (see cashu info).

Contributing

Open issues or contribute at https://github.com/cashubtc/nutshell

安全使用建议
This skill is an instruction wrapper around the open-source 'cashu' (Nutshell) CLI and appears internally consistent. Before installing or using it: (1) verify you install the official cashu package (use pipx as recommended) and confirm its upstream repository/maintainers; (2) only set MINT_URL to a mint you trust—the skill can make payments automatically when invoked with --yes; (3) back up your mnemonic and protect CASHU_DIR if you plan to use real funds; (4) note minor metadata issues (no homepage/source listed and package.json version differs from registry metadata), so confirm origin if you need higher assurance.
功能分析
Type: OpenClaw Skill Name: cashu Version: 0.19.6 The skill is designed to manage Cashu ecash wallets and perform Bitcoin/Lightning payments via the `cashu` CLI. It is classified as suspicious due to the inherent financial nature of its operations and the explicit instruction in `SKILL.md` for the agent to use the `--yes` flag, which bypasses interactive prompts and confirmations for all transactions (e.g., `send`, `pay`, `burn`). While this is necessary for agent automation, it means the agent will execute financial commands without further human confirmation for each specific action, posing a significant risk if the agent is compromised or misinterprets instructions. However, there is no evidence of intentional malicious behavior such as data exfiltration, backdoor installation, or unauthorized remote control.
能力评估
Purpose & Capability
Name/description (Cashu/Nutshell CLI for ecash and Lightning) match the declared requirements: it needs the cashu binary and MINT_URL/CASHU_DIR. The package.json also declares these requirements. No unrelated services, binaries, or credentials are requested.
Instruction Scope
SKILL.md only instructs running the cashu CLI, setting CASHU_DIR and MINT_URL, and using standard HTTP calls when handling 402/X-Cashu flows. It does not instruct reading unrelated system files or exfiltrating data. The agent tip to use --yes is appropriate for non-interactive operation but enables automatic payments, which users should be aware of.
Install Mechanism
No install spec in the skill bundle itself beyond guidance; package.json contains an install helper that runs 'pipx install cashu' (exec). pipx/pip is an expected distribution mechanism for this Python CLI. No obscure download URLs or archive extraction are present.
Credentials
The only environment items required are CASHU_DIR and MINT_URL (and optionally a .env inside CASHU_DIR). These are appropriate and necessary for a CLI wallet. No unrelated secrets or cloud credentials are requested.
Persistence & Privilege
The skill does not request always:true or elevated/system-wide configuration. It is user-invocable and allows autonomous model invocation by default (platform normal). It does not ask to change other skills or system settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cashu
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cashu 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.19.6
- Added a new section on "Paying Cashu 402s (Agentic Pattern)" with detailed instructions for handling HTTP 402 Payment Required responses using Cashu payment requests and tokens. - Explained compatibility requirements for mints when paying Cashu 402 payment requests. - No other content or command changes outside of documentation.
v0.19.5
Added contributing section with link to GitHub repo
v0.19.4
- Clarified that the `--yes` (or `-y`) flag is **mandatory** for agent use to avoid interactive prompts that cause commands to hang. - Added explanation that agents cannot respond to stdin prompts, highlighting the importance of always using the flag.
v0.19.3
- Added usage instructions for paying Lightning Addresses (LNURL) with the CLI, including example. - The "Lightning Network" section now distinguishes between paying invoices and paying LNURL/Lightning Addresses. - Documentation updated for clarity on new payment capabilities. - No changes to compatibility or requirements.
v0.19.2
- Removed the default value for the MINT_URL environment variable from configuration. - SKILL.md updated to require explicit user specification of the mint URL.
v0.19.1
- Updated the skill description to clarify that this is used for Bitcoin payments. - No functional changes; documentation has improved clarity for general users.
v0.19.0
- Added installation instructions for the `cashu` CLI using pipx or pip in the documentation. - No changes to usage or configuration; only documentation improvement.
v0.18.8
- Updated package.json for version 0.18.8. - No user-facing changes or documentation updates.
v0.18.7
- No user-facing changes in this version. - Routine update: no changes to documentation, commands, or features.
v0.18.6
- Added new documentation section for managing Nostr Lightning Address (LNURL), including commands to create, check, and mint payments via Lightning Address. - No changes to CLI requirements, environment variables, or main Cashu wallet/Lightning command usage.
v0.18.5
- All CLI command examples now include the `--yes` (or `-y`) flag to bypass interactive prompts and confirmations. - Added an "Agent Tip" reminding users to use the `--yes` flag for non-interactive operation. - No functional changes to setup or environment variables.
v0.18.4
- Added the MINT_URL environment variable as required configuration for using the CLI. - Updated setup instructions and all usage examples to include MINT_URL. - Clarified that both CASHU_DIR and MINT_URL must be set for proper operation. - Expanded explanations for environment variables and configuration.
v0.18.3
- Skill name changed from "nutshell" to "cashu". - No functional or usage changes; documentation and environment instructions remain the same.
v0.18.2
- Added comprehensive SKILL.md documenting usage of the Nutshell (cashu) CLI wallet. - Clarified required CASHU_DIR environment variable setup for Linux/macOS and Windows. - Provided clear examples for checking balances, sending/receiving tokens, and using Lightning Network features. - Documented advanced commands (burn, list invoices) and configuration via `.env` file. - Added notes on token formats and wallet security best practices.
元数据
Slug cashu
版本 0.19.6
许可证
累计安装 2
当前安装数 2
历史版本数 14
常见问题

Cashu 是什么?

This is what you use for Bitcoin payments. Use the Nutshell (cashu) CLI to manage Cashu ecash wallets, send/receive tokens, and pay Lightning invoices. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 976 次。

如何安装 Cashu?

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

Cashu 是免费的吗?

是的,Cashu 完全免费(开源免费),可自由下载、安装和使用。

Cashu 支持哪些平台?

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

谁开发了 Cashu?

由 a1denvalu3(@a1denvalu3)开发并维护,当前版本 v0.19.6。

💬 留言讨论