Align NUT-04 mint quote accounting with amount_paid / amount_issued #377
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!377
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Egge21M/generic-paid-issued"
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?
This updates NUT-04 to make amount_paid and amount_issued the
canonical way to track mint quote accounting, matching the reusable
quote model already used by NUT-25 and NUT-30.
The deprecated state field is kept as an optional compatibility
field for single-use quotes, with derivation rules documented from
amount_paid and amount_issued. This also adds updated_at to mint
quote responses so clients can avoid applying stale quote updates.
Changes:
NUT-04 mint quote responses
to match
In offline discussion, it was proposed to add a
versionparam to mint quotes.This would allow us to make the changes (eg remove
state, evolve NUT-20 signing) cleanly, as wallets can adjust their handling appropriately to the version.I'd recommend we start at
version: 02, so that any quote with unspecifiedversionparam is treated as an impleictversion: 01quote withstateparam.The
updated_atparam is a good idea, both for monotonic state tracking as noted, as well as being potentially useful for tracking stalled or failed payments.Agreed.
ACK
Chatted with some folks offline. They raised the point that the combination of
amount_issuedandamount_paidis already enough to allow monotonic state updates (e.g.new_amount_issued + new_amount_paid > old_amount_issued + old_amount_paid). However this is less explicit and mints should not have any issue addingupdated_at.Should I kick it, or keep it?
I think it has utility - whilst the combination does tell you if the state has changed, it doesn't tell you WHEN.
So unless payload size is a concern, it might be more useful than not, esp for consumer apps.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.