From a4c02d1ab29432f73e8984b12ee28a6d8079e8e2 Mon Sep 17 00:00:00 2001 From: pablof7z Date: Sat, 28 Sep 2024 18:40:15 -0500 Subject: [PATCH] add note about using a short-lived event to keep track of minting quote IDs --- 60.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/60.md b/60.md index 1517f7c..c1475f5 100644 --- a/60.md +++ b/60.md @@ -184,5 +184,22 @@ Her client: } ``` +## Redeeming a quote (optional) +When creating a quote at a mint, an event can be used to keep the state of the quote ID, which will be used to check when the quote has been paid. These events should be created with an expiration tag [[NIP-40]] matching the expiration of the bolt11 received from the mint; this signals to relays when they can safely discard these events. + +Application developers are encouraged to use local state when possible and only publish this event when it makes sense in the context of their application. + +```jsonc +{ + "kind": 7374, + "content": nip44_encrypt("quote-id"), + "tags": [ + [ "expiration", "" ], + [ "mint", "" ], + [ "a", "37375::my-wallet" ] + ] +} +``` + ## Appendix 1: Validating proofs Clients can optionally validate proofs to make sure they are not working from an old state; this logic is left up to particular implementations to decide when and why to do it, but if some proofs are checked and deemed to have been spent, the client should delete the token and roll over any unspent proof.