ACINQ / phoenix

Phoenix is a self-custodial Bitcoin wallet using Lightning to send/receive payments.
https://phoenix.acinq.co
Apache License 2.0
654 stars 97 forks source link

(android) Backup channels and payments db #561

Open dpad85 opened 4 months ago

dpad85 commented 4 months ago

This PR adds a local, on-device backup mechanism for the payments and channels database, for Android. It will allow users to restore their payments history after uninstalling or resetting the wallet.

The channels and payments database are zipped and encrypted on disk in public folder. This backup file will not be erased when the app is uninstalled, and can thus can be restored manually when the user imports their wallet again in the future. It does not require new permissions, since we are using the Mediastore API to write the file, and importing the backup file is done manually by the user, using the Android file browsing framework.

This encrypted file can also be backed up using the auto Google Drive backup system, if available and enabled, which would avoid having to manually restore the local backup file.

This PR and description is a WIP.