Skip to content

[feature]: Make payment address mandatory #9700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
erickcestari opened this issue Apr 10, 2025 · 4 comments · May be fixed by #9702
Open

[feature]: Make payment address mandatory #9700

erickcestari opened this issue Apr 10, 2025 · 4 comments · May be fixed by #9702
Assignees
Labels
enhancement Improvements to existing features / behaviour
Milestone

Comments

@erickcestari
Copy link

Is your feature request related to a problem? Please describe.
Currently, LND only requires the payment secret (s field) for BOLT11 invoice writers but not for readers. This creates an inconsistency with the updated Lightning Network specifications where the payment secret is now mandatory for both writing and reading.

Describe the solution you'd like
Update LND to make the payment secret (s field) mandatory when reading/processing BOLT11 invoices. Specifically:

  1. Modify the invoice validation logic to reject invoices that lack a payment secret field
  2. Remove any code that allows skipping s fields with incorrect length
  3. Update relevant tests to ensure invoices without payment secrets are properly rejected
  4. Update LND's feature bit handling to treat payment_secret as ASSUMED (per BOLT 9 changes)

Additional context
This change aligns with recent updates to the BOLT11 specifications where the payment secret field (s) is now mandatory for both writers and readers. The change is motivated by privacy improvements - payment secrets prevent intermediate nodes from probing for the destination by generating their own payment onions.

Other implementations like LDK have already implemented this requirement by refusing to pay invoices missing a payment secret. Since it has been approximately 4 years since the writer-side requirement was introduced, and all modern implementations now include payment secrets in their invoices, this change represents the formalization of existing best practices.

The BOLT 9 specification has also been updated to change the payment_secret feature to ASSUMED status, reflecting that this is now considered a core part of the Lightning Network protocol rather than an optional feature.

Related changes in the BOLT specifications (lightning/bolts#1242):

  • Added requirement for readers to fail payment if the s field is missing
  • Removed requirement to skip 's' fields with incorrect length
  • Added test vectors for invalid invoices missing the s field
  • Changed the payment_secret feature to ASSUMED in BOLT 9
@erickcestari erickcestari added the enhancement Improvements to existing features / behaviour label Apr 10, 2025
@erickcestari
Copy link
Author

If this is desired for the project. Could i work on this feature?

@MPins
Copy link
Contributor

MPins commented Apr 10, 2025

Hello @saubyk, I’ve been talking to @erickcestari about the specs update he made a few days ago (already merged).
He’s ready to take over the issue also.

@saubyk saubyk added this to lnd v0.20 Apr 10, 2025
@saubyk saubyk added this to the v0.20.0 milestone Apr 10, 2025
@saubyk saubyk moved this to Backlog in lnd v0.20 Apr 10, 2025
@saubyk
Copy link
Collaborator

saubyk commented Apr 10, 2025

If this is desired for the project. Could i work on this feature?

Go ahead

@erickcestari erickcestari linked a pull request Apr 10, 2025 that will close this issue
@saubyk saubyk moved this from Backlog to In progress in lnd v0.20 Apr 11, 2025
@guggero
Copy link
Collaborator

guggero commented Apr 15, 2025

Related: #9718.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

4 participants