# Mnemonic

```python
from cryptofuzz import Convertor, Generator

conv = Convertor()
gen = Generator()

# Generate Mnemonic
mnemonic = gen.generate_mnemonic(12)
# Convert Mnemonic To Seed Bytes
seed = conv.mne_to_bytes(mnemonic)
# Convert Mnemonic To Hex
privatekey = conv.mne_to_hex(mnemonic)
# Convert Mnemonic To WIF Compress
wif_compress = conv.mne_to_wif(mnemonic, True)
# Convert Mnemonic To WIF Uncompress
wif_uncompress = conv.mne_to_wif(mnemonic, False)
# Convert Mnemonic To Decimal Number
dec = conv.mne_to_int(mnemonic)
# Convert Mnemonic To Binary
binary_str = conv.mne_to_binary(mnemonic)
# Convert Mnemonic To xprv
xprv = conv.mne_to_xprv(mnemonic)
# Convert Mnemonic To xpub
xpub = conv.mne_to_xpub(mnemonic)
# Convert Mnemonic To compress address
compress_address = conv.mne_to_addr(mnemonic, True)
# Convert Mnemonic To uncompress address
uncompress_address = conv.mne_to_addr(mnemonic, False)
# Output
print('Private key', privatekey)
print('Compress address', compress_address)
print('Uncompress address', uncompress_address)
print('Mnemonic', mnemonic)
print('Seed', seed)
print('WIF compress', wif_compress)
print('WIF uncompress', wif_uncompress)
print('Dec', dec)
print('Binary', binary_str)
print('XPRV', xprv)
print('XPUB', xpub)
```

### Generating and Converting Cryptographic Keys with CryptoFuzz

In this guide, we'll explore how to use the CryptoFuzz library in Python for generating mnemonic phrases and converting them into various cryptographic formats. This process is crucial for cryptographic operations such as creating secure wallets for cryptocurrencies.

#### Generate a Mnemonic Phrase

A mnemonic phrase, which can serve as a backup for crypto-wallets, is generated as follows:

```python
mnemonic = gen.generate_mnemonic(12)
```

This generates a 12-word mnemonic phrase.

#### Convert Mnemonic To Various Formats

Once you have a mnemonic, it can be converted into multiple formats for different uses:

* **Seed Bytes**: For generating deterministic keys.

  ```python
  seed = conv.mne_to_bytes(mnemonic)
  ```
* **Private Key (Hex Format)**: Essential for transactions in hex format.

  ```python
  privatekey = conv.mne_to_hex(mnemonic)
  ```
* **WIF (Wallet Import Format)**: Compressed and uncompressed formats for importing keys.

  ```python
  wif_compress = conv.mne_to_wif(mnemonic, True)
  wif_uncompress = conv.mne_to_wif(mnemonic, False)
  ```
* **Decimal Number & Binary**: Representations of mnemonic.

  ```python
  dec = conv.mne_to_int(mnemonic)
  binary_str = conv.mne_to_binary(mnemonic)
  ```
* **xprv & xpub**: Extended keys for hierarchical deterministic wallets.

  ```python
  xprv = conv.mne_to_xprv(mnemonic)
  xpub = conv.mne_to_xpub(mnemonic)
  ```
* **Addresses**: Compressed and uncompressed Bitcoin addresses.

  ```python
  compress_address = conv.mne_to_addr(mnemonic, True)
  uncompress_address = conv.mne_to_addr(mnemonic, False)

  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.mmdrza.com/guidelines/cryptofuzz/example/mnemonic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
