pull down to refresh
119 sats \ 0 replies \ @fewsats OP 1 Jul \ parent \ on: L402: internet-native paywalls builders
For a detailed flow chart, you can check the main page but here's the TL;DR version:
-
The client requests an HTTP resource.
-
The server checks if the client is authorized to access the resource (authentication + authorization + payment).
-
If payment is required, the server responds with a 402 (Payment Required) error code, including credentials and a challenge in the HTTP response headers.
-
The client solves the challenge and obtains proof of completion.
-
The client requests the same HTTP resource again, this time including the credentials and proof of completion in the authentication headers.
-
The server validates the client's credentials and the completed challenge.
-
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:
https://colab.research.google.com/drive/1MLZy1g6-lFqbRAfFOxR14PZ3b36sYr1r