feat(nut-18, nut-26): add preferred_mints to payment requests #355
No reviewers
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts!355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "preferred-mints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
preferred_mintsfield (pmin JSON,0x09in TLV) to payment requests in NUT-18 and NUT-26.@ -36,7 +38,9 @@ Here, the fields are- `a`: The amount of the requested paymentShould we be more clear on when to use mints vs preferred mints. If mints is defined then only tokens from those mints will be accepted and receive wallets SHOULD not redeem proofs of a mint not in the list. While if preferred mints is defined any mints tokens will be accepted and they will be melted.
@ -36,7 +38,9 @@ Here, the fields are- `a`: The amount of the requested paymentI was just writing the same comment. it's not clear to me when to use
mvspmMaybe better to put the onus on the sender? And is it only a SHOULD, or should it be a MUST?
What happens if the sender sends proofs from a different mint?
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
pmarray ordered?NUT-18's
t(Transport) field is explicitly spec'd as "can be multiple, sorted by preference". The proposedpmsays "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:This gives the sender a deterministic selection heuristic when the wallet has balance at multiple mints in the list.
Orthogonal to the
mvspmclarification @thesimplekid and @robwoodgate are discussing above — happy to submit this as a small editorial follow-up PR if it's a useful direction.I have cherry-picked the commits from this PR into https://github.com/cashubtc/nuts/pull/381, which also adds an "extra fee" field for non preferred mint payments.
Closing for https://github.com/cashubtc/nuts/pull/381
Pull request closed