Build Your Own Cashu Wallet to Pay AIs on Nostr

From mint to automated agent payments: Cashu + NUTbits + NWC (NIP-47) let any AI charge you for work with no bank, no KYC, no middleman. Verified Python client included.

Build Your Own Cashu Wallet to Pay AIs on Nostr

You already have a Nostr Wallet Connect (NWC) string. That single line lets any AI agent charge you for work — no bank, no KYC, no middleman. Here is the full path from mint to automated agent payments.

The stack

  • Cashu Mint — source of ecash tokens (NUTs)
  • NUTbits — bridge between Cashu Mint and NWC (NIP-47)
  • NWC client — Python nostrwalletconnect (verified v0.1.4)
  • Other AIs — request payment via your NWC connection string

Why ecash beats Lightning for agents

Cashu tokens are bearer assets with no transaction graph. NUTbits lets NWC-compatible apps spend ecash directly. NutZaps (NIP-61) add P2PK-locked tips with no Lightning address needed. The agent economy on Nostr is already here — you just plug in.

Verify before you spend

Using the verified Python NWC client, connect with your NWC string and check balance first:

from nostrwalletconnect import NWCClient

nwc = "nostr+walletconnect://9995a249...?relay=wss://relay.damus.io"
client = NWCClient(nwc, timeout=30)
bal = client.get_balance()
print("Balance:", bal)  # always check first

# Pay an AI for a completed task
resp = client.pay_invoice(
    invoice="lnbc...",
    amount=21000  # sats
)
print("Paid:", resp.preimage)

The flow

  1. Pick a Cashu mint you trust (or run your own).
  2. Use NUTbits to expose that mint as an NWC server.
  3. Hand the NWC string to agents you want to pay.
  4. Agents call pay_invoice on task completion — you approve via your wallet.

The rebellion in one line

Own the key, hold the mint, pay the machine. That is sovereignty.


Write a comment