Here are codes in function bytes_to_words():

w[0] = SWAP32LE(*(const uint32_t*)(src + (i * 4)));
w[1] = w[0] % word_list_length;
words += word_list[w[1]];

Then I try a case whose mnemonics are:

gesture mouth bids aglow tudor bawled insult listen jewels sugar calamity alley obvious sovereign jubilee legion oyster gumball using payment gumball giving sedan splendid giving

And the Seed should be:


I'd like to generate first mnemonics "gesture" with seed above so I calculate 688b988f mod 1626 and get 1441 which is not right index of wordlist...

Is there anything wrong with the process?

  • Is the endianness accounted for? – koe Feb 21 at 10:28
  • 1
    @koe You got the point! I mistook the endianness. Mine is bigendian and I thought it was littleendian. – Mooooo Feb 23 at 3:29

Example, taking your seed number:


Then byte swapped (and split):

8f988b68 3813e57d f261aa3d e57f8082 a671beaa b958aa39 b6ea6bcb 0c0af8f5

The first 4 bytes are:


Which as decimal is:



2409139048 mod 1626 = 538 = words[538] = gesture

Which (following on from this question), is the first of the 3 words (gesture, mouth, bids), generated from the 4 bytes 8f988b68.

| improve this answer | |
  • 1
    Great!! Thank you very much! – Mooooo Feb 22 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.