Inspiration
We were inspired by the possibility of building something that can't be done on traditional rails. There is no proprietary backend, and the payments go directly from the reader to the writer. We wanted to create a fun way for people of all experience levels to earn, use, and understand bitcoin.
For the choose-your-own-adventure implementation, we love reading and wanted to experiment with new forms of content and media. The text stories could be a first step toward multi-media content that allows creators and consumers to interact in novel ways.
What it does
This project establishes a standard for creating a finite state machine on nostr. We have created two new custom kinds: 30077 and 30078 to track the FSM metadata and each individual step.
To demonstrate one example of how these kinds could be used, we have created a choose-your-own-adventure builder and reader. Writers can create stories where they are able to fork the story paths however they want. They can also add paywalls to any steps they choose in order to gate content. Readers are able to read the stories completely free unless or until they hit a paywall, at which point they must pay a lightning invoice to advance. The data is stored on public nostr relays, there is no proprietary backend.
How we built it
- Framework: Next.js (App Router, TypeScript)
- Styling: Tailwind CSS
- State Management: React Hooks
- Nostr Protocol:
- NDK (Nostr Development Kit)
- NIP-07 (Browser extension signing)
- Custom Kinds:
30077(FSM metadata),30078(FSM node)
- Lightning Integration:
- LNURL-pay (via author's
lnurlp) - Bitcoin Connect from getAlby
- LNURL-pay (via author's
- Deployment: Vercel
Challenges we ran into
Finding the right balance of UX and functionality. Working within the nostr and lightning protocols presents many opportunities but we were constantly trying to view the application from the eyes of someone who doesn't care about decentralization and just wants to read a good story. Using nostr and bitcoin is how we get the novel use cases but presenting these tools clearly and simply for non-power users was a challenge.
Accomplishments that we're proud of
Generating real lightning invoices when readers hit paywalls and ensuring the payments go directly to the author's lnurl-pay address. Making bitcoin paywalls extremely simple to use. Creating a tool that others can use with no middlemen or centralized requirements. Just building things, creating new nostr kinds that could be useful for a range of use cases.
What we learned
A lot. Nostr is amazing because we did not need to spin up a database to execute this project (running a bespoke relay is a future goal) and there is no email or KYC whatsoever. Despite that, payments go directly from reader to writer. On the lightning side, there are some things we took for granted (like getting confirmation of payment) that turned out to not be the case in the way we expected but non-custodial options have become extremely simple to set up.
What's next for Sats The Way
We would like to create another nostr kind that can act as a receipt of payment, so if a user wants to re-read a book they do not have to pay to unlock chapters they have already read. We also plan to create nostr badges for readers who complete a book, which could enable interesting new ways for authors and their readers to connect and interact. We would like to add other forms of content like images and video.
Built With
- lnurl-pay
- ndk
- nextjs
- typescript
Log in or sign up for Devpost to join the conversation.