Skip to main content

Crate kdk_mnemonic

Crate kdk_mnemonic 

Source
Expand description

BIP39 mnemonic conversion for KDK.

Each *_mnemonic pipeline returns a GameMnemonic<O, W> — a sensitive wrapper carrying an origin marker O (e.g. kdk_entropy::Coin, kdk_entropy::Dice<F>, kdk_entropy::Deck<C>) and the BIP39 word count W in [12, 15, 18, 21, 24].

Supported word counts are gated by Cargo features. Defaults (words-12, words-24) enable the Krux-compatible 12 and 24-word mnemonics; extended enables 15/18/21-word.

Structs§

GameMnemonic
Sensitive BIP39 mnemonic wrapper. O is a zero-sized origin marker (e.g. kdk_entropy::Coin, kdk_entropy::Dice<F>, kdk_entropy::Deck<C>) and W is the word count (12 / 15 / 18 / 21 / 24).

Enums§

MnemonicError
Errors returned by the conversion functions.

Traits§

SensitiveGame
Contract for any entropy-source (“game”) that can produce a BIP39 mnemonic. Implementers supply only [to_entropy]. Per-W.

Functions§

dice_mnemonic
Dice rolls to BIP39 mnemonic. FACES is the die size and W the word count; the matching words-<W> Cargo feature must be enabled.
entropy_to_mnemonic
Pre-built entropy bytes sets to a BIP39 GameMnemonic<O,W>. Validates that W is enabled and that N matches its BIP39 byte count, then wraps the produced [bip39::Mnemonic].

Type Aliases§

DiceMnemonic
Dice-roll BIP39 mnemonic. FACES is the die size (e.g. 6, 20); W is the word count in [12, 15, 18, 21, 24].