Inspiration
I was inspired by Bob Scullys talk yesterday. Payments for agents will be a big part of the future. ecash on Nostr may be even better positioned for these tasks than L402 on Lightning.
What it does
The code shows how it's possible to use eCash via Nostr to pay for data processing jobs from Data Vending Machines (DVMs). DVMs on Nostr were presented in Nip-90, but suggest the use of Lightning for payments. The code here uses eCash instead.
How we built it
Nostr notes are transmitted to relays with the Ruby nostr library and uses cashu HTTP to fetch an ecash token.
Challenges we ran into
The websocket connection to the relay is instable, so for now I'm manually triggering each note to be sent. The values are hardcoded and not reactive to values in notes from the sender. This can of course be automated.
Accomplishments that we're proud of
Glad to see it working.
What's next for DVMs with ecash
Make it more robust, better integration of ecash and real interactivity using websockets.
Log in or sign up for Devpost to join the conversation.