| Crates.io | pqbip39 |
| lib.rs | pqbip39 |
| version | 0.1.1 |
| created_at | 2025-06-08 10:54:59.853314+00 |
| updated_at | 2025-06-09 04:49:51.975626+00 |
| description | A no_std compatible implementation of the BIP39 mnemonic code standard. |
| homepage | |
| repository | https://github.com/openzebra/pq_bip39.rs |
| max_upload_size | |
| id | 1704779 |
| size | 245,164 |
A no_std compatible Rust implementation of the BIP-39 mnemonic code standard for generating and validating mnemonic phrases used in cryptocurrency wallets.
no_std environmentsstd and zeroize featuresAdd the following to your Cargo.toml:
[dependencies]
pqbip39 = "0.1.0"
use pqbip39::{Mnemonic, rng::Rng};
use rand::rngs::OsRng;
const EN_WORDS: [&str; 2048] = [/* English BIP-39 wordlist */];
let mut rng = OsRng;
let mnemonic = Mnemonic::generate(&mut rng, &EN_WORDS, 12).unwrap();
println!("{}", mnemonic); // e.g., "abandon ability able ..."
use pqbip39::Mnemonic;
const EN_WORDS: [&str; 2048] = [/* English BIP-39 wordlist */];
let phrase = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
let mnemonic = Mnemonic::parse_str(&EN_WORDS, phrase).unwrap();
let seed = mnemonic.to_seed("TREZOR").unwrap();
let entropy: Vec<u8> = mnemonic.to_entropy().collect();
std: Enables std library features like Unicode normalization (default).zeroize: Adds secure zeroing of sensitive data.To disable std (for no_std):
[dependencies]
pqbip39 = { version = "0.1.0", default-features = false }
Run tests with:
cargo test
The library includes comprehensive tests for entropy conversion, checksum validation, and PBKDF2 seed generation, including BIP-39 test vectors.
MIT