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

QA: Recovery word phrases are compatible with other SDKs #604

Open
Tracked by #591
SimiHunjan opened this issue Nov 10, 2023 · 1 comment
Open
Tracked by #591

QA: Recovery word phrases are compatible with other SDKs #604

SimiHunjan opened this issue Nov 10, 2023 · 1 comment

Comments

@SimiHunjan
Copy link
Contributor

SimiHunjan commented Nov 10, 2023

Generating recovery phrases and keys should be compatible with other SDKs.

@SimiHunjan SimiHunjan mentioned this issue Nov 10, 2023
39 tasks
@SimiHunjan
Copy link
Contributor Author

✅ Test C++ SDK Recovery Phrase and ED25519 Key Generation Compatibility with Java SDK

package org.example;

import com.hedera.hashgraph.sdk.*;
public class MneumonicExample {

    public static void main(String[] args) throws BadMnemonicException {

        //This 12 word recovery phrase string was generated from the c++ sdk
        Mnemonic mnemonic1 = Mnemonic.fromString("soccer loan bomb yard accuse doctor man mean lawn wing swift bread");

        //The private key at index 0 generated by the c++ SDK
        PrivateKey cppPrivateKey0 = PrivateKey.fromString("302E020100300506032B657004220420BA36ED3F60E3DA30B5DB6215461FAFFC2FCD066F385FD2261F74AB4E174E4591");

        //Generate ED25519 private key at index 0
        PrivateKey privateKey0 = mnemonic1.toStandardEd25519PrivateKey("",0);

        System.out.println("PrivateKey0 (c++): " + cppPrivateKey0);
        System.out.println("PrivateKey0 (jav): " + privateKey0);

    }
}

Output

PrivateKey0 (c++): 302e020100300506032b657004220420ba36ed3f60e3da30b5db6215461faffc2fcd066f385fd2261f74ab4e174e4591
PrivateKey0 (jav): 302e020100300506032b657004220420ba36ed3f60e3da30b5db6215461faffc2fcd066f385fd2261f74ab4e174e4591

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

1 participant