Replying to Avatar Blake

Here is an rust Nostr Paywall example project. It responds with 402 Payment Required, unless your NIP-98 HTTP Auth event’s pubkey has been granted access.

https://github.com/blakejakopovic/nostr_paywall_example

It’s a separate project, however it can work together with the lightning payment webhook server I shared yesterday. Payment webhook events can update the DB, and then the paywall can succeed, and provide access for that pubkey for that content.

https://github.com/blakejakopovic/lightning_rs_webhook

Worth noting too that this project doesn’t actually require the access to be paid. It could return 401 Unauthorised instead of 402 Payment Required, if access is whitelisted for example.

It could be used to check a pubkey against premium relay membership for extra services, for things like accessing your own backups, uploading media, or translation, etc. Basically any Nostr HTTP Auth scenarios.

And it’s written as middleware, so you can use it as a rust library/crate in your project.

Reply to this note

Please Login to reply.

Discussion

No replies yet.