WIP: Add NUT-XX for batched minting #273

Closed
Egge21M wants to merge 5 commits from batch-mint into main
Egge21M commented 2025-07-09 11:19:43 +00:00 (Migrated from github.com)

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.

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.
Egge21M commented 2025-07-09 11:21:59 +00:00 (Migrated from github.com)

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.

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.
davidcaseria (Migrated from github.com) reviewed 2025-07-10 10:08:42 +00:00
@ -0,0 +24,4 @@
- **quote**: an array of **unique** quote IDs previously obtained via the [NUT-04 creation process][04-creation].
The mint returns a JSON array of quote objects, each containing:
davidcaseria (Migrated from github.com) commented 2025-07-10 10:08:37 +00:00

What is the behavior if one of the quote IDs is not found?

What is the behavior if one of the quote IDs is not found?
Egge21M (Migrated from github.com) reviewed 2025-07-10 12:10:00 +00:00
@ -0,0 +24,4 @@
- **quote**: an array of **unique** quote IDs previously obtained via the [NUT-04 creation process][04-creation].
The mint returns a JSON array of quote objects, each containing:
Egge21M (Migrated from github.com) commented 2025-07-10 12:10:00 +00:00

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

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
lescuer97 (Migrated from github.com) reviewed 2025-08-01 18:39:37 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
lescuer97 (Migrated from github.com) commented 2025-08-01 18:39:37 +00:00

what happens if we have repeated quote_ids? should we fail it?

what happens if we have repeated quote_ids? should we fail it?
lescuer97 (Migrated from github.com) reviewed 2025-08-01 18:45:27 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
lescuer97 (Migrated from github.com) commented 2025-08-01 18:45:27 +00:00

how would you thing NUT-20 signed mint should be handled?

may be just a new field called signatures and if they are mix we just do a null value?

how would you thing NUT-20 signed mint should be handled? may be just a new field called `signatures` and if they are mix we just do a null value?
Egge21M (Migrated from github.com) reviewed 2025-08-02 04:40:04 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
Egge21M (Migrated from github.com) commented 2025-08-02 04:40:03 +00:00

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.

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.
vnprc (Migrated from github.com) reviewed 2025-08-04 15:25:39 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
vnprc (Migrated from github.com) commented 2025-08-04 15:25:39 +00:00

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.

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.
vnprc (Migrated from github.com) reviewed 2025-08-06 14:58:01 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
vnprc (Migrated from github.com) commented 2025-08-06 14:58:01 +00:00

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!

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!
callebtc (Migrated from github.com) reviewed 2025-10-28 15:03:53 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
callebtc (Migrated from github.com) commented 2025-10-28 15:03:53 +00:00
  "quotes":   [ "locked_quote_id_1", "quote_id_2", "locked_quote_id_3" ],
```suggestion "quotes": [ "locked_quote_id_1", "quote_id_2", "locked_quote_id_3" ], ```
callebtc (Migrated from github.com) reviewed 2025-10-28 15:04:22 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
callebtc (Migrated from github.com) commented 2025-10-28 15:04:22 +00:00
  "quotes":   [ "quote_id_1", "quote_id_2", … ],
```suggestion "quotes": [ "quote_id_1", "quote_id_2", … ], ```
callebtc (Migrated from github.com) reviewed 2025-10-28 15:05:00 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
callebtc (Migrated from github.com) commented 2025-10-28 15:04:59 +00:00
  "quotes": [ "quote_id_1", "quote_id_2", … ]

maybe better nomenclature?

```suggestion "quotes": [ "quote_id_1", "quote_id_2", … ] ``` maybe better nomenclature?
vnprc (Migrated from github.com) reviewed 2025-11-17 23:09:50 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
vnprc (Migrated from github.com) commented 2025-11-17 23:09:50 +00:00
This spec describes how a wallet can mint multiple quotes in one batch operation.
```suggestion This spec describes how a wallet can mint multiple quotes in one batch operation. ```
vnprc (Migrated from github.com) reviewed 2025-11-18 02:24:16 +00:00
@ -0,0 +1,104 @@
# NUT-XX: Batched Mint
vnprc (Migrated from github.com) commented 2025-11-18 02:24:16 +00:00

I don't know if this is a terminology difference between implementations. My understanding is that a proof is an unblinded tuple of secret/signature. Multiple proofs in a quote are guaranteed unless your mint amount is a power of 2. I think it would be less ambiguous to say multiple quotes in the NUT description.

I don't know if this is a terminology difference between implementations. My understanding is that a proof is an unblinded tuple of secret/signature. Multiple proofs in a quote are guaranteed unless your mint amount is a power of 2. I think it would be less ambiguous to say multiple quotes in the NUT description.
vnprc commented 2025-11-18 03:32:40 +00:00 (Migrated from github.com)

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.

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.
callebtc commented 2025-11-30 18:09:08 +00:00 (Migrated from github.com)

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.

agreed!

> 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. agreed!
thesimplekid commented 2025-12-13 10:50:46 +00:00 (Migrated from github.com)
close for https://github.com/cashubtc/nuts/pull/323

Pull request closed

Sign in to join this conversation.
No description provided.