Abstract NUT-04 and NUT-05 Payment Methods #258
No reviewers
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts!258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "update_methods"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NUT-04 and NUT-05 have been rewritten to be more abstract and to handle any possible payment method. These NUTs remain mandatory.
The officially defined BOLT11 payment method is organized under NUT-23. This NUT is optional.
There are no breaking changes to this refactor.
This is awesome. Does it include the bolt12 file by accident? If not, it might be useful to merge it with the bolt12 spec (https://github.com/cashubtc/nuts/pull/170).
@ -4,3 +4,3 @@`used in: NUT-20``used in: NUT-20, NUT-23`I think bolt12 does not have this state
@ -4,3 +4,3 @@`used in: NUT-20``used in: NUT-20, NUT-23`This would have to go to the bolt11 spec in
23.mdThis (the shown json) is also bolt11 specific, maybe we can mention here that there are settings for each method and their structure is defined in each spec file.
@ -97,3 +74,3 @@Like before, the mint `Bob` responds with a `PostMeltQuoteBolt11Response`.The mint responds with the same structure as the initial quote response.Should we keep this state in here as long as it's common for all payment methods or move it to bolt11?
@ -4,3 +4,3 @@`used in: NUT-20``used in: NUT-20, NUT-23`State may not be used for all of them. For example in the current draft of bolt12 I've removed it in favor of having an
amount_paidfield and anamount_mintedfield. I recommend we remove the state here and then specify it in bolt11 (23).@ -218,23 +133,15 @@ The settings for this nut indicate the supported method-unit pairs for minting a"unit": <str>,"min_amount": <int|null>,Description is bolt11 specific.
Amountless should be removed from the example.
@ -106,3 +79,1 @@# Melting tokensNow that `Alice` knows what the total amount is (`amount + fee + fee_reserve`) in her requested `unit`, she can proceed for melting tokens for which a payment will be executed by the mint. She calls the `POST /v1/melt/{method}` endpoint where `method` is the payment method requested (here `bolt11`).To execute the melting process, the wallet calls the `POST /v1/melt/{method}` endpoint.Move to bolt11? Not quite sure.
@ -218,23 +133,15 @@ The settings for this nut indicate the supported method-unit pairs for minting a"unit": <str>,"min_amount": <int|null>,I would suggest to move the entire json to bol11 and mention here that settings like additional supported features and transactions limits can be included.
@ -218,23 +133,15 @@ The settings for this nut indicate the supported method-unit pairs for minting a"unit": <str>,"min_amount": <int|null>,Thinking about this a bit more, I think its better if we define the minimum common settings (method, unit, min, max) and then have a generic object that can be defined by the specific method nut. This way for each new method we add it to the nut04 list of settings and not create a nut23 setting (nut23 using the current suggested number for bolt11).
@ -97,3 +74,3 @@Like before, the mint `Bob` responds with a `PostMeltQuoteBolt11Response`.The mint responds with the same structure as the initial quote response.@thesimplekid how is bolt12 handled?
@ -106,3 +79,1 @@# Melting tokensNow that `Alice` knows what the total amount is (`amount + fee + fee_reserve`) in her requested `unit`, she can proceed for melting tokens for which a payment will be executed by the mint. She calls the `POST /v1/melt/{method}` endpoint where `method` is the payment method requested (here `bolt11`).To execute the melting process, the wallet calls the `POST /v1/melt/{method}` endpoint.I lean towards keeping it because I think the expectation will be that the melting involves fees, which means a melt quote will be sensitive to fee changes over time.
@ -97,3 +74,3 @@Like before, the mint `Bob` responds with a `PostMeltQuoteBolt11Response`.The mint responds with the same structure as the initial quote response.For BOLT12 we use the state for melting its used the same as bolt11. I think it makes sense to keep at the very least all payment methods will use unpaid (they haven't starting paying the request) and paid (the payment is complete) and I think most will use pending (payment in flight) at least for some period of time or can skip from unpaid to paid if they really dont need it.
@ -106,3 +79,1 @@# Melting tokensNow that `Alice` knows what the total amount is (`amount + fee + fee_reserve`) in her requested `unit`, she can proceed for melting tokens for which a payment will be executed by the mint. She calls the `POST /v1/melt/{method}` endpoint where `method` is the payment method requested (here `bolt11`).To execute the melting process, the wallet calls the `POST /v1/melt/{method}` endpoint.I agree with keeping it. Its not like minting where there is a request where we may not be able to stop someone paying into the mint. If someone attempts to use an expired melt quote an error is simply returned and we do not burn the ecash so there isn't a risk of unaccounted for or stuck funds.
@ -210,3 +125,3 @@`MintMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether this minting is disabled.`MintMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether minting is disabled.Since we have the options method specific settings should be added there not in the top level struct.
Just a few small things but otherwise LGTM
@ -4,3 +4,3 @@`used in: NUT-20``used in: NUT-20, NUT-23`@ -210,3 +125,3 @@`MintMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether this minting is disabled.`MintMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether minting is disabled.PR for cdk https://github.com/cashubtc/cdk/pull/749
ACK
bd326c9164ACK
f3a45b3ebaACK
d7a623eeee