Implement customization in the android storage adaptor so that private keys are stored in hardware-encrypted secure storage
Note that, we still have not optimized storage for Android or for using sqlite. We should do this, but will take some more thought around
- How to best implement sqlite in the web wallet
- How to minimize storage and maximize usefulness
- How ecash-wallet will be implemented into Cashtab / initialized from storage
So, we will inevitably have some migrations later. This approach does though silo private keys in special storage.
An alt option would be to encrypt the whole sqlite database. But this would make Cashtab more battery intensive and slow down read-write operations. It's also silly to encrypt the sqlite database which is storing, mostly, cached info that is already public on the blockchain.
This implementation is arguably overkill. Just keeping everything in sqlite is ... pretty secure. To the point where the phone probably has to be rooted to get the private key. It's unclear how much "more secure" keeping the private keys in hardware-encrypted storage actually is. Google / Grok basic consensus seems to be that it is better, though difficult to measure.
Ultimately the "secure" solution is a hardware wallet. The primary benefit of the android app is better control over storage, i.e. less likely to have an android app phantom delete storage vs a webapp.