In the BIP32, it does not define the round of HMAC-SHA256.

enter image description here

In http://bip32.org/, it use 50,000 rounds.

In "mastering Bitcoin", it use 2048 rounds.

Is there any explicit standard, or what we suppose to follow?

Book "Mastering Bitcoin": Mastering Bitcoin

http://bip32.org /bip32.org


BIP 32 only uses one round of HMAC-SHA512 to go from the seed to the master private key.

Neither of the two sources you listed are going from a seed (or passphrase) to the master private key. They are going from a mnemonic or passphrase to the seed.

What Mastering Bitcoin is describing is the BIP 39 conversion from mnemonic to BIP 32 seed. From there, that seed will be put though HMAC-SHA512 one more time to get the final master private key.

bip32.org is using HMAC-SHA256 (which is not HMAC-SHA512) 50,000 times in order to convert the passphrase you enter into a BIP 32 seed. Again, the resulting value will be hashed one more time using HMAC-SHA512 to get the master private key.

  • it that means the seed (pri and pub) will be different if the procedure is a little bit different if we use a different wallet?
    – Carpemer
    Jan 20 '19 at 0:28
  • The seed is just an integer, it is not a private-public keypair. Given two different wallets, it is possible that they go from mnemonic or passphrase to seed differently, which means that the resulting seed is different. However, if the seeds are the same, then the master private key will be the same. Also BIP 39 specifies a standard way to get the seed from a mnemonic, so wallets that use that will get the same seed and thus master private key from the same mnemonic.
    – Andrew Chow
    Jan 20 '19 at 2:24
  • Thanks for the clarification, but just feel bad if we still can not align the procedure to recover the right address from mnemonic in the cryptocurrency industry.
    – Carpemer
    Jan 20 '19 at 2:43
  • There is no one correct way to do it. There are an infinite number of ways to go from mnemonic to seed. All people can do is to specify and standardize one way to do it. That's what BIP 39 does, and AFAIK, most wallets that people actually use that have mnemonics, do it that way.
    – Andrew Chow
    Jan 20 '19 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.