Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MoonMint πŸŒ™βš‘

A Bitcoin-native ecash agent for OpenClaw β€” powered by Cashu over Lightning

OWS Hackathon 2026 Β· Track: Agentic Payments / Agentic Storefronts Live identity: npub1zarfyx8qtksas7lyuhzldlsvdrjse6xe9x4y69f6agw0dds8cddssuqhsf


Try It

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.


What Is MoonMint?

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.


Why Cashu?

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.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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

Components

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

Nostr Identity (NIP-17)

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)

How It Works

MoonMint runs inside OpenClaw's Docker deployment. The nostr-nip17 extension:

  1. Subscribes to encrypted DMs (NIP-17 gift-wrapped sealed events) on configured relays
  2. Decrypts incoming messages using MoonMint's private key
  3. Routes them to the moonmint agent session
  4. The agent responds using its workspace persona (IDENTITY + SOUL + MEMORY)
  5. 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.

OpenClaw Config

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-gateway

Cashu CLI β€” moonmint

The 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 wallets

All proofs stored locally in ~/.moonmint-state.json. Output is JSON β€” agent-parseable.

Implementation

  • Built on @cashu/cashu-ts v3.6.2
  • Supports NUT-00 (base protocol), NUT-03 (swap), NUT-04 (mint), NUT-05 (melt)
  • Token format: v4 (cashuB...) via getEncodedTokenV4
  • State: append-only proof store keyed by mint URL

Agent Workspace

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)

MoonMint's Character

"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."


Demo Flow

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

Trust Model

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.


Setup

Prerequisites

  • OpenClaw running (Docker)
  • Node.js 18+
  • Access to /root/.openclaw/openclaw.json

Install

git clone <this-repo> /home/gw/moonmint
cd /home/gw/moonmint
./setup.sh

The script:

  1. Copies the Cashu skill into OpenClaw's skills directory
  2. Installs @cashu/cashu-ts dependency
  3. Copies workspace persona files
  4. Installs agent model config
  5. Prints instructions for adding Nostr keys to openclaw.json

Run the Demo

cd skills/cashu
node demo.js

Tests the full flow against testnut.cashu.space: mint β†’ claim β†’ send β†’ receive β†’ wallet summary.


Technical Spec

Cashu Protocol Support

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

Nostr Protocol Support

NIP Description Status
NIP-01 Basic protocol βœ…
NIP-17 Private DMs (gift wrap) βœ… (via OpenClaw extension)
NIP-44 Versioned encryption βœ… (via NIP-17)

Dependencies

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

Repository Structure

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

Acknowledgements

  • Cashu protocol and the cashu-ts maintainers
  • 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.money Ramadan codebase this builds upon

Eid Mubarak β€” may this prototype spark meaningful conversations about sovereign money and agent-enabled infrastructure.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages