Skip to content

HumanjavaEnterprises/nwc.app.HA-python.src

Repository files navigation

NostrWalletConnect for Hermes Agent

Lightning wallet access for your Hermes Agent — pay invoices, check balance, create invoices, and read transaction history over Nostr Wallet Connect (NIP-47).

Same NIP-47 wire protocol as the human-facing Alby / Mutiny / LNbits clients and the OpenClaw pip install nostrwalletconnect SDK.

v0.1.0 — five async tools (get_info, balance, pay_invoice, make_invoice, list_transactions). Vendors nostrwalletconnect + nostrkey so the plugin is self-contained.

Why?

A sovereign agent needs to handle money the same way it handles identity — directly, without a platform middleman. NIP-47 lets your wallet (running anywhere) delegate signing authority to a connection URI; your agent uses that URI to send payment requests over Nostr. The wallet stays in your control. The agent never sees private keys beyond the URI itself.

What your Hermes can do once it's connected:

  • Pay BOLT11 invoices — an agent can settle for services it consumes (API calls, content, compute) without you in the loop.
  • Issue invoices — an agent can charge for services it provides (analysis, content generation, automation).
  • Track its own books — list transactions to reconcile what was spent and earned across a session.
  • Confirm wallet capabilitiesget_info returns the supported NIP-47 methods so the agent can self-check before attempting.

Install

hermes plugins install HumanjavaEnterprises/nwc.app.HA-python.src

Or drop the repo directly into $HERMES_HOME/plugins/:

git clone https://github.com/HumanjavaEnterprises/nwc.app.HA-python.src \
  $HERMES_HOME/plugins/nwc

Setup

This plugin requires the NWC_URI env var pointing at a connection string from your wallet service:

export NWC_URI="nostr+walletconnect://<wallet-pubkey>?relay=wss://...&secret=..."

Get a URI from any NIP-47 wallet:

  • Alby — Settings → Wallet Connections
  • Mutiny — Settings → Connections
  • LNbits — Extensions → NWC Service Provider
  • Self-hosted: any NIP-47-capable wallet daemon

Restart Hermes after setting the env var, then /reload-skills or restart your chat session.

Quick Start

> What's my Lightning balance?

> Pay this invoice: lnbc500u1p...

The agent calls nwc_balance or nwc_pay_invoice automatically.

Tools

Tool Purpose
nwc_get_info Wallet capabilities (alias, supported methods, network)
nwc_balance Current balance in msats and sats
nwc_pay_invoice Pay a BOLT11 invoice; returns preimage
nwc_make_invoice Create a BOLT11 invoice for receiving
nwc_list_transactions Recent transaction history

Security

  • The URI is sensitive. It carries a delegated signing key for your wallet. Treat it like an API token — never paste it into the chat. This plugin reads it only from the env var, never from a tool argument, so it never enters the LLM context.
  • pay_invoice spends real funds. When the model decides to call it, the operator is in the loop via Hermes's command-approval flow (unless --yolo is set). For agentic flows where the model pays autonomously, set spending limits at the wallet level (NWC supports per-connection budget caps).
  • Use a dedicated wallet for agents — don't connect your full custodial balance. Spin up a hot wallet, fund it with a daily budget, rotate the URI when needed.

Sibling Project

OpenClaw build of the same library: nwc.app.OC-python.src ships as pip install nostrwalletconnect. Both repos vendor the same core SDK — bugfixes need to land in both.

License

MIT — see LICENSE.

About

Hermes Agent plugin port of nostrwalletconnect — Lightning wallet (NIP-47) exposed as 5 async agent tools.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages