I will help you with that. However, please note that the Bip32Ethereum bookshop requires greater configuration that matters it. In addition, the ear of the messages that you will be a problem without how to criticize your private key.
Here is a step-by-step guide to repair them:
Step 1: Imports the correct employee
Make sure you imported correct employees for Bitcoin (Bip32) and Ethereum (ETH). You can import themeters.js.js' which is composed of the projects:
Javacript
Const {eters} = requirement ('eters');
Step 2: Create a private keyFromseed
*
To create a Bitcoin set of a private key survivor, you will have to pass a topic to the functionbip32.fromseed (). However, it will look like your problem for your bean on how you see the seed in this function.
Try this Instad:
Javacript
Const PrivateKey = Abswait eters.utilsnemonic.tosecret (
'Your_mnemonic_string',
{Keyforms: 'Seed'}
);
Here, IEters.utilities Mnemonic.tosecret ()
convert your mnemonic string in a secret (private) key. The `Keyformat is set to
” seed ‘parameter, the private individual is private.
Step 3: Create a public key
Tocate an audience for Ethereum, you will be the ‘bip32.fromseed () . Somehow, the side we created orur private Key Surghal Bip32, we don't take care not to directly.
Javacript
Const Publickey = ASVET ETERS.UTILS.TOPUBLIC (
Privatekey,
{Keyforms: 'Seed'}
);
Here,Eters.utils.topublic ()
convert your secret (private) key in a public key. Once again, the `Keymat 'parameter is set to' Seed ''.
Step 4: Print the private key, the public key and the Mnemonics
To print the private key, the public key and the mnemonic, you can be the following code:
Javacript
Console.log ('Private key:');
Console.log (Privatekey);
Console.log ('\ Npublic Key:');
Console.log (Publickey);
Const Mnemonic = eters.utility.tomnemonic (
'Your_mnemonic_string'
);
Console.log ('\ Nmnemonic:');
Console.log (Mnemonic);
Here, we are usingEters.utils.mnemonic.Tomnemonic () to convert your mnemonic string into a mnemonic (which can be built to the public).
FIR code:
Javacript
Const {eters} = requirement ('eters');
// Create a private bip32 key
Async CreateKey () {function
// Replace 'Your_mnemonic_string' with your real mnemonic
Const Privatekey = ABSWAIT ETERS.UTILS.ASCIITHEX (
'Your_mnemonic_string',
{LONGGHTH: 36, Seedlength: 34}
);
Privatekey;
}
// Create a public key ESTING BIP32 and the private key
Createpublickey asynchric function (Privatekey) {
// Replace 'Your_private_key' with the actual private key
Const Publickey = Abveat eters.utils.assiitohex (
'Your_private_key',
{LONGGHTH: 36, Seedlength: 34}
);
the public return;
}
// Print the private key, the public key and the Mnemonics
Async function in which () {
// Create a private bip32 key
Const Privatekey = Abveat Createkey ();
Console.log ('Private key:');
Console.log (Privatekey);
// Create a public key ESTING BIP32 and the private key
Const Publickey = Abveat CreatePublickey (PrivateKy);
Console.log ('\ Npublic Key:');
Console.log (Publickey);
// Print the mnemonic (optional)
Const Mnemonic = Ethers.utils.aciitohex (
'Your_mnemonic_string',
{LONGGHTH: 36, Seedlength: 34}
);
Console.log ('\ Nmnemonic:');
Console.log (Mnemonic);
}
in what ();
`
Jump this helps! If you are still experimented, pleasantly more detail on your Ethereum configuration and what is not an Expe job.