Calculate mnemonic code from terminal

Calculate mnemonic code from terminal

I want to replicate mnemonic code with terminal. the steps are:

  1. Create a random sequence (entropy) of 128 to 256 bits.
  2. Create a checksum of the random sequence by taking the first (entropy- length/32) bits of its SHA256 hash.
  3. Add the checksum to the end of the random sequence.
  4. Divide the sequence into sections of 11 bits.
  5. Map each 11-bit value to a word from the predefined dictionary of 2048 words.
  6. The mnemonic code is the sequence of words.

I can see this image

enter image description here

And I take this entropy

0c1e24e5917779d297e14d45f14e1a1a

If I follow the image, I create the checksum

printf 0c1e24e5917779d297e14d45f14e1a1a | xxd -r -p | sha256sum -b

result

76e57a90f93135e97ce700a9e79196ba46315d65e696d0a4518270a8de3e80e4 

Then take 4 bits (0,5 byte => 1 char ) and append to my entropy with this result:

0c1e24e5917779d297e14d45f14e1a1a7

Now I have 132 bits And I have to split in 12 segments of 11 bits each

I try to convert in base 2

 echo "ibase=16; obase=2; 0C1E24E5917779D297E14D45F14E1A1A7" | bc

But the result is not correct, If I put that entropy in https://iancoleman.io/bip39/#entropy-notes I can see that result

00001100000 11110001001 00111001011 00100010111 01110111100 11101001010 01011111100 00101001101 01000101111 10001010011 10000110100 0011010

But I don't understand How can I obtain that

00001100000 = 96 = army

http://bit.ly/2TfKu3v

Comments

Popular posts from this blog

sendrawtransaction and txn-mempool-conflict

couldn't connect to server: EOF reached (code 1)