Conversation
This commit introduces a new specification, NUT-XX, for batched mint operations. It allows wallets to mint multiple proofs in a single transaction, improving efficiency.
|
I started this as a draft to gather feedback by mint implementors (as the wallet side is trivial). The Cashu side of things should be very easy to do, however getting payment state of multiple payment requests might introduce challenges. |
|
|
||
| - **quote**: an array of quote IDs previously obtained via the [NUT-04 creation process][04-creation]. | ||
|
|
||
| The mint returns a JSON array of quote objects, each containing: |
There was a problem hiding this comment.
What is the behavior if one of the quote IDs is not found?
There was a problem hiding this comment.
I think the best would be to simply omit it from the response. That way the client could handle that case and still use the available data without resending the request
xx.md
Outdated
| Content-Type: application/json | ||
|
|
||
| { | ||
| "quote": [ "quote_id_1", "quote_id_2", … ], |
There was a problem hiding this comment.
what happens if we have repeated quote_ids? should we fail it?
There was a problem hiding this comment.
Yes, I think making that an invalid request is the best thing to do here. I guess as long as the output sum still matches, a mint could go through with the request, but this feels like adding to much complication. Clients should not include quotes twice.
xx.md
Outdated
| Content-Type: application/json | ||
|
|
||
| { | ||
| "quote": [ "quote_id_1", "quote_id_2", … ] |
There was a problem hiding this comment.
Perhaps out of scope for this NUT but I have identified a need to query quotes by NUT-20 locking key for the mining share payment method NUT, aka ehash. I intend to propose this change to NUT-04.
There was a problem hiding this comment.
It's looking like my proposal might turn into an API that queries quote ID by NUT-20 locking key. Which means I could make one API call to get the quote IDs and then call this API as-is to mint the tokens.
So I guess all I'm saying is LGTM!
|
We should require all quotes to share the same payment method. BOLT11 quotes expire, BOLT12 quotes do not. This would be very difficult to reconcile in a single batch mint function for little benefit. |
Co-authored-by: vnprc <9425366+vnprc@users.noreply.github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
agreed! |
|
close for #323 |
This commit introduces a new specification, NUT-XX, for batched mint operations. It allows wallets to mint multiple proofs in a single transaction, improving efficiency.