cashubtc / nuts

Cashu protocol specifications https://cashubtc.github.io/nuts/
MIT License
143 stars 49 forks source link

Add input_fee_ppk to /keys #150

Closed minibits-cash closed 2 months ago

minibits-cash commented 2 months ago

New fee definition is added to /keysets as input_fee_ppk property. I suggest to add it to /keys response as well. Reason is, that currently only /keys API is sufficient to be called when making new wallet instance. Now, when fees are introduced, two similar APIs needs to be called.

thesimplekid commented 2 months ago

I think this is a bit of an edge case that only applies to the very first initialization of the wallet. Wallets should fetch the /keysets and then fetch /keys only for the keysets it has not seen before. While its true if the wallet has never been created before and has no keys it will need to fetch all keys, its simpler to follow the one flow of checking /keysets for new keysets, state changes and fee_changes and then fetching keys for unknown keys

minibits-cash commented 2 months ago

Thanks for explanation, seems logical. It is likely then some work to be done in cashu-ts.