Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic backups #43

Open
r0wdy1 opened this issue Dec 30, 2022 · 1 comment
Open

Automatic backups #43

r0wdy1 opened this issue Dec 30, 2022 · 1 comment
Assignees

Comments

@r0wdy1
Copy link

r0wdy1 commented Dec 30, 2022

In order to allow our users to migrate seamlessly between devices w/o redundant sync we should introduce automatic opt-in backup service, that would encrypt and store client state backup in a cloud storage ( preferably a decentralized one)

Saving backups

  1. Client init method must accept a new optional parameter automaticBackup : bool
  2. If automaticBackup is set , than after every successful transaction or receiving a shielded note or every X indices a backup procedure must be called, which performs following steps:
    1. collects all of the known unspent notes, account , latest index to a single struct ( using Borsh)
    2. serializes, encrypts the data ( the same ChaChaPoly in AEAD mode) using eta
    3. calls proxy RPC to store the data with some retry policy. A hash of eta can be used as identifier

Sync from backup

Whenever a user logs in and client initializes, it should call the storage proxy service to check whether a backup for this user is available. If a backup is available and was successfully decrypted, then the client state is populated from decrypted response

Why proxy?

The proxy is needed to abstract storage integration logic away from client code. That would allow to migrate from eg S3 to IPFS or StorJ without any changes on the client side.

@r0wdy1 r0wdy1 self-assigned this Dec 30, 2022
@maikReal
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants