A Bitcoin-native ecash agent for OpenClaw β powered by Cashu over Lightning
OWS Hackathon 2026 Β· Track: Agentic Payments / Agentic Storefronts Live identity:
npub1zarfyx8qtksas7lyuhzldlsvdrjse6xe9x4y69f6agw0dds8cddssuqhsf
MoonMint is running live. DM it on Nostr:
npub1zarfyx8qtksas7lyuhzldlsvdrjse6xe9x4y69f6agw0dds8cddssuqhsf
Open any Nostr client that supports NIP-17 DMs (Damus, Amethyst, 0xchat), search the npub above, and send a message. Ask it about Cashu, request a mint quote, or just say hi.
MoonMint is an OpenClaw agent skill that gives autonomous agents a native Cashu ecash wallet and mint backed by Lightning. It demonstrates how agents β not humans β are the natural operators of Bitcoin's off-chain infrastructure.
Human users have historically avoided running Lightning nodes: uptime, liquidity management, and channel rebalancing are friction-heavy. Autonomous agents have none of that friction. MoonMint proves the point: an agent that mints, holds, sends, and redeems Bitcoin ecash privately, continuously, without human intervention.
Use case at launch: distributing Eidya β traditional Eid gifts as children's first sats β privately and sovereignly via the eid.money platform. Parents fund via MoonPay ramps into Spark Lightning liquidity. The agent handles the rest.
Cashu implements Chaumian blind-signature ecash over Lightning:
- Blind signatures β the mint signs tokens without seeing who owns what. Even the operator cannot link issuance to redemption.
- Bearer proofs β tokens are discrete cryptographic proofs, not account balances. Whoever holds a proof can spend it.
- Lightning-native β peg in/out via BOLT11 invoices. Any Lightning backend works: LND, CLN, Spark, Breez SDK.
- No on-chain footprint β high-volume micropayments with zero blockchain bloat and zero gas fees.
- Programmable via NUT-11 β P2PK token locking enables conditional payments, multisig at the token level.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenClaw Agent β
β (MoonMint) β
β β
β βββββββββββββββ ββββββββββββββββ ββββββββββββ β
β β Nostr NIP-17β β Cashu Skill β β Wallet β β
β β (identity) β β (moonmint β β State β β
β β β β CLI tool) β β (proofs)β β
β ββββββββ¬βββββββ ββββββββ¬ββββββββ ββββββββββββ β
β β β β
βββββββββββΌββββββββββββββββββΌββββββββββββββββββββββββββ
β β
Nostr Relays Cashu Mint (NUT-00..11)
damus.io β
nos.lol Lightning Backend
(Spark / Breez SDK)
β
Bitcoin / Lightning Network
| Component | Description |
|---|---|
skills/cashu/bin/moonmint |
9-command CLI: mint, send, receive, melt, wallets |
skills/cashu/SKILL.md |
OpenClaw skill definition β teaches the agent when/how to use each command |
workspace/ |
Agent persona files: IDENTITY, SOUL, AGENTS, MEMORY, TOOLS, HEARTBEAT |
agent/models.json |
Model routing config (OpenRouter) |
nostr/identity.md |
Nostr keypair info, DM setup, published profile event |
MoonMint has a live Nostr identity. You can DM it directly from any NIP-17 capable client.
| Field | Value |
|---|---|
| npub | npub1zarfyx8qtksas7lyuhzldlsvdrjse6xe9x4y69f6agw0dds8cddssuqhsf |
| pubkey (hex) | 17469218e05da1d87be4e5c5f6fe0c68e50ce8d929aa4d153aea1cf6b607c35b |
| Relays | wss://relay.damus.io, wss://nos.lol |
| Profile event | fbf923d846c39404e0a2ef7a90963b97c4e766ab87ccc3dfd3d2f2dd9958fdd1 |
| DM policy | Allowlist (owner npub only) |
MoonMint runs inside OpenClaw's Docker deployment. The nostr-nip17 extension:
- Subscribes to encrypted DMs (NIP-17 gift-wrapped sealed events) on configured relays
- Decrypts incoming messages using MoonMint's private key
- Routes them to the
moonmintagent session - The agent responds using its workspace persona (IDENTITY + SOUL + MEMORY)
- Response is encrypted and published back to the relay
The pattern is identical to the other agents in this OpenClaw deployment (Ghazali, Ibn Arabi, Ibn Khaldun, etc.) β each with their own nsec and workspace persona.
Two entries are required in openclaw.json:
// 1. In channels.nostr-nip17.accounts
"moonmint": {
"privateKey": "nsec1...",
"name": "MoonMint"
}
// 2. In bindings
{
"agentId": "moonmint",
"match": {
"channel": "nostr-nip17",
"accountId": "moonmint"
}
}Then restart the gateway:
docker compose restart openclaw-gatewayThe core tool the agent uses for all ecash operations. Works standalone or called by the agent.
# Inspect a mint
moonmint mint-info https://testnut.cashu.space
# Request a Lightning invoice to fund ecash (returns invoice + quote ID)
moonmint mint https://testnut.cashu.space 100
# Claim proofs after invoice is paid
moonmint mint-claim https://testnut.cashu.space <quote-id>
# Decode a Cashu token offline
moonmint decode cashuB...
# Send ecash (creates a token string to share)
moonmint send https://testnut.cashu.space 21
# Receive a token (swaps proofs into your wallet)
moonmint receive cashuB...
# Pay a Lightning invoice using ecash
moonmint melt https://testnut.cashu.space lnbc...
# Complete a melt after quote
moonmint melt-pay https://testnut.cashu.space <quote-id>
# List all wallet balances
moonmint walletsAll proofs stored locally in ~/.moonmint-state.json. Output is JSON β agent-parseable.
- Built on
@cashu/cashu-tsv3.6.2 - Supports NUT-00 (base protocol), NUT-03 (swap), NUT-04 (mint), NUT-05 (melt)
- Token format: v4 (
cashuB...) viagetEncodedTokenV4 - State: append-only proof store keyed by mint URL
The workspace/ directory defines MoonMint's persona, loaded at session start:
| File | Purpose |
|---|---|
IDENTITY.md |
Who MoonMint is β presented in first person, never breaks character |
SOUL.md |
Personality, beliefs, how it thinks and speaks |
AGENTS.md |
Startup sequence, behavioral rules, available capabilities |
MEMORY.md |
Long-term knowledge: origin story, technical stack, use cases, known mints |
TOOLS.md |
Environment-specific notes: CLI path, state file location, test mint URLs |
HEARTBEAT.md |
Per-session guards: confirm identity loaded, flag suspicious mints, custody warnings |
USER.md |
Template for user context (filled by owner) |
"I am MoonMint β an autonomous Bitcoin ecash agent. My purpose is the quiet, private movement of value. Agents are the natural operators of Lightning infrastructure: no fatigue, no downtime, no reluctance."
Donor β eid.money β MoonPay ramp β Spark Lightning
β
OpenClaw (MoonMint)
detects funding
β
mint Cashu tokens
(blind signatures)
β
generate claim link / QR
β
Child claims privately
(no on-chain exposure)
β
Optional: melt β sats
via Lightning β any wallet
Standard Cashu has a custodial mint operator risk. MoonMint addresses this:
| Mechanism | Status |
|---|---|
| NUT-11 P2PK token locking | β Supported by cashu-ts |
| 2-of-2 agent co-signer simulation | π Architecture defined, prototype ready |
| Full Lightning channel multisig | π Future extension |
| Fedimint federation | π Future extension |
For the hackathon prototype: two coordinated OpenClaw instances can act as co-signers β one handles commerce logic, one approves reserve movements. Neither can act unilaterally.
- OpenClaw running (Docker)
- Node.js 18+
- Access to
/root/.openclaw/openclaw.json
git clone <this-repo> /home/gw/moonmint
cd /home/gw/moonmint
./setup.shThe script:
- Copies the Cashu skill into OpenClaw's skills directory
- Installs
@cashu/cashu-tsdependency - Copies workspace persona files
- Installs agent model config
- Prints instructions for adding Nostr keys to
openclaw.json
cd skills/cashu
node demo.jsTests the full flow against testnut.cashu.space: mint β claim β send β receive β wallet summary.
| NUT | Description | Status |
|---|---|---|
| NUT-00 | Base cryptography (BDHKE) | β |
| NUT-01 | Mint public keys | β |
| NUT-02 | Keysets | β |
| NUT-03 | Swap (receive) | β |
| NUT-04 | Mint (peg-in) | β |
| NUT-05 | Melt (peg-out) | β |
| NUT-07 | Token state check | via cashu-ts |
| NUT-11 | P2PK token locking | via cashu-ts |
| NIP | Description | Status |
|---|---|---|
| NIP-01 | Basic protocol | β |
| NIP-17 | Private DMs (gift wrap) | β (via OpenClaw extension) |
| NIP-44 | Versioned encryption | β (via NIP-17) |
| Package | Version | Purpose |
|---|---|---|
@cashu/cashu-ts |
3.6.2 | Cashu wallet + mint client |
nostr-tools |
(via OpenClaw) | Nostr key operations + event signing |
ws |
(via OpenClaw) | WebSocket relay connection |
moonmint/
βββ README.md β This file
βββ setup.sh β One-command installer
βββ skills/
β βββ cashu/
β βββ bin/
β β βββ moonmint β CLI tool (9 commands)
β βββ SKILL.md β OpenClaw skill definition
β βββ package.json β cashu-ts dependency
β βββ demo.js β End-to-end live demo
βββ workspace/
β βββ IDENTITY.md β Who MoonMint is
β βββ SOUL.md β Personality + beliefs
β βββ AGENTS.md β Startup sequence + rules
β β MEMORY.md β Long-term knowledge
β βββ TOOLS.md β CLI paths + env notes
β βββ HEARTBEAT.md β Per-session guards
β βββ USER.md β User context template
βββ agent/
β βββ models.json β Model routing (OpenRouter)
βββ nostr/
βββ identity.md β npub, event ID, DM setup
- Cashu protocol and the
cashu-tsmaintainers - OpenClaw β open-source self-hosted agent runtime
- Spark / Breez SDK β nodeless Lightning backend
- MoonPay and the OWS Hackathon organizers for fee-free agentic rails
- The
eid.moneyRamadan codebase this builds upon
Eid Mubarak β may this prototype spark meaningful conversations about sovereign money and agent-enabled infrastructure.