Closed xx11dragon closed 6 years ago
I trying mnemonic to public key, it working in mainnet.
mainnet
NSArray * array = @[@"know", @"final", @"wide", @"brush", @"educate", @"bleak", @"exact", @"exhibit", @"coil", @"galaxy", @"milk", @"rhythm"]; BTCMnemonic *mnemonic = [[BTCMnemonic alloc] initWithWords:array password:nil wordListType:BTCMnemonicWordListTypeEnglish]; BTCKeychain *mainKeychain = [[BTCKeychain alloc] initWithSeed:mnemonic.seed network: [BTCNetwork mainnet]]; BTCKeychain *purpose = [mainKeychain derivedKeychainAtIndex:44 hardened:YES]; BTCKeychain *coin = [purpose derivedKeychainAtIndex:0 hardened:YES]; BTCKeychain *account = [coin derivedKeychainAtIndex:0 hardened:YES]; BTCKeychain *keychainFirst = [account derivedKeychainAtIndex:0 hardened:NO]; BTCKeychain *keychainSecond = [keychainFirst derivedKeychainAtIndex:0 hardened:NO]; NSLog(@"public key - %@", keychainSecond.key.compressedPublicKeyAddress.string);
and, i want change testnet: Change code:
testnet
BTCKeychain *mainKeychain = [[BTCKeychain alloc] initWithSeed:mnemonic.seed network: [BTCNetwork testnet]]; NSLog(@"testnet public key - %@", keychainSecond.key.addressTestnet.string);
I 've got the wrong private.
Could you please explain me solution of that problem?
Do you have any document or example?
Thanks
use [mainKeychain derivedKeychainWithPath:@"m/44'/1'/0'/0/0"];in testnet.
[mainKeychain derivedKeychainWithPath:@"m/44'/1'/0'/0/0"];
I trying mnemonic to public key, it working in
mainnet
.and, i want change
testnet
: Change code:I 've got the wrong private.
Could you please explain me solution of that problem?
Do you have any document or example?
Thanks