3.6 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| [TRIAGE] 4-word passphrase crate selection for WASM target (no_std/wasm32 constraints) | completed | task | critical | 2026-03-10T23:32:08Z | 2026-03-10T23:32:08Z |
Chosen: Option 3 — Custom embedded word list + rand 0.10 + getrandom 0.4 (wasm_js)
Research findings
| Option | Verdict |
|---|---|
passphrase-wordlist |
Does not exist on crates.io. Eliminated. |
bip39 |
WASM-compatible (8.8M downloads, used in web crypto wallets). Rejected: carries BIP-39 cryptocurrency semantics; word list (2048 entries) is tuned for phonetic distinctness, not general memorability; introduces unnecessary complexity. |
| Custom word list | Chosen. Minimal deps, full control, idiomatic Rust. |
Implementation approach
Word list: EFF Short Word List 1 — 1296 common English words designed for memorable passphrases.
Source: https://www.eff.org/files/2016/09/08/eff_short_wordlist_1.txt
Generate the Rust array: curl -s <url> | awk '{print $2}'
RNG: rand::rngs::OsRng from rand = "0.10".
- Does NOT use thread-local storage (safe for wasm32)
- Uses
getrandomas its entropy backend - For WASM targets: add
getrandom = { version = "0.4", features = ["wasm_js"] }in the wasm32 cfg section so Cloudflare Workers (which exposecrypto.getRandomValues()) can seed the RNG
Version note: rand 0.10 requires getrandom ^0.4. The wasm_js feature in getrandom 0.4 replaces the old js feature from getrandom 0.2. The latest uuid 1.21.0 also requires getrandom ^0.4, so both deps share one getrandom version in the dependency graph.
Cargo.toml changes (update ticket 1f5bb5)
[dependencies]
rand = "0.10"
[target.'cfg(target_arch = "wasm32")'.dependencies]
# Enables OsRng entropy via Web Crypto API (crypto.getRandomValues())
# Required by both rand (OsRng) and uuid (v4) on wasm32 targets
getrandom = { version = "0.4", features = ["wasm_js"] }
Correction: Tickets 7a0d9f and 1f5bb5 previously referenced getrandom = "0.2", features = ["js"] — this is outdated. uuid 1.21 and rand 0.10 both require getrandom ^0.4, which renamed the feature to wasm_js. Both those tickets have been updated.
Updated tickets
- 03bb91 — updated with full implementation plan (code, word list steps, tests)
- 1f5bb5 — corrected getrandom version to 0.4/wasm_js; added rand 0.10 dep
- 7a0d9f — corrected getrandom version to 0.4/wasm_js (was 0.2/js)