Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ANTONIOGARCIA84 on June 19, 2024, 11:14:09 AM



Title: To convert that 2fa wallet in standard wallet using the command line
Post by: ANTONIOGARCIA84 on June 19, 2024, 11:14:09 AM
Hi.

I want to restore seeds from 2 Bitcoin wallets (1 standard seed and 1 2fa seed) to 2 standard wallets for those 2 seeds from the command line:

1) Wallet standard:

electrum daemon -d

electrum --o restore ?

argument: word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12

{
    "msg": "This wallet was restored offline. It may contain more addresses than displayed. Start a daemon and use load_wallet to sync its history.",
    "path": "/home/user/.electrum/wallets/default_wallet"
}

electrum load_wallet


And with the wallet loaded I can already use it.

Here everything is OK.


2) Wallet 2fa:

electrum daemon -d

electrum --o restore ?

argument: word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12

Unexpected seed type '2fa'


I want to convert that 2fa wallet in standard wallet using the command line.

I guess in "electrum --o restore ?" you have to add some function to disable this 2fa wallet and convert it to standard wallet.

Does anyone know what function can be used?

Thanks for your time and for your answer.

All the best.


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: Findingnemo on June 19, 2024, 12:55:02 PM
You can't convert a 2FA wallet to a standard wallet or vice versa because both are different seed types that Electrum recognizes with its version number.

https://www.talkimg.com/images/2024/06/08/cNvzd.jpeg

https://electrum.readthedocs.io/en/latest/seedphrase.html

But you can restore the 2FA wallet and export the private keys from the loaded wallet then import them into a new standard wallet.

As @hosseinimr93 pointed out, you can disable 2FA of your electrum but there is no way to convert multi-sig into single sig address type.



An easy reminder why you can't export a multisig key into a single key: a single key produces a different address format.

'Duly noted'  :)


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: hosseinimr93 on June 19, 2024, 01:44:35 PM
But you can restore the 2FA wallet and export the private keys from the loaded wallet then import them into a new standard wallet.
No, you can't.
Electrum 2FA wallet is a 2 of 3 multi-signature wallet and there are three private keys for each of addresses. There is no way to import your address with a single private key.


To OP:
If you want to disable 2FA, import the seed phrase of your 2FA wallet and choose to disable 2FA.
Take note that you don't make your wallet a standard wallet with disabling 2FA and your wallet will be still a multi-signature wallet. There is no way to turn a multi-signature wallet to single-signature wallet.


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: DaveF on June 19, 2024, 02:09:14 PM
You can't do it from the command line as far as I can see.
You CAN do it from the GUI.

https://electrum.readthedocs.io/en/latest/2fa.html

Quote
Restoring from seed

Even if TrustedCoin is compromised or taken offline, your coins are secure as long as you still have the seed of your wallet. Your seed contains two master private keys in a 2-of-3 security scheme. In addition, the third master public key can be derived from your seed, ensuring that your wallet addresses can be restored. In order to restore your wallet from seed, select “wallet with two factor authentication”, as this tells Electrum to use this special variety of seed for restoring your wallet.

Don't know if you can do the GUI, but if you can't check the android phone version of electrum. I know you can restore the 2fa from there I don't know if it still requires trusted coin.

-Dave


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: hosseinimr93 on June 19, 2024, 02:20:34 PM
I know you can restore the 2fa from there I don't know if it still requires trusted coin.
Two of master private keys and all three master public keys can be derived from 2FA seed phrase.
Therefore, if you have access to your 2FA seed phrase, you have all the required keys for making transaction from your wallet and you don't rely on trustedcoin.


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: Findingnemo on June 19, 2024, 03:38:30 PM
But you can restore the 2FA wallet and export the private keys from the loaded wallet then import them into a new standard wallet.
No, you can't.
Electrum 2FA wallet is a 2 of 3 multi-signature wallet and there are three private keys for each of addresses. There is no way to import your address with a single private key.


To OP:
If you want to disable 2FA, import the seed phrase of your 2FA wallet and choose to disable 2FA.
Take note that you don't make your wallet a standard wallet with disabling 2FA and your wallet will be still a multi-signature wallet. There is no way to turn a multi-signature wallet to single-signature wallet.

Hmm, thanks for correcting me.  :)

That is why I always hesitate to reply regarding the technical questions cause I kind of mess up some of the time even though I am spending more and more time learning about technical aspects, I guess it's really not my cup of tea. :(


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: LoyceV on June 19, 2024, 05:06:35 PM
That is why I always hesitate to reply regarding the technical questions cause I kind of mess up some of the time
Now that you know you messed up, it's best to edit your post and strike through the incorrect part. Others may read it in the future.
An easy reminder why you can't export a multisig key into a single key: a single key produces a different address format.


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: nc50lc on June 20, 2024, 04:37:06 AM
I guess in "electrum --o restore ?" you have to add some function to disable this 2fa wallet and convert it to standard wallet.
I think you meant to just disable 2fa so you wont have to use the authenticator app,
not necessarily convert the wallet to standard since it's still a 2-of-3 MultiSig, 2fa enabled or not.

If so, that's still not possible in the command line since the only options for restore command are:
text (seed, master key, prvKeys or addresses), passphrase (extension), password, encrypt_file and wallet_path.
Ref: github.com/spesmilo/electrum/blob/master/electrum/commands.py#L281 (https://github.com/spesmilo/electrum/blob/83e14794a1e1202ecfd40f0ea779f0b91ccf2032/electrum/commands.py#L281)

In an additional note, they also prevent 2fa when creating a wallet in the command line.
e.g.: electrum --o create --seed_type "2fa"
result: Unexpected seed type '2fa'


Title: Re: To convert that 2fa wallet in standard wallet using the command line
Post by: ANTONIOGARCIA84 on June 20, 2024, 07:35:49 PM
I guess in "electrum --o restore ?" you have to add some function to disable this 2fa wallet and convert it to standard wallet.
I think you meant to just disable 2fa so you wont have to use the authenticator app,
not necessarily convert the wallet to standard since it's still a 2-of-3 MultiSig, 2fa enabled or not.

If so, that's still not possible in the command line since the only options for restore command are:
text (seed, master key, prvKeys or addresses), passphrase (extension), password, encrypt_file and wallet_path.
Ref: github.com/spesmilo/electrum/blob/master/electrum/commands.py#L281 (https://github.com/spesmilo/electrum/blob/83e14794a1e1202ecfd40f0ea779f0b91ccf2032/electrum/commands.py#L281)

In an additional note, they also prevent 2fa when creating a wallet in the command line.
e.g.: electrum --o create --seed_type "2fa"
result: Unexpected seed type '2fa'


Hi.

Exactly what he meant is what he says nc50lc.

The idea is with the command line disable 2fa so you wont have to use the authenticator app.

You are right that for the restoration command there is no possibility of 2FA deactivation in the command line as it happens with the GUI.

I thought that when it could be done with the GUI that possibility would also exist with the command line.

So clarified is that technical doubt and another thing that I have learned thanks to all of you.

Thanks for your time and for your contributions.

All the best.