13.71. DD 71: Auto-refresh#
13.71.1. Summary#
This document describes when the wallet should automatically refresh non-dirty coins.
13.71.2. Motivation#
The wallet must refresh non-dirty coins before they expire, least the user looses the money. However, this should not be done too early to avoid refresh fees and/or excessive load on the exchange. On the other hand, we need to be careful to not hold off for too long and risk the wallet not going online before the expiration time.
We note that there obviously is no perfect solution, as at least in principle the user could always not restart the wallet until the expiration time.
13.71.3. Requirements#
Do not loose funds under most conditions
Do not cause clearly avoidable refresh operations
Try to educate the user if they are about to get into trouble
Independently of any specific approach, the wallet MUST spend those coins first that are earliest to their expiration time within their equivalence class as that is always the best way to avoid expiration.
While lifetimes of denominations are often identical, that may not always be the case. Theoretically, an exchange could significantly increase or decrease the deposit period at any time. The solution should take this into consideration.
13.71.4. Proposed Solution#
For each denomination, consider if a refresh would lengthen the expiration date by more than a factor of four (4x), that is if the deposit expiration time of the denomination(s) we could currently withdraw is more than 4x as long as what remains for the denomination. If so, refresh all coins of that denomination.
..note:
This basically suggests that a refresh would have a significant positive **impact**.
For each denomination, consider if the remaining deposit period is less than 6 months, if the refresh fee would be zero, and if after refreshing the deposit expiration time would exceed 12 months, and if we are not on battery power. If so, refresh all coins of that denomination.
..note:
This is again a significant impact, and it is basically gratis for the user.
For each denomination, consider if the remaining deposit period is less than 3 months, and if after refreshing the deposit expiration time would be larger. If so, refresh all coins of that denomination. If afterwards the expiration time exceeds 12 months, show the user a warning:
- “This wallet was offline for too long. Make sure to
start it at least every 3 months to avoid the risk of loosing funds to expiration.”
..note:
This is basically a last-minute effort (unless we have an exchange with extremely short expiration periods). We do not like getting into this situation, so it is time to educate the user.
Explicitly show a warning in the balances list of the respective currency if the remaining deposit period for any coin drops below 90 days. Distinguish in the warning key causes: 1) “We are offline and cannot expand the validity period.” 2) “The payment service provider does not offer longer
validity periods.”
..note:
This should prevent us from getting into trouble if e-cash is lost anyway.
13.71.5. Definition of Done#
Implemented in wallet-core
Changes to interactions for signalling warnings to GUIs
dev-experiments exist to trigger special alerts to users
GUIs have been designed and tested
13.71.6. Alternatives#
The wallet currently implements simple rules for auto-refresh:
After 75% of a denomination’s “deposit lifespan” has passed, we do “auto-refresh check” for all coins of the exchange
During this auto-refresh check, all coins that are >50% into their deposit lifespan are auto-refreshed.
This is risky as it does not consider absolute lifespans or user behavior.
13.71.7. Drawbacks#
This approach does not (yet) consider user behavior. We could theoretically learn from that.
13.71.8. Discussion / Q&A#
(This should be filled in with results from discussions on mailing lists / personal communication.)