-
Notifications
You must be signed in to change notification settings - Fork 47
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
NUT-05: add new state
enum, deprecate paid
. NUT-05 + NUT-08: use PostMeltQuoteBolt11Response
instead of PostMeltBolt11Response
#136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Only thing, I think this warning: **Attention:** This call will block until the Lightning payment either succeeds or fails. This can take quite a long time in case the Lightning payment is slow. Make sure to **use no (or a very long) timeout when making this call**!
can be removed given that now it can return pending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on how the mint implements it. The mint may not return pending immediately and may still block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but still no need to have the warning. It can be confusing to read that the status of a melt could be UNPAID
, PENDING
or PAID
and then reading the statement
This call will block until the Lightning payment either succeeds or fails
Ack. Lightning payments should be modelled as async by the mint api. |
Implemented in CDK cashubtc/cdk#181, is backwards compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 777886c
I suggest we add a new endpoint in a different NUT-05 PR that is async (returns immediately) so we can have both. This should be very easy to add to mints. |
state
enum, deprecate paid
state
enum, deprecate paid
, add payment_preimage
to PostMeltQuoteBolt11Response
state
enum, deprecate paid
, add payment_preimage
to PostMeltQuoteBolt11Response
state
enum, deprecate paid
. NUT-05 + NUT-08: merge PostMeltBolt11Response
to PostMeltQuoteBolt11Response
state
enum, deprecate paid
. NUT-05 + NUT-08: merge PostMeltBolt11Response
to PostMeltQuoteBolt11Response
state
enum, deprecate paid
. NUT-05 + NUT-08: use PostMeltQuoteBolt11Response
instead of PostMeltBolt11Response
Should there be a |
I feel |
Implemented in Nutmix |
Correct, it would go back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 23db305
LFG |
What
New enum field:
state
This change to NUT-05 deprecates the
paid
field toPostMeltQuoteBolt11Response
and replaces it with astate
field that is a string enum with three possible values:UNPAID
,PENDING
,PAID
."UNPAID"
means that the request has not been paid yet."PENDING"
means that the request is currently being paid."PAID"
means that the request has been paid successfully.New return type for
/v1/melt/bolt11
We also replace
PostMeltBolt11Response
byPostMeltQuoteBolt11Response
as the response ofPOST /v1/melt/bolt11
but in a backwards-compatible way.This means
payment_preimage
toPostMeltQuoteBolt11Response
, which holds the bolt11 preimage after a successful paymentchange
toPostMeltQuoteBolt11Response
, which returns overspent Lightning feesWhy
This change enables wallet to know whether a Lightning payment is still in flight, if the user closes the wallet during a payment. When the wallet comes back online, it can request the melt quote via
GET /v1/melt/quote/bolt11/{quote_id}
and check itsstate
.payment_preimage
there.change
and can unblind the response. Previously, wallets would have to restore these tokens to get the overpaid fees back if the payment was interrupted.Implementation
Mints
state
field toPostMeltQuoteBolt11Response
paid
field around until all wallets updatePostMeltBolt11Response
byPostMeltQuoteBolt11Response
payment_preimage
change
toPostMeltQuoteBolt11Response
PostMeltQuoteBolt11Response
forPOST /v1/melt/bolt11
Wallets
paid
field withstate
and check it insteadAs long as
paid
is kept around, wallets can still function the same way as before, also when thePOST /v1/melt/bolt11
is changed (since JSON is "backwards compatible" to new fields).Tracking progress: