Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment: Randomly Create Palindromic Mnemonic in new Python File #4

Closed
hatgit opened this issue Nov 27, 2018 · 6 comments · Fixed by #6
Closed

Experiment: Randomly Create Palindromic Mnemonic in new Python File #4

hatgit opened this issue Nov 27, 2018 · 6 comments · Fixed by #6

Comments

@hatgit
Copy link
Owner

hatgit commented Nov 27, 2018

Edit the .py file mentioned further below that will run if/then loop statements while generating random mnemonics until a valid palindromic one is found. Additional reference:
gitcoinambassadors/ideas#2

Required Steps:

  1. generate a valid mnemonic randomly using the tool (and note the values of bit position 8,9,10 & 11, which are the last four bits of the first word or first group of 11-bits from the left)
  2. put the words into reverse order, then translate them back into groups of 11 bits,
  3. SHA256 hash the first 128 bits (not 132) as a bytearray and compute the 4-bit checksum,
  4. check if the checksum matches the leftover 4 bits from prior step which should match the last four bits of the first group noted in step 1. If they match, a mnemonic is palindromic and should be valid both as a little endian and big endian format. If no match, the program should loop back and repeat steps 1-4.

The file to use as a basis for this experiment is: https://github.com/hatgit/BIP39_mnemonic_creation_light_python/blob/master/Palindromic_Mnemonic_experiment.py

Example of steps that didn't lead to a palindromic mnemonic and should loop over again:

Initial entropy plus checksum:
01101000111011011100101111010001001110011111011000101111101011011010111011011011011000111110000001011001100010000101110111110101 +0110
11-bit groups (note the last 4 bits of first group):

['01101000111', '01101110010', '11110100010', '01110011111', '01100010111', '11010110110', '10111011011', '01101100011', '11100000010', '11001100010', '00010111011', '11101010110']
Index values of words:
[839, 882, 1954, 927, 791, 1718, 1499, 867, 1794, 1634, 187, 1878]
happy hour violin initial glass strategy rocket hockey theory slush blast turn

Putting the above mnemonic into reverse:

turn blast slush theory hockey rocket strategy glass initial violin hour happy

Extract first 128 bits and compute checksum:

111010101100001011101111001100010111000000100110110001110111011011110101101100110001011101110011111111101000100110111001001101000111 +1100

checksum didn't match:

['11101010110', '00010111011', '11001100010', '11100000010', '01101100011', '10111011011', '11010110110', '01100010111', '01110011111', '11110100010', '01101110010', '01101001100'] <— checksum here of 1100 would have had to been 0111, in order for the mnemonic to have been palindromic (not its entropy) where last word would have been "happy" and not "hat".

[1878, 187, 1634, 1794, 867, 1499, 1718, 791, 927, 1954, 882, 844]
turn blast slush theory hockey rocket strategy glass initial violin hour hat

Repeat all steps until a match is found.

@gitcoinbot
Copy link

gitcoinbot commented Nov 28, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.5 ETH (60.51 USD @ $121.02/ETH) attached to it as part of the BCA Ventures fund.

@gitcoinbot
Copy link

gitcoinbot commented Nov 28, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 3 years, 2 months ago.
Please review their action plans below:

1) pumpkingwok has been approved to start work.

Hi, i can start to work in this issue from tomorrow if it is still free.thanks.

Learn more on the Gitcoin Issue Details page.

@gitcoinbot
Copy link

gitcoinbot commented Dec 2, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.5 ETH (59.4 USD @ $118.79/ETH) has been submitted by:

  1. @pumpkingwok

@hatgit please take a look at the submitted work:


@hatgit
Copy link
Owner Author

hatgit commented Dec 2, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done

Work for 0.5 ETH (59.4 USD @ $118.79/ETH) has been submitted by:

  1. @pumpkingwok

@hatgit please take a look at the submitted work:

Link was provided here: #6

Paying bounty now using advanced function.

@gitcoinbot
Copy link

gitcoinbot commented Dec 2, 2018

⚡️ A tip worth 0.50000 ETH (58.91 USD @ $117.83/ETH) has been granted to @PumpkingWok for this issue from @hatgit. ⚡️

Nice work @PumpkingWok! Your tip has automatically been deposited in the ETH address we have on file.

@gitcoinbot
Copy link

gitcoinbot commented Dec 2, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:

  • hatgit tipped 0.5000 ETH worth 58.91 USD to pumpkingwok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants