pull down to refresh

We build a new page dedicated to spreading awareness about the L402 protocol.
The L402 brings built-in payments to the HTTP level, powered by the Lightning Network, making it easier than ever to paywall any HTTP endpoint in the internet. It enables you to integrate a payment mechanisms directly into your web applications, enabling a smoother and more efficient monetization process.
There are currently several libraries available that make it easy to integrate L402 into your servers and clients applications in an easy way.
The L402 protocol has been live at Lightning Labs since 2021. At FuseStats, we use L402 to paywall files, databases, and APIs on our platform.
If you have any questions about how to integrate this in your service, feel free to ask in the replies.
Happy coding!
100 sats \ 1 reply \ @random_ 1 Jul
Another way SN could integrate L402 is by adding themselves as a wallet to pyL402
reply
You're absolutely right!
When we built fewsats.com, one of the first challenges we encountered was the lack of L402-compatible clients, which made it difficult for users to make payments seamlessly. Even with our bitcoin-connect-based client, many users still preferred the familiarity of scanning QR codes.
For the L402 ecosystem to flourish, we need more compatible clients across various platforms, like browsers and mobile apps. This will enable a wider range of users to access and consume L402-paywalled endpoints with ease.
We're currently working on a solution to onboard users to the ecosystem, even if they don't have an L402-compatible client or even a LN wallet but that's still 2-3 weeks away :)
reply
Am I free to use these on my website for exclusive videos/podcasts? L402 is open for anyone to leverage??
reply
Of course! It's an open protocol that was initially developed by Lightning Labs and is currently being standardized as a BLIP
You can find the BLIP details here: https://github.com/lightning/blips/pull/26
There are already several libraries and websites that have implemented this protocol. I've compiled a list of awesome resources related to L402 on this GitHub repo:
If you encounter any issues while integrating L402 into your project, feel free to open an issue on that repo, and the community will be happy to help you out!
reply
deleted by author
reply
How are internet-native paywalls implemented?
reply
For a detailed flow chart, you can check the main page but here's the TL;DR version:
  1. The client requests an HTTP resource.
  2. The server checks if the client is authorized to access the resource (authentication + authorization + payment).
  3. If payment is required, the server responds with a 402 (Payment Required) error code, including credentials and a challenge in the HTTP response headers.
  4. The client solves the challenge and obtains proof of completion.
  5. The client requests the same HTTP resource again, this time including the credentials and proof of completion in the authentication headers.
  6. The server validates the client's credentials and the completed challenge.
  7. The server processes the request and serves the HTTP resource.
Currently, the credentials are Macaroons (a type of cookie), and the challenge is a Lightning invoice (proof of completion is the preimage).
You can check out the full flow with code in our notebook tutorial:
reply
0 sats \ 1 reply \ @Car 1 Jul
Nice site!
reply
Thanks so much!
The L402 ecosystem is still young, so even a simple site pointing people in the right direction is a win. Please let us know if you have any suggestions for improvement
reply