Skip to content

feat(nut-18, nut-26): add preferred_mints to payment requests#355

Open
a1denvalu3 wants to merge 7 commits into
cashubtc:mainfrom
a1denvalu3:preferred-mints
Open

feat(nut-18, nut-26): add preferred_mints to payment requests#355
a1denvalu3 wants to merge 7 commits into
cashubtc:mainfrom
a1denvalu3:preferred-mints

Conversation

@a1denvalu3
Copy link
Copy Markdown
Contributor

Summary

  • Introduces preferred_mints field (pm in JSON, 0x09 in TLV) to payment requests in NUT-18 and NUT-26.
  • This allows the originator of the request to specify mints they support.
  • Paying wallets can optionally use these preferred mints for faster and cheaper transactions without bridging through the lightning network.

Comment thread 18.md Outdated
Comment thread 18.md Outdated
Co-authored-by: Rob Woodgate <robwoodgate@users.noreply.github.com>
@realmeylisdev
Copy link
Copy Markdown

Hi — this is useful, thanks. Following my comment on #357 earlier today, I'm engaging from a wallet-implementer angle (Flutter bindings in cdk-flutter).

One small gap in the current text: is the pm array ordered?

NUT-18's t (Transport) field is explicitly spec'd as "can be multiple, sorted by preference". The proposed pm says "preferred mints the receiver supports" but doesn't state whether the array order conveys ranking. Since "preferred" implies a relative preference, senders will inevitably start treating the array as a priority list — and without a canonical answer in the spec, implementations will diverge (alphabetical, HashSet iteration order, insertion order, etc.).

Suggested small wording, modeled on t:

pm: A set of preferred mints the receiver supports, sorted by preference. If this field is defined, the receiver will accept proofs from any mint but prefers these mints for faster and cheaper transactions. …

This gives the sender a deterministic selection heuristic when the wallet has balance at multiple mints in the list.

Orthogonal to the m vs pm clarification @thesimplekid and @robwoodgate are discussing above — happy to submit this as a small editorial follow-up PR if it's a useful direction.

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.

4 participants