Open lollerfirst opened 3 days ago
Awesome work and thank you for the implementations. I wonder whether we want to add this to the existing NUTs or formulate it as a separate NUT.
In both cases, I think it would be better to formulate this as an optional feature. Right now it is formulated as a MUST.
One argument for putting this in its own NUT would be that we would have to add a note about caching into every method that we add (like bolt12) whereas it could be formulated more generally as "any endpoint that produces outputs" and we could reference the specific NUTs for mint/melt/swap (and further future methods).
This NUT should also defined a setting flag for each cached endpoint that we announce in the mint info (together with a TTL)
There are two unrelated files in the PR.
Questions in my mind:
Cache every successful
PostMintResponse
,PostMeltResponse
andPostSwapResponse
using the respective requests as keys. In case of a network error, clients can replay the same exact requests receive the same responses. This safe-guards against clients accidentally losing money because of connectivity issues.Implementations: