Mnemonic Utilities
Mnemonic and seed conversion utilities following the Algorand 25-word mnemonic standard.
Examples (5)
Section titled “Examples (5)”| Example | Description |
|---|---|
| Mnemonic from Seed | This example demonstrates how to use mnemonicFromSeed() to convert a 32-byte seed into a 25-word Algorand mnemonic. The mnemonic uses BIP39-style word encoding where each word represents 11 bits of data. Key concepts:
|
| Seed from Mnemonic | This example demonstrates how to use seedFromMnemonic() to convert a 25-word Algorand mnemonic back to its original 32-byte seed. This is the reverse operation of mnemonicFromSeed(). Key concepts:
|
| Secret Key to Mnemonic | This example demonstrates how to use secretKeyToMnemonic() to convert a 64-byte Algorand secret key to a 25-word mnemonic. Key concepts:
|
| Master Derivation Key Functions | This example demonstrates the master derivation key (MDK) alias functions and shows their equivalence to the core seed/mnemonic functions. Key concepts:
”master derivation key” is more familiar than “seed” |
| Error Handling for Mnemonic Functions | This example demonstrates how to properly handle errors when working with mnemonic functions, including invalid words, bad checksums, and wrong seed lengths. Key concepts:
|
Quick Start
Section titled “Quick Start”Run any example from the repository’s examples directory:
cd examplesnpm run example algo25/01-*.ts