feat: add mints_strict field to payment requests#2007
Conversation
085b13c to
da6ce50
Compare
|
Added changes so it matches: cashubtc/nuts#381 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da6ce50884
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The nut has been updated: |
da6ce50 to
3ad8355
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ad8355fec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2007 +/- ##
==========================================
- Coverage 73.11% 73.11% -0.01%
==========================================
Files 359 359
Lines 79639 80161 +522
==========================================
+ Hits 58232 58609 +377
- Misses 21407 21552 +145 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add the strict mint flag, fee reserve, and supported payment methods to the NUT-18 payment request model and builder. Encode the new fields in NUT-26 TLV records and expose them through the wallet defaults, FFI wrapper, fuzz generator, and encoding benchmark.
Use the updated mp field and preferred-polarity naming for NUT-18 payment requests. Enforce strict mint lists, add fee reserve when using unlisted preferred mints, and document the field semantics.
3ad8355 to
b5a5eb4
Compare
|
@cdk-bot review |
Replace the flat fee reserve with `sm` method objects carrying optional `mf` values, and encode them as NUT-26 supported-method sub-TLVs on tag 0x0a. Apply method fees when paying from an unlisted mint, or from any mint when the request has no mint list. Select the lowest fee among matching NUT-05 melt methods and keep requested amounts net of input fees. Cover the current NUT-18 and NUT-26 spec vectors, including the preferred-method-fee cases. Accept the standard-base64 NUT-18 vectors published by the spec while continuing to emit urlsafe CREQ-A strings.
b5a5eb4 to
ee3e33d
Compare
Description
Adds mints_strict (ms) field to PaymentRequest as specified in NUT-18 and NUT-26 PR: cashubtc/nuts#381
When ms is absent or true (default), the recipient MUST reject payments from mints not in the mint list. When ms is false, the mint list is a suggestion for the payer.
NUT-26 (bech32m) encoding adds TLV tag 0x09 for this field.
Notes to the reviewers
The field is serialized with skip_serializing_if = "Option::is_none" so existing encoded payment requests remain valid — absence of the tag is equivalent to true (strict mode), consistent with the proposed spec default.
Suggested CHANGELOG Updates
CHANGED
ADDED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)