kdk_mnemonic/lib.rs
1// SPDX-License-Identifier: MIT
2
3//! BIP39 mnemonic conversion for KDK.
4//!
5//! Each `*_mnemonic` pipeline returns a [`GameMnemonic<O, W>`] — a
6//! sensitive wrapper carrying an origin marker `O` (e.g.
7//! [`kdk_entropy::Coin`], [`kdk_entropy::Dice<F>`],
8//! [`kdk_entropy::Deck<C>`]) and the BIP39 word count
9//! `W in [12, 15, 18, 21, 24]`.
10//!
11//! Supported word counts are gated by Cargo features. Defaults
12//! (`words-12`, `words-24`) enable the Krux-compatible 12 and 24-word
13//! mnemonics; `extended` enables 15/18/21-word.
14
15#![no_std]
16#![doc(html_logo_url = "https://qlrd.github.io/kdk/logo.png")]
17
18mod error;
19mod game;
20
21#[cfg(feature = "coin")]
22mod coin;
23
24#[cfg(feature = "deck")]
25mod deck;
26
27#[cfg(feature = "dice")]
28mod dice;
29
30pub use error::MnemonicError;
31pub use game::{entropy_to_mnemonic, GameMnemonic, SensitiveGame};
32
33#[cfg(feature = "coin")]
34pub use coin::{coin_mnemonic, CoinMnemonic};
35
36#[cfg(feature = "deck")]
37pub use deck::{deck_mnemonic, DeckMnemonic};
38
39#[cfg(feature = "dice")]
40pub use dice::{dice_mnemonic, DiceMnemonic};