Hello everybody,
Electrum on GNU/Linux has following command-line restore function which can be viewed in
source-code here.
electrum help restore
usage: electrum restore [-h] [--passphrase PASSPHRASE] [-W PASSWORD] [--encrypt_file ENCRYPT_FILE] [-w WALLET_PATH] [--forgetconfig] [-v VERBOSITY] [-V VERBOSITY_SHORTCUTS] [-D ELECTRUM_PATH] [-P] [--testnet]
[--regtest] [--simnet] [--signet] [-o] [--rpcuser RPCUSER] [--rpcpassword RPCPASSWORD]
text
Restore a wallet from text. Text can be a seed phrase, a master public key, a master private key, a list of bitcoin addresses or bitcoin private keys. If you want to be prompted for an argument, type '?' or ':'
(concealed)
positional arguments:
text
It works fine when I use one single private key, either by supplying it into the command-line or using a one-liner text file with the key in it.
Following two commands workelectrum restore -w my_wallet p2pkh:KyRNwetcetera
electrum restore -w my_wallet $(cat my_list.txt)
whereas my_list.txt has following content:
p2pkh:KyRNwetcetera
But as soon as I want to import several keys it
doesn't work. I am using
a list with several private keys. The text file I am using has one private key per each line including the prefix p2pkh, here an example:
my_list.txt
p2pkh:KyRNwetcetera
p2pkh:L3UDbPkandsoon
p2pkh:KyjLwWsomEmoRe
p2pkh:L3ve7kqlore1psum
I also tried various formatting like
p2pkh:KyRNwetcetera,
p2pkh:L3UDbPkandsoon,
p2pkh:KyjLwWsomEmoRe,
p2pkh:L3ve7kqlore1psum,
or
p2pkh:KyRNwetcetera p2pkh:L3UDbPkandsoon p2pkh:KyjLwWsomEmoRe p2pkh:L3ve7kqlore1psum
or
p2pkh:KyRNwetcetera,p2pkh:L3UDbPkandsoon,p2pkh:KyjLwWsomEmoRe,p2pkh:L3ve7kqlore1psum
or
p2pkh:KyRNwetcetera\np2pkh:L3UDbPkandsoon\np2pkh:KyjLwWsomEmoRe\np2pkh:L3ve7kqlore1psum
nothing works, the error is:
Seed or key not recognized
or
usage: electrum [-h] [--version] [-v VERBOSITY] [-V VERBOSITY_SHORTCUTS] [-D ELECTRUM_PATH] [-P] [--testnet] [--regtest] [--simnet] [--signet] [-o] [--rpcuser RPCUSER] [--rpcpassword RPCPASSWORD]
[-w WALLET_PATH] [--forgetconfig]
...
electrum: error: unrecognized arguments: p2pkh:KyRNwetcetera p2pkh:L3UDbPkandsoon p2pkh:KyjLwWsomEmoRe p2pkh:L3ve7kqlore1psum
any clues ?