I have an Electrum wallet that show only Legacy addresses (addresses starting with 1) inside. I copied public key (starting with xpub) from it to blockchain.com to view the list of linked addresses and funded one bech address that starts with bc1q. Does anyone have idea how to withdraw from this bc1q address?
That requires a sensitive command and creation of a separate wallet that can spend it.
The issue is simply the script type used for the same keys as your legacy wallet since it's derived from the same extended public key.
So to create a spendable wallet, you have to restore its pair extended private key
(called "Master Private Key" in Electrum SegWit wallet) with indication to use p2wpkh script type.
You may opt-in to do this
on an offline if you see fit:
- First, open that legacy Electrum wallet and open the Console tab ("View->Show Console" if i's not enabled).
- Next, enter this command in the console, it will require you to type your password: getmasterprivate()
- Copy the result xprv key and use that in this next command: convert_xkey(xkey="your_xprv_key",xtype="p2wpkh")
- Lastly, copy the resulting zprv key and create a new wallet using it, use the options: "File->New/Restore....->Standard Wallet->Use a master key"