An implementation of BIP-39 (Deterministic Mnemonic Code Words) in C
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

bip39c (BIP-39 C-Implementation)

Build Status

Implementation of BIP-39 Mnemonic code for generating deterministic keys using C. The BIP-39 standard consists of two parts, the generation of the mnemonic sentence of random words and then the generation of a truly random binary seed. This seed can be used to create deterministic wallets described by BIP-32 or similar specification.


See the changelog file, or the Github releases for specific tags.




After cloning the repository you can build the bip39c command easily using the Automake and Autoconf tools with Linux. Configure and make the command first and then install using sudo.

For Debian/Ubuntu platforms, you may need to install these things as dependencies.

sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev

Simple configuration and build.

$ ./configure
$ make

Now as sudo install.

$ sudo make install


Using the BIP-39 command is easy. The command creates a mnemonic sentence using 5 preselected entropy bit lengths, 128, 160, 192, 224, and 256. For example you can create a mnemonic sentence with a 256 bit entropy like so:

bip39c -e 256
tell great unaware human cargo frozen real cause dentist grace during blanket eagle bag bomb print 
laundry real adult wine rocket slow fence fly

An English wordlist is included currently. Support for other languages will follow in future releases.

You can also create a 512-bit, 64 byte derived key from the mnemonic you just created. The mnemonic will always produce the same 512-bit HD wallet seed. Once the seed is used to create a wallet, you MUST hang on to the mnemonic word list (in order). The mnemonic is the only way to retrieve your wallet again in the event of tampering, loss, or theft.

Create the seed key like so:

$ bip39c -k "tell great unaware human cargo frozen real cause dentist grace during blanket eagle bag bomb 
print laundry real adult wine rocket slow fence fly"

Please note that the mnemonic is surrounded by quotes and the mnemonic words are separated by spaces like they were when they were originally generated. If quotes are not provided the function takes the first mnemonic word and calculates the stretched hash using only the first word. This would provide a false positive result. And, the key should be generated with the space character between each of the mnemonic words.


Please see issues for known bugs, if any. The source should be build-passing.


Did you learn something? Did this code help you achieve a goal? Is so, please consider a small donation for the work provided here.




  • ISO-639-2 - International Standard: Short codes for language names
  • BIP-39 - Mnemonic code for generating deterministic keys


MIT License. See LICENSE for details.