Skip to content
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

invoice description hash support #5121

Merged

Conversation

rustyrussell
Copy link
Contributor

No description provided.

Copy link

@erikarvstedt erikarvstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No thorough review, these are just some doc errors that stuck out.

As stated before, I'd prefer if there was an option for hash-only storage.
clightning should be unintrusive, efficient base layer tech. Forcing invoice creators to store descriptions and then deleting them in a separate command is inconvenient and slow.

doc/lightning-invoice.7.md Outdated Show resolved Hide resolved
doc/lightning-invoice.7.md Outdated Show resolved Hide resolved
@jb55
Copy link
Collaborator

jb55 commented Mar 23, 2022

Concept ACK, going to test this with https://github.com/jb55/lnurl-commando

@jb55
Copy link
Collaborator

jb55 commented Mar 23, 2022

If we now have a deschashonly option why not allow just passing a description hash? Otherwise when generating invoices remotely I have to send the full png over commando every time. not a big deal but it's slightly annoying...

@jb55
Copy link
Collaborator

jb55 commented Mar 23, 2022

If we now have a deschashonly option why not allow just passing a description hash? Otherwise when generating invoices remotely I have to send the full png over commando every time. not a big deal but it's slightly annoying...

ah I see #4892 implements it this way already 🤔

@rustyrussell
Copy link
Contributor Author

No thorough review, these are just some doc errors that stuck out.

As stated before, I'd prefer if there was an option for hash-only storage. clightning should be unintrusive, efficient base layer tech. Forcing invoice creators to store descriptions and then deleting them in a separate command is inconvenient and slow.

Then... don't delete them? If you're regularly issuing invoices you should be deleting expired ones, and if you have thousands of successful payments you can afford a few GB of storage.

LNURL wants this so they can include images etc in descriptions.

Replaces: ElementsProject#4892
Changelog-Added: JSON-RPC: `invoice` has a new parameter `deschashonly` to put hash of description in bolt11.
Signed-off-by: Rusty Russell <[email protected]>
Means that field is now optional in JSON output.

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Added: JSON-RPC: `delinvoice` has a new parameter `desconly` to remove description.
@rustyrussell
Copy link
Contributor Author

To be clear: I really want to see what invoices I have issued by my node. I suspect that the ability to mint invoices with only a description hash will get abused by plugins pretty badly, and disk space is cheap.

Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the only comment that I have is that some of these procedure parameters may be declared constant!

Comment on lines +669 to +670
struct invoices *invoices,
struct invoice invoice)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct invoices *invoices,
struct invoice invoice)
const struct invoices *invoices,
const struct invoice invoice)

wallet/invoices.h Show resolved Hide resolved
@niftynei
Copy link
Collaborator

niftynei commented Mar 25, 2022

@rustyrussell can you outline what abuse you have in mind here?

I suspect that the ability to mint invoices with only a description hash will get abused by plugins pretty badly,

They make invoices smaller...

@cdecker
Copy link
Member

cdecker commented Mar 28, 2022

I have to say that I agree with having the description be part of the invoice data is the correct thing to do here:

  • Consistency: being able to provide the description without referring to an external system is very valuable, especially if those external systems may end up malleating the description (image compression, PDF OCR modifications, editing descriptions) which would unlink the hash from the doc
  • Completeness and auditability: as @niftynei points out, there is a point in making sure that the information is as self-contained as possible. Plugins can rely on the information being present, and it reduces the variations that have to be dealt with.

I think ultimately, the fact that the description string can be used as an escape hatch by just including a URL and a hash should serve the use-cases where the description is managed externally.

@jb55
Copy link
Collaborator

jb55 commented Mar 28, 2022

all good justifications and I see that the description is stored even when deschashonly is set which makes sense. I still don't want to permanently store a copy of my lnaddress thumbnail for every invoice requested in an lnaddress payment, so perhaps I should just remove my png to become spec compliant or keep it and become not lnaddress spec compliant. I'm leaning toward the latter since lnlink skips the check anyways...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants