the problem with this method is that it is not clearly defined what it does and the problem with the script is its dependency that was not easy to go through (at least not easy for me). so i would never use it.
I am running my electrum app on my PC and i am trying to add a new wallet with a mnemonic phrase from my main bitcoin wallet (from which I previously created a wallet). Balance = 0. There are no previously sent bitcoins. If I dump a wallet, the right key differs from the one shown on the site, what can I do? Has anyone encountered this? How can you get a mnemonic phrase using core.
that's not how this script and bitcoin core work.
Electrum or any other similar tool use the mnemonic to derive all your child keys at any derivation path you like. this script is just a silly way of deriving the BIP-32 master private key (xprv) then only getting its private key part (first 32-byte of HMAC result) then feeding that as the HD seed used in bitcoin core. then core uses that 32-byte entropy to derive keys at its defined derivation path which if i'm not mistaken is at m/0'/0'
try converting your mnemonic to xprv then decode it using something like
http://bip32.org/ and copy the "Key" right below "Chain code" (not the "private key WIF" that is lower lower). then use that in your core as entropy, you should get the same result.
note that i haven't tested this and i'm only speculating based on the source code that i saw. i also don't recommend this method or using any of these sites for generating keys at all. it is too risky.
this is where i looked:
https://github.com/libbitcoin/libbitcoin-explorer/blob/55438a45d9cc20790ca834c1621cfea60d6f4a36/src/commands/hd-to-ec.cpp#L53https://github.com/libbitcoin/libbitcoin-system/blob/84e8d2a0c6ce4e253669f2f14aedbf74d6b83b1f/src/wallet/hd_private.cpp#L208Thank you. i will not use this script. I try use electrum with bitcoin core node and install it on my server