👝
BIP 39
Week 39
Being week 39, you decide you want to look once more at BIP-39 - the Bitcoin Implementation Protocol standard for defining how a series of words can be used to derive a user's private key representing their wallet - which acts as an easier alternative that a user can e.g. write down on a piece of paper, as opposed to copying and pasting a large hex/base 64 string and saving it on their device, which is arguably less secure
Here is a an array containing all 2048 (2^11) BIP-39 words:
Many crypto wallets will generate and allow you to restore your account (and hence funds) from a mnemonic - there are websites like this or this which can also generate mnemonics for you, if you want to familiarise yourself with the process
You decide you only want to go for maximum security, so will only generate 24-word phrases (rather than shorter e.g. 12 word phrases) yourself which will act as your wallets - as you can see in the "Generating the mnemonic" section from the official spec, it is a multistage process:
- Generate 256 bits (32 bytes) of random values (0-255) - for this challenge, these random bytes will be given to you, so we can all get the same answer
- Perform a SHA-256 hash of those 32 bytes - take the first byte in the hash result and append it to the end of your initial 32 random bytes (i.e. now 33 bytes total) - this byte will act as a checksum to ensure the sentence is valid
- Split the entire 33 bytes into 11-bit sections (it might be easier to convert these bytes to a binary string like "010001..."), convert each 11 bits to an integer (will be 2048 (2^11) different values - i.e. range 0-2047) and use each integer as an index to get a word from the BIP 39 words listed above
Let's look at an example:
To prove that your program is working, you should use the following 32 random bytes, then generate the 24 word phrase (same line, space-separated) from it
Hints
Hints will be released at the start of each of the following days - e.g. the start of day 3 is 48 hours after the challenge starts
| Release Day | Hint |
|---|---|
| 2 |