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

Dependency updates #54

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Dependency updates #54

merged 2 commits into from
Dec 10, 2024

Conversation

str4d
Copy link
Collaborator

@str4d str4d commented Dec 8, 2024

No description provided.

#[options(free, required, help = "the ID of the account to list addresses for")]
account_id: u32,
#[options(free, required, help = "the UUID of the account to list addresses for")]
account_id: Uuid,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering changing this to an account flag that can be either an AccountUuid or a name, but the latter I don't think has any uniqueness constraints (and can also be null).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the name is really needed for zec_sqlite_cli and starting next week we should shift our focus to zallet as much as possible anyway.

help = "the purpose of the viewing key (default is \"viewing\")",
parse(try_from_str = "Purpose::parse")
)]
purpose: Purpose,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the spending purpose holds a key derivation, I've changed the FVK import pathways to be view-only. We need to do that init refactor to provide a better way to prepare accounts.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine for init_fvk, because init will subsume this command, but import_ufvk should be able to import a AccountPurpose::Spending key; after all, the "standard" workflow for Zashi is to initialize with a seed, but then import the UFVK from the hardware wallet with derivation & key source information.

Along those lines, I think that we should specify ZIP 316 metadata for seed fingerprint and hd account index data.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK. The clippy lint about AccountBalance::unshielded being deprecated is due to zcash/librustzcash#1570.

Copy link
Collaborator

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UFVK import should support AccountPurpose::Spending; otherwise this all looks reasonable modulo some questions about how reset should behave.

Comment on lines 28 to 30
#[options(help = "can the wallet omit information needed to spend funds (default is false)")]
view_only: bool,

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be retained, and in addition we should have optional seed_fingerprint and hd_account_index parameters, so that AccountPurpose::Spending can be represented. Also, we should have the key_source information for parity with the normal init command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add key_source to the normal init command; I was asking you what to do with it. Given that you want parity, I'm omitting it for now, and you can make a PR later to do what you want with it.

help = "the purpose of the viewing key (default is \"viewing\")",
parse(try_from_str = "Purpose::parse")
)]
purpose: Purpose,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine for init_fvk, because init will subsume this command, but import_ufvk should be able to import a AccountPurpose::Spending key; after all, the "standard" workflow for Zashi is to initialize with a seed, but then import the UFVK from the hardware wallet with derivation & key source information.

Along those lines, I think that we should specify ZIP 316 metadata for seed fingerprint and hd account index data.

#[options(free, required, help = "the ID of the account to list addresses for")]
account_id: u32,
#[options(free, required, help = "the UUID of the account to list addresses for")]
account_id: Uuid,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the name is really needed for zec_sqlite_cli and starting next week we should shift our focus to zallet as much as possible anyway.

@@ -15,9 +19,6 @@ pub(crate) struct Command {
#[options(help = "age identity file to decrypt the mnemonic phrase with")]
identity: String,

#[options(help = "the number of accounts to re-initialise the wallet with (default is 1)")]
accounts: Option<usize>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I never liked the "initialize multiple accounts at once" functionality. However for reset, what are the semantics? I thought that the idea was to essentially drop all transaction data, but retain key information. If multiple accounts have been derived and/or imported, shouldn't they be retained? Or should there be two modes: one which wipes everything and starts again from the seed, and another that wipes everything except the accounts table?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I literally do not have time to do anything more than what I've done here. If you want multi-seed support retained across reset, open an issue.


let account_id = *db_data
.get_account_ids()?
.first()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer to my question above will govern whether this first makes sense.

@str4d str4d dismissed nuttycom’s stale review December 10, 2024 11:12

Added account purpose configuration back in for viewing keys

@str4d str4d merged commit 4723623 into main Dec 10, 2024
17 checks passed
@str4d str4d deleted the dep-updates branch December 10, 2024 11:53
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

Successfully merging this pull request may close these issues.

3 participants