Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create same address and keystore by mnemonics? #22

Closed
BlueFlicker opened this issue Sep 6, 2018 · 2 comments
Closed

How to create same address and keystore by mnemonics? #22

BlueFlicker opened this issue Sep 6, 2018 · 2 comments

Comments

@BlueFlicker
Copy link

hello, I used function "BIP32Keystore(mnemonics: , ......)" to create BIP32Keystore, but I can't get the same address and keystore.
How can I get the same addres and keystore by mnemonics?

@shamatar
Copy link
Contributor

shamatar commented Sep 6, 2018

I've made a test today

    func testSameAddressesFromTheSameMnemonics() {
        let mnemonic = try! BIP39.generateMnemonics(bitsOfEntropy: 256)!
        let keystore1 = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "")
        let keystore2 = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "")
        XCTAssert(keystore1?.addresses?.first == keystore2?.addresses?.first)
    }

Please make sure that you use the same "mnemonics password". This feature is in the standard, although rarely used.

Sincerely, Alex

@BlueFlicker
Copy link
Author

Thanks. It's solved.
This problem is due to my misunderstanding of keystone.
I thought the "ciphertext" and others key should be same before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants