breadwallet / breadwallet-core

SPV bitcoin C library
MIT License
274 stars 324 forks source link

same seed, create address by bip32 ,the address not same #31

Closed chenyunecjtu closed 6 years ago

chenyunecjtu commented 6 years ago

` UInt512 seed = UINT512_ZERO; char* phraseString = "potato police mammal floor vivid gold elder robot human coin salt become"; BRBIP39DeriveKey(seed.u8, phraseString, NULL);

BRMasterPubKey mpk = BRBIP32MasterPubKey(&seed, sizeof(seed));
uint8_t pubkey[33];
BRBIP32PubKey(pubkey, 33, mpk, 0, 0|BIP32_HARD);
BRKey key;
BRKeySetPubKey(&key, pubkey, 33);
BRAddress address;
BRKeyAddress(&key, address.s, 75 );
printf("\n address 00:%s", address.s);
BRKey k;
BRBIP32PrivKey(&k, &seed, sizeof(seed), 0, 0|BIP32_HARD);
BRKeyAddress(&k, address.s, 75 );
printf("\n address 00:%s", address.s);

`

` result: address 00:mh4cRJMez2NLgCd2yLHqJv7f5HYHpSQsHR address 00:mpCEStKUg1UuN8adit4moP5jwFigSHJmDs

`

chenyunecjtu commented 6 years ago

address not same

chenyunecjtu commented 6 years ago

resove