Skip to content

Conversation

ch4r10t33r
Copy link
Contributor

@ch4r10t33r ch4r10t33r commented Aug 31, 2025

What was wrong?

To-Do

@ch4r10t33r ch4r10t33r self-assigned this Aug 31, 2025
@ch4r10t33r ch4r10t33r requested a review from KolbyML as a code owner August 31, 2025 21:45
@ch4r10t33r ch4r10t33r marked this pull request as draft August 31, 2025 21:46
@ch4r10t33r ch4r10t33r changed the title Account manager feat: account_manager changes for post quantum crypto Aug 31, 2025
@ch4r10t33r ch4r10t33r marked this pull request as ready for review September 2, 2025 14:49
@ch4r10t33r ch4r10t33r requested a review from syjn99 September 2, 2025 14:49
Copy link
Member

@syjn99 syjn99 left a comment

Choose a reason for hiding this comment

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

Most of the comments are about cosmetics for codebase consistency (like inlining variable in the logs...), and left some questions that comes into my mind while reading your code. Great job!

Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

Here is some feedback

@syjn99
Copy link
Member

syjn99 commented Sep 3, 2025

@ch4r10t33r
Based on the last interop call, I guess MessageType is too overkill in this phase. Key management simplification can be discussed more, and it seems adding one of the method preemptively might make more code changes in the future.

@ch4r10t33r
Copy link
Contributor Author

@ch4r10t33r Based on the last interop call, I guess MessageType is too overkill in this phase. Key management simplification can be discussed more, and it seems adding one of the method preemptively might make more code changes in the future.

It may seem like overkill at the moment, but this is the direction we’re heading. We should keep the code we’ve already built instead of removing it now and having to add it back later.

@syjn99
Copy link
Member

syjn99 commented Sep 17, 2025

@ch4r10t33r Not all comments are resolved, please take a look.

@ch4r10t33r
Copy link
Contributor Author

@ch4r10t33r Not all comments are resolved, please take a look.

My apologies, the comments didnt show up at my end. I have now addressed them all.

Copy link
Member

@syjn99 syjn99 left a comment

Choose a reason for hiding this comment

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

Spotted some suspicious things with several issues (dependency, code formatting...)

Also there are some comments that are not resolved but marked as resolved. Please check those again.

Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

Left some feedback

@ch4r10t33r ch4r10t33r requested a review from KolbyML September 17, 2025 23:02
Copy link
Member

@syjn99 syjn99 left a comment

Choose a reason for hiding this comment

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

Also could you please change the PR title? account_manager changes are quite vague

@ch4r10t33r ch4r10t33r changed the title feat: account_manager changes for post quantum crypto feat: key generation utility for ream Sep 19, 2025
@ch4r10t33r
Copy link
Contributor Author

Also could you please change the PR title? account_manager changes are quite vague

Updated.

@ch4r10t33r ch4r10t33r requested a review from syjn99 September 19, 2025 10:06
@ch4r10t33r ch4r10t33r changed the title feat: key generation utility for ream feat: Initial version of a key generation utility for ream Sep 19, 2025
Copy link
Member

@syjn99 syjn99 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

Here is some feedback

Comment on lines +16 to +19
wallet_index: u32,
activation_epoch: u32,
num_active_epochs: u32,
passphrase: &str,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function should be implemented on the PrivateKey struct, the PublicKey is a derivative of the PrivateKey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what you mean. Are you referring to the passphrase? That is used as a seed to generate the keypair.

Copy link
Contributor

Choose a reason for hiding this comment

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

pub fn generate_keys(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is already a generate function in the private key module:

The generate_keys function in the account manager is simply a wrapper around it, adding functionality such as determining the salt.

Copy link
Contributor

Choose a reason for hiding this comment

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

it is fine to add another, generate_keys is just floating around right now, well it is a constructor for an object

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure why this was marked as resolved, pub fn generate_key_pair_with_salt( should be a member of the PrivateKey struct
`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not clear on your point. I thought you wanted me to rename both functions.

The generate_key_pair_with_salt function belongs to the account_manager crate, as it’s a core feature of account_manager, not the private key. We’ll expand this functionality with alternative approaches. The private key remains unaffected by these changes and shouldn’t need updates whenever we adjust the strategy in account_manager.

Copy link
Member

Choose a reason for hiding this comment

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

Dropping my thoughts here:

How about adding a function

  pub fn derive_wallet_rng(
      seed_phrase: &str,
      wallet_index: u32,
      passphrase: &str,
  ) -> ChaCha20Rng

And use it like:

PrivateKey::generate(&mut derive_wallet_rng(...), ...)

?

So that we can remove generate_key* function name which derives some convo here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can rename the function. But my main point of contention is that the functionality should remain in account_manager rather than PrivateKey.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@KolbyML @syjn99 I will be raising a new PR in the next 2 days which requires additional changes and inclusion of new features related to keystore encryption etc. I can always handle these suggestions as part of that PR. Please can you approve this PR now?

@ch4r10t33r ch4r10t33r requested a review from KolbyML September 19, 2025 15:29
Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: PR looks great, good work 🥳

@KolbyML KolbyML disabled auto-merge September 19, 2025 17:26
@KolbyML KolbyML enabled auto-merge September 19, 2025 17:26
@KolbyML KolbyML added this pull request to the merge queue Sep 19, 2025
Merged via the queue into ReamLabs:master with commit e859478 Sep 19, 2025
14 checks passed
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