Skip to content

Instantly share code, notes, and snippets.

@tiero
Created August 14, 2018 13:13
Show Gist options
  • Save tiero/4c2051eb83b6c3adf5c2e28f65408722 to your computer and use it in GitHub Desktop.
Save tiero/4c2051eb83b6c3adf5c2e28f65408722 to your computer and use it in GitHub Desktop.

bip39 is the standardization of a specific list of words for a given language, and the process of transforming those words into a 512 bit hex seed that is the seed for generating a bip32 hd wallet.

bip32 = hd wallets, what they are how they work

bip39 = specific type of mnemonic, and the process for turning it into a bip32 seed

bip44 = a specific format of a bip32 wallet

So any wallet that says it's "BIP 32/39/44 compatible" will give you 12-24 words as the "seed" and use those words to deterministically generate a 512 bit seed to deterministically create a bip32 master key, and then create and use child keys in the manner specified by bip44.

For example, my phone app might give me the words:

cheese upset pudding inmate flavor crush hard same element index laugh supreme

which I then use the bip39 specification to derive the 512 bits:

8b3137dc79f912e4c5cddbe4bbe313abd0a0a8cf2441dcf4d664655087e8c202431e8e7b2503e63426703b3c773a12473a94c39058e7fb0784ab570b80ed0a23

which I use as a bip32 seed to generate the master private key:

xprv9s21ZrQH143K3Wjn9PzvdHooVbaSauXnawrxMhi7BdR1PrC41x51WTBWybzSjUaiPVH6BusrpupCkouMgAkBGtNJhb3bqpmRuKG5vrH96GL

which I can use to find the child key m/44'/0'/0'/0/0 (a specific bip32 child key, as outlined in the bip44 specification), which gives me the first non-change address of

1LPdUu1qKXFTowobD9uB62QesdodtV2ugx

with the private key

KziXBfNy2eZEKHdZeBZQ3ZyW3joXcv2k66yHuKPaDgNwEX76wMPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment