Expand description
§PQM-1
Post-Quantum Mnemonic v1: a 24-word BIP-39-compatible payload format for deterministic ML-DSA-65 wallet recovery.
This crate implements only the portable layer: BIP-39 phrase <-> 32-byte PQM-1 payload <-> SHAKE256-derived 32-byte ML-DSA-65 seed. It carries zero chain address/account types. Chains define their own profile domain and account/address derivation above this API.
§Minimal usage
use pqm1::{Pqm1Payload, Pqm1Profile};
let phrase =
"absurd amount abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon armor";
let payload = Pqm1Payload::from_mnemonic(phrase).unwrap();
let seed = payload.derive_mldsa65_seed();
let near = Pqm1Profile { mldsa65_domain_tag: b"near.pqm1.v1.mldsa65" };
let near_seed = payload.derive_mldsa65_seed_with_profile(near);
assert_ne!(&*seed, &*near_seed);§Caller invariants
- PQM-1 v1 is one phrase -> one ML-DSA-65 seed. There are no BIP-32 / BIP-44 paths in this format.
- A profile domain is part of the seed derivation. Use a chain/project- specific domain when adopting PQM-1 outside Monolythium.
- This crate does not encrypt or persist keys. Store derived seeds/signing keys only through a real keystore.
Structs§
- Pqm1
Payload - A decoded PQM-1 v1 payload: algorithm tag + version + 240 bits of entropy.
- Pqm1
Profile - Profile parameters that sit above the chain-neutral PQM-1 payload.
Enums§
- Pqm1
Error - Errors decoding or deriving from a PQM-1 mnemonic / payload.
Constants§
- ML_
DSA_ 65_ SEED_ LEN - FIPS-204 ML-DSA seed length used by PQM-1 v1.
- PQM1_
ALGO_ TAG_ FALCO N512_ RESERVED - Algorithm tag reserved for FALCON-512.
- PQM1_
ALGO_ TAG_ MLDS A65 - Algorithm tag for ML-DSA-65 (the only v1 production algorithm).
- PQM1_
ALGO_ TAG_ MLDS A87_ RESERVED - Algorithm tag reserved for ML-DSA-87.
- PQM1_
ALGO_ TAG_ SLHDS A128S_ RESERVED - Algorithm tag reserved for SLH-DSA-128s.
- PQM1_
ENTROPY_ LEN - Entropy length carried inside the PQM-1 v1 payload.
- PQM1_
PAYLOAD_ LEN - Total payload length: 1 byte algo + 1 byte version + 30 bytes entropy.
- PQM1_
V1_ MLDS A65_ DOMAIN_ TAG - Monolythium’s locked PQM-1 v1 SHAKE256 domain tag for ML-DSA-65.
- PQM1_
V1_ MNEMONIC_ WORDS - Number of words in a PQM-1 v1 mnemonic.
- PQM1_
VERSION_ V1 - PQM-1 version byte (
0x01for v1).
Functions§
- generate_
mnemonic - Mint a fresh PQM-1 v1 mnemonic from caller-supplied randomness.
- mnemonic_
to_ mldsa65_ seed - Decode a PQM-1 v1 mnemonic and derive the Monolythium-profile ML-DSA seed.
- mnemonic_
to_ mldsa65_ seed_ with_ profile - Decode a PQM-1 v1 mnemonic and derive an ML-DSA seed for
profile.