Skip to content

feat(mint): implement NUT-29 batched minting#958

Merged
callebtc merged 26 commits into
mainfrom
feature/nut-29-batch-minting
May 22, 2026
Merged

feat(mint): implement NUT-29 batched minting#958
callebtc merged 26 commits into
mainfrom
feature/nut-29-batch-minting

Conversation

@a1denvalu3
Copy link
Copy Markdown
Collaborator

Summary

Implements the NUT-29 batched minting specification on the mint side.

Details

  • Models: Added PostMintQuoteCheckRequest, PostMintBatchRequest, and PostMintBatchResponse.
  • API Endpoints:
    • POST /v1/mint/quote/bolt11/check
    • POST /v1/mint/bolt11/batch
  • Ledger Logic: Implemented mint_quote_check and mint_batch with strict validations for payment methods, units, states, amount balances, and NUT-20 aggregated signatures.
  • Mint Info: Advertises BATCH_MINT_NUT (29) support with max_batch_size based on mint configurations.
  • Tests: Added full test coverage for the new endpoints and validation logic in tests/mint/test_mint_api_batch.py.

References: NUT-29 Specification

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 67.78846% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.03%. Comparing base (cd160f1) to head (2169866).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/mint/management_rpc/protos/management_pb2.py 3.33% 29 Missing ⚠️
cashu/mint/ledger.py 72.50% 22 Missing ⚠️
cashu/mint/router.py 37.50% 10 Missing ⚠️
cashu/mint/db/write.py 88.37% 5 Missing ⚠️
cashu/core/errors.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #958      +/-   ##
==========================================
- Coverage   75.36%   75.03%   -0.34%     
==========================================
  Files         110      111       +1     
  Lines       11814    12239     +425     
==========================================
+ Hits         8904     9183     +279     
- Misses       2910     3056     +146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@a1denvalu3
Copy link
Copy Markdown
Collaborator Author

Note: This PR currently implements only the mint (server) side changes for NUT-29. Wallet support for batch minting will be added in a future update.

@a1denvalu3 a1denvalu3 force-pushed the feature/nut-29-batch-minting branch from bad20fe to 76d8c0c Compare March 30, 2026 13:34
@a1denvalu3 a1denvalu3 marked this pull request as draft April 2, 2026 16:54
@a1denvalu3 a1denvalu3 force-pushed the feature/nut-29-batch-minting branch from 50cd861 to 90dc4e4 Compare April 7, 2026 08:56
@a1denvalu3 a1denvalu3 marked this pull request as ready for review April 14, 2026 11:13
@a1denvalu3 a1denvalu3 force-pushed the feature/nut-29-batch-minting branch from c2c55a2 to 30dc10c Compare May 2, 2026 12:05
a1denvalu3 added 20 commits May 18, 2026 16:02
…rtion to handle CI fake wallet auto-settling races
@a1denvalu3 a1denvalu3 force-pushed the feature/nut-29-batch-minting branch from c252965 to 4821604 Compare May 18, 2026 16:49
@callebtc callebtc force-pushed the feature/nut-29-batch-minting branch from b93ffbc to de3479b Compare May 20, 2026 22:43
@callebtc callebtc merged commit c913bab into main May 22, 2026
28 of 30 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in nutshell May 22, 2026
@callebtc callebtc deleted the feature/nut-29-batch-minting branch May 22, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants