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

Get rid of user keys in MintDemo #156

Closed
garious opened this issue Apr 27, 2018 · 3 comments
Closed

Get rid of user keys in MintDemo #156

garious opened this issue Apr 27, 2018 · 3 comments
Labels
good first issue Good for newcomers

Comments

@garious
Copy link
Contributor

garious commented Apr 27, 2018

Instead of storing those million keys in the JSON file, add a way to deterministically generate the from the Mint's seed key.

@garious garious added the good first issue Good for newcomers label Apr 27, 2018
@rlkelly
Copy link
Contributor

rlkelly commented May 2, 2018

I'm thinking something like this would make sense:

struct PrivateKeyGenerator {
    curr: Vec<i32>,
    next: Vec<i32>,
}

impl Iterator for PrivateKeyGenerator {
    type Item = Vec<i32>;

    fn next(&mut self) -> Option<Vec<u32>> {
        let seed: &[_] = &[1, 2, 3, 4]; // maybe this is input or uses a default
        let mut rng: StdRng = SeedableRng::from_seed(seed);
        // then generate wallet
    }
}

What do you think?

@garious
Copy link
Contributor Author

garious commented May 2, 2018

It'll be something like that. Just need to print that output locally and verify the keys are the same across runs.

@garious
Copy link
Contributor Author

garious commented May 3, 2018

I think I'd skip the iterator part though. That's a clever solution though - just the sort of hack we need. A shame the ring library doesn't support something similar.

vkomenda pushed a commit to vkomenda/solana that referenced this issue Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants