lightninglabs / lightninglabs/L402
Require X-Accept-Authenticate: LN-invoice header
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 91
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
I was randomly thinking about payment protocol over HTTP and realized it'd be nicer to require that the client sends `X-Accept-Authenticate: LN-invoice header` (could be standardized to not require `X-` in the future) This allows the server to know upfront that the client actually supports LN.
Advantages:
* The server can make conditional response and e.g. send CAPTCHA instead (if it's used as rate-limiting feature) or provide on-chain address for clients who wish to avoid LN and pay bigger amount upfront. (Or use fiat :vomiting_face: )
* The server can avoid generating and storing the invoice if the endpoint was visited by accident. This is NOT meant as a protection against malicious actors attempting to DoS, just a small optimization/helper. Since various (spam, indexing...) bots today do not understand LN, it actually does serve as a spam protection **temporarily**.
Disadvantages:
* Slightly more complicated implementation
* Privacy implications if **browsers** unconditionally send the header while being minority. This can be mitigated by the server sending a header like `X-Supports-LN: example.com/*, *.example.com/*`, the browser could then offer the user to enable LN for that website.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or implementation entry points are named. Start by locating the HTTP authentication and payment-handling paths, then clarify whether the project should require the proposed X-Accept-Authenticate header and define compatible client and server behavior before implementation.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, authentication, payments
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100