Skip to content

Conversation

@Egge21M
Copy link
Contributor

@Egge21M Egge21M commented Jul 9, 2025

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
Copy link
Contributor Author

Egge21M commented Jul 9, 2025

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.

@thesimplekid thesimplekid added new nut A new protocol NUT needs discussion Needs more discussion labels Jul 9, 2025

- **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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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", … ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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", … ]
Copy link

@vnprc vnprc Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@vnprc
Copy link

vnprc commented Nov 18, 2025

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.

thesimplekid and others added 2 commits November 18, 2025 10:21
Co-authored-by: vnprc <9425366+vnprc@users.noreply.github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
@callebtc
Copy link
Contributor

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!

@vnprc vnprc mentioned this pull request Dec 12, 2025
@thesimplekid
Copy link
Collaborator

close for #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs discussion Needs more discussion new nut A new protocol NUT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants