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

zcash_client_sqlite: Enable "downgrade to view-only" when a migration is performed without a required seed #1284

Open
str4d opened this issue Mar 18, 2024 · 0 comments

Comments

@str4d
Copy link
Contributor

str4d commented Mar 18, 2024

Some migrations require a seed phrase. Currently we have two:

  • UFVK support: seed required to derive the Orchard FVK component for each (derived) account.
  • Account ID changes: seed required to derive the seed fingerprint to store with each derived account.

As discussed in #1283, there are cases where a caller wants to query a wallet DB without necessarily having any of the necessary seeds. We should therefore have an opt-in way to migrate a database without any of the relevant seeds, which "downgrades" all accounts to "read-only" (i.e. from Derived to Imported).

  • In a pairing with @nuttycom, we considered this transition in terms of allowing hd_seed_fingerprint to be null while hd_account_index was non-null. That would be sufficient if we were modifying the latest migration making the account ID changes (as part of Zashi 1.0), but in the general migration case we'd either need to have some other way to track this, or do something like delete the seed fingerprint from the database. For zcash_client_sqlite: Integrate "is relevant seed" logic into database migration #1283 (and therefore Zashi 1.0) we are avoiding this complexity.

We would also want to pair this with some new method like WalletWrite::link_seed(Self::AccountId, seed, zip32::AccountId) that enables "upgrading" a UFVK account from Imported to Derived (enabing spends from them again).

  • We cannot upgrade accounts imported from UIVKs, as we have not performed the necessary historic scanning, and can't do that scanning in-line within a WalletWrite call. The caller would need to delete the UIVK account and then separately add the derived account with its UFVK.
@daira daira added this to the SDK 2.x Post-Release Cleanup milestone Mar 26, 2024
@nuttycom nuttycom changed the title zcash_client_sqlite: Enable migrations to be performed without any seed zcash_client_sqlite: Enable "downgrade to view-only" when a migration is performed without a required seed Feb 4, 2025
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

3 participants