From acb799f34f2d576b39203012d0c603ffaf31a232 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Nov 2020 17:42:35 +0100 Subject: new, simplified backup proposal --- design-documents/009-backup.rst | 105 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 design-documents/009-backup.rst (limited to 'design-documents/009-backup.rst') diff --git a/design-documents/009-backup.rst b/design-documents/009-backup.rst new file mode 100644 index 00000000..7ec8be2c --- /dev/null +++ b/design-documents/009-backup.rst @@ -0,0 +1,105 @@ +Design Doc 009: Wallet Backup +############################# + +Summary +======= + +This document describes the backup system used by Taler wallets. +This is the second, simplified iteration of the proposal, which leaves +out multi-device synchronization. + + +Requirements +============ + +* Backup must work both with and without Anastasis + + * When not using Anastasis, the user is responsible for keeping + their wallet's root secret safe. + +* Arbitrary number of backup providers must be supported +* Minimize information leaks / timing side channels **if** requested by the user +* Minimize potential to lose money or important information +* Since real-time sync is not supported yet, wallets should have a feature + where their whole content is "emptied" to another wallet, and the wallet is + reset. +* Even without real-time sync, the backup data must support merging with old, existing wallet + state, as the device that the wallet runs on may be restored from backup or be offline + for a long time. + + +Solution Overview +================= + +Each wallet has a 64 byte wallet root secret, which is used to derive all other secrets +used during backup, which are currently: + +1. The sync account key for a sync provider, derived via the sync provider's base URL. +2. The symmetric key used to encrypt the backup blob + +If the user chooses to use Anastasis, the following information is backed up in Anastasis: + +* list of used backup providers +* wallet root secret + + +Supported Operations +-------------------- + +* **restore-from-anastasis**: Start Anastasis recovery process. This requires + the wallet backup state to be "uninitialized". +* **restore-from-recovery-secret**: This requires the wallet backup state to be uninitialized. +* **add-provider** / **remove-provider**: Add/remove a sync provider from the + list of providers. Adding a provider will cause payment(s) to the provider + to be scheduled according to the provider's terms. If the wallet backup + state is "uninitialized", adding a provider will set the backup state to + "initialized" with a fresh wallet root key. Changing the provider list will + also update the backup provider URL list in the anastasis core secret. +* **abandon** / **takeover**: When the user wants to stop using a wallet on a particular + device, another wallet can "take over" by reading the recovery secret of the abandoned wallet. + The abandoned wallet marks explicitly in its backup blob that it is abandoned. + Abandoning a wallet will set the backup state to "uninitialized". +* **backup**: Do a backup cycle. + + +Backup Format +------------- + +TBD. Considerations from :doc:`005-wallet-backup-sync` still apply, +especially regarding the CRDT. + + +Initial User Experience +----------------------- + +The user will be asked to set up backup&sync (by selecting a provider) +after the first withdrawal operation has been confirmed. After selecting +the backup&sync providers, the user will be presented with a "checklist" that +contains an option to (1) show/print the recovery secret and (2) set up Anastasis. + +The wallet will initially only withdraw enough money to pay the +backup&sync/anastasis providers. Only after successful backup of the wallet's +signed planchets, the full withdrawal will be completed. + + +Open Questions +============== + +* Should the wallet root secret and wallet database be locally encrypted + and protected via a passphrase? +* What happens if the same Anastasis user has multiple wallets? Can Anastasis somehow + support multiple "instances" per application? + +Future Work +=========== + +* Incremental backups? + + * Instead of one big blob that always needs to be read/written, we could have (1) a + limited length append-only journal and (2) a merkle tree so that the backup blob can + be updated incrementally once the journal is full. + * Leaks more information and is more complex. + +* Real-time synchronization, either over some signaling server + or P2P connectivity (WebRTC, etc.) + -- cgit v1.2.3 From d5b6f10842f2b378d5e5a7ee65801af8ef794e36 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Nov 2020 17:46:14 +0100 Subject: clarify --- design-documents/009-backup.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'design-documents/009-backup.rst') diff --git a/design-documents/009-backup.rst b/design-documents/009-backup.rst index 7ec8be2c..80393f54 100644 --- a/design-documents/009-backup.rst +++ b/design-documents/009-backup.rst @@ -18,7 +18,9 @@ Requirements their wallet's root secret safe. * Arbitrary number of backup providers must be supported -* Minimize information leaks / timing side channels **if** requested by the user +* Minimize information leaks / timing side channels (user might be able to change + some setting to allow more frequent backup with less potential data loss but more + leakage) * Minimize potential to lose money or important information * Since real-time sync is not supported yet, wallets should have a feature where their whole content is "emptied" to another wallet, and the wallet is -- cgit v1.2.3 From 12a3571f5de4b3751973b3f50d149edb938a7018 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Nov 2020 18:15:12 +0100 Subject: some ideas --- design-documents/009-backup.rst | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'design-documents/009-backup.rst') diff --git a/design-documents/009-backup.rst b/design-documents/009-backup.rst index 80393f54..1b4895ee 100644 --- a/design-documents/009-backup.rst +++ b/design-documents/009-backup.rst @@ -62,6 +62,9 @@ Supported Operations The abandoned wallet marks explicitly in its backup blob that it is abandoned. Abandoning a wallet will set the backup state to "uninitialized". * **backup**: Do a backup cycle. +* **rekey**: Change to a new wallet root secret, in case the old one has been + compromised. Only protectes future funds of the wallet from being + compromised. Requires a new payment to all configured backup providers. Backup Format @@ -92,8 +95,8 @@ Open Questions * What happens if the same Anastasis user has multiple wallets? Can Anastasis somehow support multiple "instances" per application? -Future Work -=========== +Future Work / Ideas +=================== * Incremental backups? @@ -102,6 +105,14 @@ Future Work be updated incrementally once the journal is full. * Leaks more information and is more complex. -* Real-time synchronization, either over some signaling server +* Mult-device synchronization, with synchronous communication either over some signaling server or P2P connectivity (WebRTC, etc.) + * Destroys the "wallet" metaphor, now the wallet is more like an account. + * We should first agree on the requirements from the perspective of end users + * P2P payments in Taler might also make sync less important + * Maybe only parts of the state (purchases / contracts, but not coins) should be synchronized? + * WhatsApp web model: The wallet runs only on one devices, but other devices + can connect to it as clients. (Allows my browser wallet to temporarily access + money from my phone wallet and vice versa.) + -- cgit v1.2.3