I am trying to use the cryptowallet library LibWally to convert a 12-word mnemonic into a set of derived addresses. I believe my mistake is not with the library itself, but a process flow/algorithmic one, so even if you don't aren't familiar with the library, you may be able to help.
First I validate and convert the mnemonic to a seed with the following code:
char *mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
bip39_mnemonic_to_seed((const char *)mnemonic, "",
(unsigned char *)bytes_output, HMAC_SHA512_LEN,
&size_written)
wally_hex_from_bytes((unsigned char*)bytes_output, size_written, &hex_output)
This gives me the proper seed value; at least it matches what I see on Ian Coleman's Site. Next I take the seed value in bytes_input (not the hex coded value) and call:
bip32_key_from_seed( (unsigned char*) bytes_output,
BIP32_ENTROPY_LEN_128,
BIP32_VER_MAIN_PRIVATE,
0,
&key_structure)
And then retrieve the private key with:
bip32_key_to_base58(&key_structure, BIP32_FLAG_KEY_PRIVATE, &output_privkey);
The value in privKey does not match the Bip32 root key shown in Ian's site, though interestingly enough, it matches on the first 16 characters, before diverging (and winding up 4 chars longer).
Am I missing a step here? Or doing something else wrong?
Edit: Adding some output data. Using the phrase given above: my (and IanColeman's) seed is:
5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4
Root Key results:
Mine: xprv9s21ZrQH143K2fH5FXCJ4B1iTN2wJSq1h9z2wTZkytm3YgVRxP621bDZ7yqo4KdNWVNcMEyWBHrjThJ9jXMabog7R1RTWFNdSAz2mhX2VjL
IanColeman: xprv9s21ZrQH143K3GJpoapnV8SFfukcVBSfeCficPSGfubmSFDxo1kuHnLisriDvSnRRuL2Qrg5ggqHKNVpxR86QEC8w35uxmGoggxtQTPvfUu
"