The script you are using is
not using a "standard" mnemonic to seed system... If we look at the script command we see:
HDSEED=$(echo $MNEMONIC | bx mnemonic-to-seed -p "$SEEDPW" | bx hd-new | bx hd-to-ec | bx ec-to-wif)
So, it takes your mnemonic, passes that to the "mnemonic-to-seed" command, passes the output of that to "hd-new", passes the output of that to "hd-to-ec" and then passes the output of that to "ec-to-wif"...
This is because Bitcoin Core uses a "WIF" private key as the input to the
sethdseed command. If we then investigate what those individual "bx" (libbitcoin explorer) commands do... we find:
"mnemonic-to-seed":
Convert a mnemonic seed (BIP39) to its numeric representation.
Basically, it converts the BIP39 mnemonic to a 256bit hex number.
"hd-new":
Create a new HD (BIP32) private key from entropy.
This is creating an xprv... a Master Private Key... from the 256bits of Entropy that is encoded by the mnemonic.
"hd-to-ec"
Convert a HD (BIP32) public or private key to the equivalent EC public or private key.
This converts our xpriv... to a "standard" single private key (ie. a single bitcoin private key in hex)
Finally, "ec-to-wif":
Convert an EC private key to a WIF private key.
This essentially encodes the hex private key to WIF format, ready for use by Bitcoin Core as the "hdseed".
So, we can see that it's not just the standard system used by a normal BIP39 compatible wallet. Consequently, it might actually be quite difficult to restore a Bitcoin Core wallet generated in this way into another wallet, as while you are using a BIP39 compatible seed mnemonic to start with, it isn't used in the same way to derive the actual seed the wallet is derived from.
Further investigation is also needed to see if there are any "derivation path" differences as well.
Thank you. i will not use this script. I try use electrum with bitcoin core node and install it on my server
You cannot connect Electrum
directly to a Bitcoin Core node, as Electrum has it's own messaging protocol. Instead, it requires an Electrum server of some description (
ElectrumX,
Electrum Personal Server, or
electrs etc)
The Electrum server takes care of receiving requests from an Electrum client and forwarding those requests to a Bitcoin Core node and then returning the responses from the Bitcoin Core node back to the Electrum client.