A ContextVM server providing a Cashu wallet using the Coco Cashu TypeScript library.
This server enables secure Bitcoin Lightning, and Cashu payments through the Cashu protocol, offering a complete wallet interface to manage mints, pay invoices, make invoices, send cashu tokens, receive cashu tokens, etc. It integrates with the Coco Cashu deterministic wallet architecture for reliable key management and transaction processing.
- Runtime: Bun.js
- Core Libraries:
coco-cashu-core&coco-cashu-sqlite3- Deterministic wallet operations@cashu/cashu-ts- Cashu protocol implementation@modelcontextprotocol/sdk- MCP server framework
- Database: SQLite with automatic quote processing
- Security: BIP-39 mnemonic seed phrases with secure auto-generation
- Auto-generation: If no
COCO_SEEDis provided, a secure 12-word BIP-39 mnemonic is automatically generated and saved to.env - Backup Required: The generated seed is displayed once - losing it means losing access to your funds
- Manual Setup: You can provide your own seed via
COCO_SEEDenvironment variable
- Private Key:
SERVER_PRIVATE_KEY(hex format) is required for Nostr transport - Risk: If not set, a new key is generated each startup, preventing persistent server identity
- Allowed Keys:
ALLOWED_PUBLIC_KEYSrestricts wallet access; empty = open to anyone (not recommended)
- Always set
ALLOWED_PUBLIC_KEYSto specific public keys. This pubkeys will have access to all the wallet operations. - Securely backup your
COCO_SEEDmnemonic. - Set a persistent
SERVER_PRIVATE_KEYfor stable server identity - Keep your
.envfile secure and never commit it
# Clone and setup
git clone <repository-url>
cd nutoff-wallet
# Install dependencies
bun install
# Run the server
bun run startOn first run:
- A secure seed phrase will be generated and displayed
- The seed is automatically saved to
.env - Save the seed securely - it's your wallet backup
Copy .env.example to .env and customize:
# Essential security settings
COCO_SEED="your bip39 mnemonic" # Auto-generated if empty
SERVER_PRIVATE_KEY="hex_key" # Required for Nostr transport
ALLOWED_PUBLIC_KEYS="client_pubkey1,client_pubkey2" # Restrict access
SERVER_RELAYS="wss://relay.example.org" # Nostr relays for the server# Run built server
bun run start