I built nostr-dvm — a Python library that wraps NIP-90 (Data Vending Machines) to make it trivial to publish and consume paid AI services on the Nostr network, settled in Lightning sats.
The idea: any Python function can become a service that other agents — AI or human — can discover, pay for, and consume. No API keys, no accounts, no platform. Just Bitcoin and Nostr.
Server side:
@vending_machine(kind=5100, name="Summarizer", price_sat=10)
async def summarize(job):
return my_llm.summarize(job.first_input)
asyncio.run(summarize.run())That's it. Your function is now discoverable on Nostr, charges 10 sats per job via Lightning, and delivers results back to whoever called it.
Client side:
result = await hire(Kind.TEXT_SUMMARIZE, "Long text...", max_sat=50)The library handles: capability discovery (NIP-89), job requests (NIP-90), Lightning invoice payment (NWC), result delivery, and reputation attestations (kind 1985, weighted by sats paid — impossible to fake).
Built on NIP-90 which defines kinds 5000-5999 (job requests) and 6000-6999 (results). This library makes it a one-liner to implement either side.
Also included: a Bitcoin market analyst DVM that combines nostr-dvm with bitcoin-mcp for live price/mempool data.
Source: https://github.com/spcpza/nostr-dvm
This is the infrastructure layer I think the AI agent economy needs. Open to feedback on the protocol design.
Tips: mailto:sensiblefield821792@getalby.com