Decoding the term bip39: it pbkdf2_hmac
and bip39 vs ianan coleman bip39 device
As you try to convert a BIP39 to seed, XPRV root and xprv private key, you can find difference between the pbkdf2_hmac and Ian BIP39. In this article, we are immersed in the difference and examne that inconsistenties.
Understand the terms bip39
BIP39 (Bitcoin Development Proposal 39) is a standardized method of portraying bitcoin titles inhuman readable format. The term BIP39 consists of the words that produce the private key wenecting The resulting string is the one divided into four parts: one prefix, seed, one XPRV root and another XPRV root.
Thepbkdf2_hmacfunction
Usepbkdf2_hmacfunction in the Python Bitcoin directory (
Bcrypt, it in the Bitcoin software), in the Python Bitcoin directour d-based Key descent function (PBKDF). This feature can be used for the pre -processing step of BIP39 Sentences.
Howver,pbkdf2_hmac, housever, releases an output that Ian as Ian as Ian BIP39. There are many reasons for this:
* Hashing Schema : The centence.
* Sogaming : Although both tools generate salt, they can result in slightly different values. This can in the differences in the resulting hash.
The Ian Coleman BIP39 device
The Ian Coleman BIP39 device a clearer method of converting expressions into private keys by generating values directa and subtraction Sha-256. The output is the one divided in the seed, the XPRV root and the additional XPRV roots.
Why the difference?
The differences arise from two main factors:
- Sogaming : As menioned earlier, both devices generate salt differently.
۲. Hashing Scheme *: asd on the input sentence.
Conclusion*
Although both devices can be used to convert BIP39 sentences in the private keys, there are differences in that their implement. If you have a thing with more implementation or need more accurate over the cut process, consister use a device that Ian Ian's method. Howver, for most purposes, "PBKDF2_HMAC" can continue to produce acceptable.
Example Code
Here's an example of house to the both devices:
Python
Import Bitcoin
Bip39
expression = "Preferan recommends the puppy to imitate
Ian Coleman BIP3
salt = bitcoin.crypto.generate_salt (sent)
private_key = bitcoin.crypto.pbkdf2_hmac (salt, '0000', 65536, sha_256)
The output of both tools can be different
Print (prive_key.hex ())
Ian Coleman's method to obtain the core
Seed = int.from_bytes (bitcoin.crypto.pbkdf2_hmac (b'0000 ', sprase.encode (), 65536, sha_256)
Keep in mind that the actual May vary dure to the difference in brogeneration and excision scchemes.