Update 04.md - optional PostMintQuoteBolt11Request
keysetId
#120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR hopes to solve the following problem:
Using a lightning address to mint tokens that are not of unit
sat
(ie.usd
) results in a mismatch between the requested amount and actual amount in the invoice due to a lack of precision between the two units.When requesting a lightning invoice from an LNURL, the request must specify an amount in
msat
, so a cashu wallet that provides this functionality must convertmsat
to the user's preferred unit.Many lightning wallets that support paying lightning address expect the requested invoice amount to match the actual amount in the returned invoice.
The problem occurs when the user's preferred unit is not
sat
.For example:
Solution
By providing a
keysetId
along with thePostMintQuoteBolt11Request
, the wallet is able to mintusd
tokens, while specifying the exact amount of sats that should be in the invoice.An example request would be:
This request would allow the Cashu wallet to mint 3 usd tokens, but pay an invoice for 50 sats thereby passing the LN wallet's invoice validation.