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

fix: use of branch seed in key manager #3751

Merged
merged 1 commit into from Jan 26, 2022

Conversation

Cifko
Copy link
Contributor

@Cifko Cifko commented Jan 26, 2022

Description

The branch seed was not used (even if it was mentioned in the comment).

Motivation and Context

Problem with doubling the tokens in collectibles because of the pub keys for asset and tokens were the same.

How Has This Been Tested?

Manually (fixed the double problem in collectibles)
Added new cargo test for the use of the branch seed.

@@ -77,7 +77,12 @@ where

/// Derive a new private key from master key: derived_key=SHA256(master_key||branch_seed||index)
pub fn derive_key(&self, key_index: u64) -> Result<DerivedKey<K>, ByteArrayError> {
let concatenated = format!("{}{}", self.seed.entropy().to_vec().to_hex(), key_index);
Copy link
Contributor

Choose a reason for hiding this comment

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

@philipr-za does this indicate the current wallets are all deriving on the same branch??

Copy link
Contributor

Choose a reason for hiding this comment

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

Ja it would! This is a good catch.

Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

LGTM nice catch

@aviator-app aviator-app bot merged commit ec92919 into tari-project:development Jan 26, 2022
@Cifko Cifko deleted the fix-key-manager branch June 23, 2022 20:04
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.

None yet

3 participants