This Rust project allows you to generate Monero wallet addresses from 25-word seed phrases and private keys using
the curve25519-dalek
and base58-monero
libraries. It only supports both mainnet and stagenet Standard addresses
by specifying the network type.
- Generate a 25-word Monero seed phrase using cryptographically secure entropy.
- Convert a 25-word Monero seed phrase into private spend and view keys.
- Derive a Monero address from the seed phrase for both mainnet and stagenet.
- Use Ed25519 elliptic curve cryptography for key derivation.
- Supports different network prefixes for Monero mainnet and stagenet networks.
You can generate a new Monero address by either using random entropy to generate a seed or by providing an existing 25-word seed phrase.
To generate a new Monero address along with a 25-word seed phrase:
use monero_wallet_generator::{Seed, Network, MainNet};
fn main() {
let seed = Seed::generate().unwrap(); // Generate a new seed
let address = seed.get_address::<MainNet>().unwrap(); // Generate address for mainnet
let seed_words = seed.seed_words().unwrap(); // Get seed words
println!("Seed words: {}", seed_words.join(" "));
println!("Monero Address: {}", address);
}
You can derive a Monero address from an existing 25-word seed phrase:
use monero_wallet_generator::{Seed, MainNet};
fn main() {
let seed_words = "razor obnoxious entrance inroads saxophone among onward revamp scoop boxes point fawns rigid army badge icing frying voted biggest layout dehydrate acidic reinvest school inroads";
let seed = Seed::from_seed_words(seed_words).unwrap(); // Restore from seed words
let address = seed.get_address::<MainNet>().unwrap(); // Generate mainnet address
println!("Recovered Address: {}", address);
}
To generate or restore an address for stagenet instead of mainnet, you can specify the network type:
use monero_wallet_generator::{Seed, Stagenet};
fn main() {
let seed_words = "razor obnoxious entrance inroads saxophone among onward revamp scoop boxes point fawns rigid army badge icing frying voted biggest layout dehydrate acidic reinvest school inroads";
let seed = Seed::from_seed_words(seed_words).unwrap();
let address = seed.get_address::<Stagenet>().unwrap();
println!("Recovered Address (Stagenet): {}", address);
}
Contributions are welcome! Please feel free to open issues or submit pull requests.
- Thanks to the Monero project for its open-source cryptography libraries.
- Built using
curve25519-dalek
andbase58-monero
libraries.