1

I've used PyWallet from (https://github.com/ranaroussi/pywallet) to create an HD Wallet for Ethereum

{
"coin": "ETH",
"seed": "virtual option economy rose hello because enough crumble bean oyster fun honey",
"private_key": "0488ade403635dd7e180000000741ef9de950bf6c6abb3a14811db0c521485df2710b480a5445bea057b89251700e8d7f8d59c1f5e441d209f0cebbc82faa71ce5e9657042900ddfaf7fecdaa2c3",
"public_key": "0488b21e03635dd7e180000000741ef9de950bf6c6abb3a14811db0c521485df2710b480a5445bea057b89251703341f79662c77d72d234c4644049ee4bdf0cf3e6b65eb1eba8656d34d840b4034",
"xprivate_key": "xprv9yPn5fGcTmcuSAwGGhNyRq3xJGi8HEHKLL2n2Jkxit1eaNYeZLYw7LrQ1CghEL3LrMfThFAbrbCerPBj69Kvo8b4bMNka1jH4kroGGbRBf3",
"xpublic_key": "xpub6CP8VAoWJ9BCef1jNiuynxzgrJYcgh1AhYxNphAaHDYdTAso6ssBf9AsrUHcagNKsm8m2m7TgbyvLBccjp3mK6VugqYyTfL3dtDcpTaVVn7",
"address": "0xf53726dc04b08831f6586743a7ecb10b6a4af733",
"wif": "",
"children": [{
    "address": "0xf53726dc04b08831f6586743a7ecb10b6a4af733",
    "xpublic_key": "xpub6HGuCTtcnVyUNQcjsayB1gZ8NamAQ6in2tDVP1bzTZA3PRJr1WaY7um2dkp3XYGMfSTRGkp3oDEhwz3sUk7p4fTJFUbyMURavuwKNwet7Nf",
    "path": "m/0",
    "bip32_path": "m/44'/60'/0'/0"
}],
"xpublic_key_prime": "xpub6HGuCTtcnVyUNQcjsayB1gZ8NamAQ6in2tDVP1bzTZA3PRJr1WaY7um2dkp3XYGMfSTRGkp3oDEhwz3sUk7p4fTJFUbyMURavuwKNwet7Nf",
"merchant_id": "M01"
}

I want to know how to load the private_key and public_key of this HD Wallet into Web3j in order to make transactions with it.

I've tried loading the seed as follows but it does not seem to be accessing the correct wallet.

 Bip32ECKeyPair masterKeypair = Bip32ECKeyPair.generateKeyPair(MnemonicUtils.generateSeed("MY RANDOM SEED", null));
        int[] path = {44 , 60 , 0 , 0,0};
        Bip32ECKeyPair x = Bip32ECKeyPair.deriveKeyPair(masterKeypair, path);
        Credentials credentials = Credentials.create(x);

        System.out.println(x.getPrivateKey());
        System.out.println(x.getPublicKey());

How do I create a proper Credentials Object with the private_key which I have?

Thanks!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.