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

Bugfix: Derive PublicKey #423

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

yuzhiyou1990
Copy link
Contributor

No description provided.

@yuzhiyou1990 yuzhiyou1990 changed the title Derive PublicKey Bugfix: Derive PublicKey Dec 10, 2021
@yaroslavyaroslav
Copy link
Collaborator

Could you provide some detailed comment for your PR please.

@yuzhiyou1990
Copy link
Contributor Author

yuzhiyou1990 commented Dec 20, 2021

guard let node = HDNode("xpub6DXryz8Kd7XchtXvDnkjara83shGJH8ubu7KZhHhPfp4L1shvDEYiFZm32EKHnyo4bva4gxXjabFGqY7fNs8Ggd4khYz2oNs2KYLf56a9GX") else {
            return
        }
        
guard let childNode = node.derive(path: "0/0", derivePrivateKey: false) else {
    return
}

debugPrint(childNode.publicKey.toHexString())

// I got a wrong result:
// 02236bef05e128cfe4cf4ed98521eb2852f6b83ab47c9df33b6fa9a8d6c20dcc71

// Actual results:
// 02bac0f67b40d388965912461c2e508b67ed57b88835ee519e5ce8daac0d468573

@yaroslavyaroslav

@yuzhiyou1990
Copy link
Contributor Author

yuzhiyou1990 commented Dec 20, 2021

https://iancoleman.io/bip39/#english

Test BIP39 Mnemonic:
farm embark rib antique unlock donkey latin shock bundle arrange sword universe

image

@yaroslavyaroslav
Copy link
Collaborator

Thank you.

@yaroslavyaroslav yaroslavyaroslav merged commit 49d39c6 into web3swift-team:develop Dec 20, 2021
zhiying-fan added a commit to KeystoneHQ/safe-ios that referenced this pull request Sep 1, 2022
zhiying-fan added a commit to KeystoneHQ/safe-ios that referenced this pull request Sep 1, 2022
zhiying-fan added a commit to KeystoneHQ/safe-ios that referenced this pull request Sep 2, 2022
zhiying-fan added a commit to KeystoneHQ/safe-ios that referenced this pull request Sep 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants