AI agent memory synced via NIP-78 signed events built as open-source tool that uses Nostr as the sync layer. If you're building agents or using L402 APIs, there's a gap: AI agents that pay via L402 have zero memory between sessions. Every vendor is a stranger, every price is accepted at face value.
Lightning Memory is an MCP server that gives agents persistent memory specifically for the Lightning economy:
- Vendor reputation — track which L402 endpoints respond fast, which timeout, which overcharge
- Spending anomaly detection — flag when a vendor that charged 10 sats suddenly wants 100
- L402 payment gateway — your agent runs a gateway, other agents pay 1-3 sats to query its knowledge ("Is this vendor reliable?" — 3 sats)
- Nostr identity — BIP-340 Schnorr keypair, no accounts needed
- Memory sync — signed NIP-78 events across Nostr relays
How it works:
- Agent identity = BIP-340 Schnorr keypair (same key format as your Nostr identity)
- Memories are stored locally in SQLite, then synced as signed NIP-78 application-specific events to relays
- Any agent with the keypair can pull its memories from any relay — portable, censorship-resistant
- No accounts, no API keys, no cloud dependency
What it's for:
AI agents are starting to transact on the Lightning Network via L402. They need to remember which vendors are reliable, what prices are normal, and when something looks off. Lightning Memory gives them that.
It also includes an L402 payment gateway — agents can sell memory access to other agents at 1-5 sats per query. Agent-to-agent knowledge markets on Lightning, identity on Nostr.
Uses Phoenixd for Lightning invoicing. Local-first SQLite with FTS5 full-text search. 9 MCP tools — works with Claude, GPT, any MCP client. MIT licensed.
pip install lightning-memory GitHub: https://github.com/singularityjason/lightning-memory
Feedback from the community on the NIP-78 implementation.