Skip to content

Payment request consolidation (and extra fees for non-preferred mints)#381

Open
robwoodgate wants to merge 17 commits into
cashubtc:mainfrom
robwoodgate:payment-request-consolidation
Open

Payment request consolidation (and extra fees for non-preferred mints)#381
robwoodgate wants to merge 17 commits into
cashubtc:mainfrom
robwoodgate:payment-request-consolidation

Conversation

@robwoodgate

@robwoodgate robwoodgate commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Consolidates and Supersedes: #355, #380

Summary

Consolidates the two open NUT-18 payment request proposals around mint preferences, strict mint lists, fee reserve signalling, and required mint payment methods.

This PR keeps the existing m mint list as the single mint-list field, and adds small companion fields to clarify how that list should be interpreted.

Changes

  • Retains sm (supported_methods) to require that the mint used by the payer supports at least one listed payment method, e.g. bolt11, bolt12, onchain from feat(nut-18, nut-26): add preferred_mints to payment requests #355
  • Adds mp (mint_preferred) to signal whether the m mint list is strict or preferred (this is a flip from ms in feat: preferred mints #380):
    • absent / false: receiver only accepts proofs from listed mints
    • true: listed mints are preferred, but other mints may be accepted
  • Adds fr (fee_reserve) to signal an additional amount the payer MUST include when paying from a non-preferred mint, to cover potential swap/melt fees
  • Updates NUT-26 TLV tags for the new fields
  • Adds test vectors covering the combined behaviour

Rationale

There were overlapping proposals for preferred mints and strict mint lists. Instead of introducing a separate preferred mint list, this keeps the request format minimal:

  • m remains the mint list
  • mp defines whether that list is strict or advisory
  • fr gives wallets a way to compensate for extra fees when ignoring the preference
  • sm lets receivers express the mint capabilities required for the payment flow

This avoids two competing mint-list fields while covering the three desired behaviours.

@robwoodgate robwoodgate changed the title Payment request consolidation Payment request consolidation (and add extr fees for non-preferred mints) May 27, 2026
@robwoodgate robwoodgate changed the title Payment request consolidation (and add extr fees for non-preferred mints) Payment request consolidation (and add extra fees for non-preferred mints) May 27, 2026
@robwoodgate robwoodgate changed the title Payment request consolidation (and add extra fees for non-preferred mints) Payment request consolidation (and extra fees for non-preferred mints) May 27, 2026
robwoodgate added a commit to d4rp4t/cashu-ts that referenced this pull request May 28, 2026
Spec moved from cashubtc/nuts#380 to cashubtc/nuts#381, adding fee_reserve (fr)
and supported_methods (sm) alongside the existing mint-strict flag. Adds an
isMintListStrict resolver for the spec default-to-true semantic.
@robwoodgate

robwoodgate commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

@callebtc , @thesimplekid - we have three implementations, can we consider final review / merge please.

cc @ye0man

@KvngMikey

Copy link
Copy Markdown
Contributor

4 implementations:
cashubtc/nutshell#1059

robwoodgate added a commit to d4rp4t/cashu-ts that referenced this pull request Jun 25, 2026
Spec moved from cashubtc/nuts#380 to cashubtc/nuts#381, adding fee_reserve (fr)
and supported_methods (sm) alongside the existing mint-strict flag. Adds an
isMintListStrict resolver for the spec default-to-true semantic.
@robwoodgate

robwoodgate commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

The only thing I still don't love about this is the mint_strict boolean being true if omitted.

It opens up all kinds of edge case issues as undefined is true but other falsey values are false.

I'd rather default to false on omitted, or if strict is the desirable default, flip the boolean semantic to mint_prefer, where true means the list of mints is a preference and false or omitted means it is strict

What are the thoughts on this?

Comment thread 18.md Outdated
Co-authored-by: tsk <tsk@thesimplekid.com>
@thesimplekid

Copy link
Copy Markdown
Collaborator

The only thing I still don't love about this is the mint_strict boolean being true if omitted.

It opens up all kinds of edge case issues as undefined is true but other falsey values are false.

I'd rather default to false on omitted, or if strict is the desirable default, flip the boolean semantic to mint_prefer, where true means the list of mints is a preference and false or omitted means it is strict

What are the thoughts on this?

I agree, I think default true is an anti pattern and we should avoid it.

@robwoodgate

Copy link
Copy Markdown
Collaborator Author

I agree, I think default true is an anti pattern and we should avoid it.

Agreed. Would you prefer to keep mint_strict and make the default false, or flip the boolean semantics to mint_prefer / mint_suggest or similar?

@thesimplekid

Copy link
Copy Markdown
Collaborator

I agree, I think default true is an anti pattern and we should avoid it.

Agreed. Would you prefer to keep mint_strict and make the default false, or flip the boolean semantics to mint_prefer / mint_suggest or similar?

I would flip the semantics. mint_preferred / mp: absent or false means the existing strict m behavior, true means the m list is advisory/preferred.

@robwoodgate

Copy link
Copy Markdown
Collaborator Author

I would flip the semantics. mint_preferred / mp: absent or false means the existing strict m behavior, true means the m list is advisory/preferred.

yeah, that's my leaning too. @d4rp4t @a1denvalu3, do you agree?

@KvngMikey

Copy link
Copy Markdown
Contributor

I would flip the semantics. mint_preferred / mp: absent or false means the existing strict m behavior, true means the m list is advisory/preferred.

i agree with this ...

@robwoodgate

Copy link
Copy Markdown
Collaborator Author

ms (mint_strict) now replaced with mp (mint_preferred).

This gives the same semantic, but flipped so an omitted value means false (strict).

@robwoodgate robwoodgate requested a review from thesimplekid June 26, 2026 22:12
@robwoodgate

Copy link
Copy Markdown
Collaborator Author

Cashu-TS updated to use new mp semantic (replacing ms)

@thesimplekid

Copy link
Copy Markdown
Collaborator

cdk updated cashubtc/cdk@7009b0d

@KvngMikey

Copy link
Copy Markdown
Contributor

Nutshell updated cashubtc/nutshell@11612fe

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.

5 participants