Today users are asked to provide a withdrawal Lightning invoice to a service, this requires some effort and is especially painful when user tries to withdraw funds into mobile wallet while using a desktop website. Instead of asking for Lightning invoice a service could display a "withdraw" QR code which contains a specialized LNURL
flow
User scans a LNURL QR code or accesses an lightning:LNURL.. link with LN WALLET and LN WALLET decodes LNURL.
LN WALLET gets Json response from LN SERVICE of form:
{
callback: String, // the URL which LN SERVICE would accept a withdrawal Lightning invoice as query parameter
k1: String, // random or non-random string to identify the user's LN WALLET when using the callback URL
maxWithdrawable: MilliSatoshi, // max withdrawable amount for a given user on LN SERVICE
defaultDescription: String, // A default withdrawal invoice description
minWithdrawable: MilliSatoshi // An optional field, defaults to 1 MilliSatoshi if not present, can not be less than 1 or more than `maxWithdrawable`
tag: "withdrawRequest" // type of LNURL
}
callback: String, // the URL which LN SERVICE would accept a withdrawal Lightning invoice as query parameter
k1: String, // random or non-random string to identify the user's LN WALLET when using the callback URL
maxWithdrawable: MilliSatoshi, // max withdrawable amount for a given user on LN SERVICE
defaultDescription: String, // A default withdrawal invoice description
minWithdrawable: MilliSatoshi // An optional field, defaults to 1 MilliSatoshi if not present, can not be less than 1 or more than `maxWithdrawable`
tag: "withdrawRequest" // type of LNURL
}
LN WALLET Displays a withdraw dialog where user can specify an exact sum to be withdrawn which would be bounded by:
lnurl is a bech32-encoded HTTPS query string which is supposed to help payer interact with payee and thus simplify a number of standard scenarios such as requesting incoming channels, withdrawing funds, logging in etc.