To create a 128 bits BIP39 mnemonic phrase, you need to:
generate the entropy
Let's take for example ae0d36b7fcfb6cfe599366ecd9411b62 which is the hexadecimal representation of 128 bits of entropy.
calculate the checksum by hashing the entropy and keeping the first 4bits (1 bit for 32 bits of entropy (128/32 = 4))
hash(entropy) = 9214b8501502213b6e1d67f4bed6dd216596c553f0a0618bbd63c1cc3d7db51e
Now let's keep the first 4bits which is '9' (1001 in binary)
- append the checksum to the entropy:
ae0d36b7fcfb6cfe599366ecd9411b629
which gives us in binary:
10101110000 01101001101 10101101111 11111001111 10110110110 01111111001
01100110010 01101100110 11101100110 11001010000 01000110110 11000101001
(The binary string is split into groups of 11 bits (2^11 = 2048 and there are 2048 words in the BIP39 Wordlist))
- convert each group of 11 bits to its corresponding word in the BIP39 Wordlist
For example, the first group: 10101110000 is the 1392th word on the list.
(starting from 0) => The word is 'puppy'
(10101110000 being the binary representation of 1392)