Paywally
1 minute read
I decided to play with cashu so I made
It’s a standalone web app, no KYC, that implements a lightning paywall: you need to pay 21 sats to unlock the hidden content.
How it works:
- The app fetches a 19 sats invoice from
bordalix@coinos.io
- Then it creates a melt quote with this invoice
- In return the app gets amount = 19 and fee_reserve = 2 sats
- It then creates a mint quote of 21 sats (19 + 2)
- In return the app gets a payment request (aka ln invoice)
- It shows this invoice to the user in qrcode and text
- It pools the mint every 5 seconds waiting for the invoice to be paid
- When paid, it mints the proofs
- Use these proofs to pay for the original invoice
- Receives a change of 2 sats and sends it to me via Nostr
It’s not perfect, the reader can sheat by inspecting the code and:
- Change the value to pay to 3 sats
- Change
bordalix@coinos.io
to his own lnurl - Access the content in the code (is obfuscated, but is there)
Try it to get access to the code repo.
Add your opinion
powered by nocomment