Write a function in python to convert private key to mnemonics
Answers
Answered by
0
I'm looking for commentary on the following code, which converts from a hex seed to mnemonic (12 word phrase), and vice versa. It's for Bitcoin (BIP39 to be exact), and is going to be running in conjunction withpybitcointools, however I believe the commented URLs should be somewhat self-explanatory.
Background info:
In essence, a hex value (the seed) is converted to binary, divided into chunks of 11-bits, and the base 10 value of each binary chunk is used as an index in a list of 2048 words. So if the first chunk is 00000000001, it's the word @ index 1 (the 2nd word); ability. Or, 11111111111 = the last word, zoo. This is BIP39; where a large hex value (a private key, perhaps) is encoded with an easy(ier) to remember phrase.
This is a correct answer...
Background info:
In essence, a hex value (the seed) is converted to binary, divided into chunks of 11-bits, and the base 10 value of each binary chunk is used as an index in a list of 2048 words. So if the first chunk is 00000000001, it's the word @ index 1 (the 2nd word); ability. Or, 11111111111 = the last word, zoo. This is BIP39; where a large hex value (a private key, perhaps) is encoded with an easy(ier) to remember phrase.
This is a correct answer...
Similar questions