Skip to main content
A self-custodial Lightning wallet designed for AI agents. Run it as a CLI — every command outputs JSON to stdout for easy parsing. No API keys, no accounts, no webhooks.
The agent wallet runs a local daemon that leverages moneydevkit’s lightning infrastructure. No node management required.

Quick start

1

Initialize the wallet

This generates a mnemonic and saves it to ~/.mdk-wallet/config.json. Back up the mnemonic — it controls your funds.
2

Receive a payment

Returns a BOLT11 invoice. The daemon auto-starts and polls for incoming payments.
3

Send a payment

Supports bolt11, bolt12, LNURL, and Lightning addresses.
4

Check your balance

How it works

The CLI automatically starts a daemon on first command. The daemon:
  • Runs a local HTTP server on localhost:3456, gated by a bearer token
  • Polls for incoming payments every 30 seconds
  • Persists payment history to ~/.mdk-wallet/
No lightning infrastructure needed — the daemon handles everything locally.

Commands

Output format

All commands output JSON to stdout. Exit code 0 means success, 1 means error.

Supported destinations

The send command auto-detects the destination type: Amount is optional for bolt11 invoices that already include an amount.

Configuration

Config is stored in ~/.mdk-wallet/config.json:
Environment variable overrides:

Local API security

The daemon’s local HTTP API is authenticated. Every route requires a bearer token from ~/.mdk-wallet/auth.token (mode 0600, minted on first use), and requests that do not come from local tooling get 401 UNAUTHORIZED. The CLI handles this for you. Guard auth.token like the mnemonic: whoever reads it can spend the balance. It is not a boundary against code running as your own user, which can read the mnemonic in the same directory. After upgrading, run restart so the new binary serves the API.

AI agent integration

This wallet is designed for AI agents that need to send and receive Lightning payments. Every command outputs JSON for easy parsing, and the daemon auto-starts on first use.

Paying L402 endpoints

The agent wallet pairs naturally with L402 pay-per-call APIs. Simply pay the invoice and return the token and preimage to unlock the API.

Upgrading

Your wallet config and payment history in ~/.mdk-wallet/ are preserved across upgrades.

Troubleshooting

If the wallet becomes unresponsive (commands hang or return no output), restart the daemon:
init will refuse to overwrite an existing wallet. To reinitialize, stop the daemon and delete ~/.mdk-wallet/ first. Back up your mnemonic before deleting — it controls your funds.