lnurl / luds

lnurl specifications
596 stars 140 forks source link

LNURL tag query parameter #72

Closed pvyhnal-generalbytes closed 3 years ago

pvyhnal-generalbytes commented 3 years ago

The Readme mentions:

Once LNURL is decoded:

  • If tag query parameter is present then this LNURL has a special meaning, further actions will be based on tag parameter value.
  • Otherwise a GET request should be executed which must return a JSON object containing a tag field, further actions will be based on tag field value.

Does the first point mean the original URL encoded in the QR code can contain tag=withdrawRequest and then the wallet can skip the first HTTP GET and get all the other parameters from the original URL?

In this case the URL in the QR code would also have callback, k1, defaultDescription, minWithdrawable, maxWithdrawable query parameters?

So the withdraw flow would be:

  1. User scans a LNURL QR code and LN WALLET decodes LNURL.

LN WALLET gets callback, k1, defaultDescription, minWithdrawable, maxWithdrawable from url query params

  1. LN WALLET Displays a withdraw dialog where user can specify an exact sum to be withdrawn which would be bounded by:

[...]

This is not mentioned on the LNURL-withdraw page or the other pages. It would save one round trip of HTTP but is it actually supported by wallets?

fiatjaf commented 3 years ago

It is mentioned as the "fast" withdraw method, which shouldn't be used in QR codes, only links. And wallet support is optional since the server must provide the params through the URL anyway in case the wallet asks.

pvyhnal-generalbytes commented 3 years ago

Thanks, I overlooked the "fast" withdraw section because it says It is not suitable for QR code implementations.

Why is it not suitable for QRs, if a new QR would be generated for every new withdrawal?