Skip to content

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

Open
a1denvalu3 wants to merge 11 commits intomainfrom
feature/nut-29-batch-minting
Open

feat(mint): implement NUT-29 batched minting#958
a1denvalu3 wants to merge 11 commits intomainfrom
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 75.17730% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.93%. Comparing base (a1ff72c) to head (50cd861).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cashu/mint/ledger.py 73.23% 19 Missing ⚠️
cashu/mint/router.py 37.50% 10 Missing ⚠️
cashu/mint/db/write.py 85.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #958      +/-   ##
==========================================
+ Coverage   74.90%   74.93%   +0.02%     
==========================================
  Files          99       99              
  Lines       11685    11826     +141     
==========================================
+ Hits         8753     8862     +109     
- Misses       2932     2964      +32     

☔ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant