Author

Topic: How to create P2PKH addresses in most recent version of Electrum / Import Paper (Read 226 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
It is like you are repeating what has already been posted, and that is not the point of what I am implying, and if you read the posts above, all has been solved. All said was that you can not use brainwallet to sign segwit message address successfully. This is not about how important private key is in message signing. Try to go through the above posts. Or if you have different view about it, it will be nice, if you think the reason for the inability of brainwallet to sign segwit address message is not correct which I indicated as its incompatibility with segwit, then your post will be appreciated if valid.
Again, message signing is done with the private key. Don't consider the concept of addresses, the same message when signed with a single private key can be validated against P2PKH and P2WPKH, provided that they're derived from the same public key. You can sign messages using your bech32 address (actually the private key, but since you insist on not talking about the private key), just replace the legacy address being shown in the results with your own bech32 address. You're probably talking about message validation as opposed to signing, for which you will be correct.

Apologies though if you found that I was repetitive. I had a hard time following your train of thoughts.
My understanding is that there has not yet been a BIP to create a industry standard message signing process outside of P2PKH and that the current implementations for SEGWIT signatures is vendor specific.
There is a BIP actually, still in the drafting stage: https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
<...>
It is like you are repeating what has already been posted, and that is not the point of what I am implying, and if you read the posts above, all has been solved. All said was that you can not use brainwallet to sign segwit message address successfully. This is not about how important private key is in message signing. Try to go through the above posts. Or if you have different view about it, it will be nice, if you think the reason for the inability of brainwallet to sign segwit address message is not correct which I indicated as its incompatibility with segwit, then your post will be appreciated if valid.

You are right, it will not work on brainwallet. Addresses generated by paper wallet and/or brainwallet are legacy addresses, that is why signing a message using segwit address will not work on brainwallet or papar wallet. Unlike segwit wallets that are backward compatible.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
You are right, but I what I meant is different, brainwallet are not still supporting segwit, how can what not supporting segwit not be able to sign a segwit address message? In my opinion, it is because it is not supporting segwit. Let us just leave the private key signing aside, what could cause brainwallet not able to sign segwit address messages? If not for the segwit incompatibility.

I tried it (the segwit message you signed) on paper brainwallet message verification and yet not working, it only work on my segwit wallet. Although, the legacy address was verified as usual.
You need to understand that you're not signing using an address, you're signing using the private key. The public key is derived using the ECDSA signature and the client can parse and convert it to an address, if the address generated matches the address given and that the signature is valid, then brainwallet will return positive. This is also the reason how the client can deduce a set of possible addresses using the signature alone. As BlackHatCoiner has mentioned, replacing a message that was signed in brainwallet with its legacy address also means that the signature is valid for the bech32 version as well, because your client can generate and confirm the bech32 address that is given.

Brainwallet doesn't convert any addresses to Segwit, unless there is some fork out there. It has been discontinued for quite awhile. Message signing at its current form doesn't prove knowledge of the private key.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
How's a paper wallet related with it? And also, what's a segwit wallet? Do you mean segwit-compatible wallet?
I meant the message verification for segwit addresses not working on the brainwallet message verifying link you pasted above, never mind me relating it to paper wallet, although they both have the same address type (legacy addresses) which are both compatible for the message signing. I also meant segwit supported wallets, that can verify address signed messages. 
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I tried it (the segwit message you signed) on paper wallet and yet not working, it only work on my segwit wallet.
How's a paper wallet related with it? And also, what's a segwit wallet? Do you mean segwit-compatible wallet?

Let us just leave the private key signing aside, what could cause brainwallet not able to sign segwit address messages? If not for the segwit incompatibility.
Nothing. It'd just be the incompatibility. The signing is the same to every platform, I guess, I haven't seen a platform where given the same private key and message, it returns you a different signature. In what they differ is they verification part.

I tried it (the segwit message you signed) on paper wallet and yet not working, it only work on my segwit wallet. Although, the legacy address was verified as usual.
Yep, because of the segwit incompatibility in brainwallet.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
If you sign a message from the same private key, it will be verified by both addresses.
You are right, but I what I meant is different, brainwallet are not still supporting segwit, how can what not supporting segwit not be able to sign a segwit address message? In my opinion, it is because it is not supporting segwit. Let us just leave the private key signing aside, what could cause brainwallet not able to sign segwit address messages? If not for the segwit incompatibility.

I tried it (the segwit message you signed) on paper brainwallet message verification and yet not working, it only work on my segwit wallet. Although, the legacy address was verified as usual.

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Addresses generated by paper wallet and/or brainwallet are legacy addresses, that is why signing a message using segwit address will not work on brainwallet or papar wallet.
It doesn't matter the address' type, but only the signature verification. Remember, the signing and verifying happens on the secp256k1, the addresses are just put, because they can be brought by hashing the public key. Essentially, what you're verifying is the public key; if you hash it and it gives you the same address, then that's an address' “signed message”.

Example, let's take this private key: L4bjcR5zFG9r6n64FMVxN54zD822kiZgjd897x2tqDritdqUMRMT

That's the legacy address it returns: 1AR2ruKwF1WqrJDtncGsjjXfY4VawE7Ah7

And that's its native segwit address: bc1qvaz2kz87278nqavxntyau4pkmx8l2pgdn440d7

If you sign a message from the same private key, it will be verified by both addresses.







Code:
-----BEGIN BITCOIN SIGNED MESSAGE-----
test
-----BEGIN BITCOIN SIGNATURE-----
bc1qvaz2kz87278nqavxntyau4pkmx8l2pgdn440d7
HwpUK4TOxwu1BtzeWgPFuHYfSsMief1niv7oPZdYEFzGKKJAkf7B52QcyY2n/asVYhMkNlF5n8QfdjupM8RJZj0=
-----END BITCOIN SIGNATURE-----

Code:
-----BEGIN BITCOIN SIGNED MESSAGE-----
test
-----BEGIN BITCOIN SIGNATURE-----
1AR2ruKwF1WqrJDtncGsjjXfY4VawE7Ah7
HwpUK4TOxwu1BtzeWgPFuHYfSsMief1niv7oPZdYEFzGKKJAkf7B52QcyY2n/asVYhMkNlF5n8QfdjupM8RJZj0=
-----END BITCOIN SIGNATURE-----
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
Try it in the well-known brainwallet. Sign from electrum using a Native Segwit address and try verifying it from that site.
You are right, it will not work on brainwallet. Addresses generated by paper wallet and/or brainwallet are legacy addresses, that is why signing a message using segwit address will not work on brainwallet or papar wallet. Unlike segwit wallets that are backward compatible.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Even segwit addresses can be used to sign a message.
Yes, but there is no standard method for verifying segwit signatures. Each software implements its own way. I've heard that the signature created from segwit address using Trezor can only be verified by Trezor. In Electrum and Mycelium they're the same.

Try it in the well-known brainwallet. Sign from electrum using a Native Segwit address and try verifying it from that site.




legendary
Activity: 2268
Merit: 18711
Thank you very much o_e_l_e_o!  That is exactly what I was looking for!  Your help is very much appreciated! Would you happen to have any resouces you can point me to for electrum console commands?
No problem, glad to help.

If you are able to read the code, then you can read a full list of all the console commands on the Electrum GitHub here: https://github.com/spesmilo/electrum/blob/master/electrum/commands.py

Alternatively, there is a less comprehensive but more easily understandable guide to many of the commands available here: https://bitzuma.com/posts/an-introduction-to-the-electrum-python-console/
member
Activity: 104
Merit: 120
Thank you very much o_e_l_e_o!  That is exactly what I was looking for!  Your help is very much appreciated! Would you happen to have any resouces you can point me to for electrum console commands?  Thanks again for your assistance!

edit:  spelling
legendary
Activity: 2268
Merit: 18711
Does anyone know if this is possible and if so what the commands would be to do so in the electrum console?
Yes, it is possible and very simple.

Open the console and use the following command:

Code:
create(seed_type="standard")

This will create a new legacy wallet called "default_wallet". You can then open it as normal and view the seed phrase from the settings. Alternatively you can use the command:

Code:
create(seed_type="standard", wallet_path="PATH")

And change the word PATH to your desired path. This is useful if you already have a wallet file named "default_wallet". Alternatively number two, you can use the command:

Code:
make_seed(seed_type="standard")

To simply create a P2PKH seed phrase, which you can then use to create a new wallet.
member
Activity: 104
Merit: 120
My understanding is that there has not yet been a BIP to create a industry standard message signing process outside of P2PKH and that the current implementations for SEGWIT signatures is vendor specific.
member
Activity: 104
Merit: 120
Hi BlackHatCoiner,

Thank you for nothing the higher fees associated with P2PKH however I did know that.  In fact the reason I want to use the P2PKH address is for message signing as you also hit on.  P2PKH (AFAIK) is the only way one can verify that you truly have have control over the bitcoin associated with your the addresses in your wallets outside of actually sending the bitcoin to another address.  It's been explained to me that with SEGWIT addresses there is no standardized way for signing messages that can be used agnostically amongst the wallets out there (unlike P2PKH).

Hi Charles-Tim,

Thank you for the link!  Also my apologies for the question.  I meant to ask:

It was suggested from someone on the electrum wallet sub reddit that it may be possible to create an P2PKH HD wallet in the console for electrum in the current version.  Does anyone know if this is possible and if so what the commands would be to do so in the electrum console?

Thanks again all.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
I will have to research the Iancoleman html source on a text file option method you suggested but certainly appreciate the feedback.  What are your thoughts on  using Bitaddress dot org in lieu of this file?
Bitaddress.org will only generate you paper wallet, this is the link to Iancoleman, but it is better to use the source that I posted above, and never trust running it online because it is not safe at all. Or better use any open source wallet like Mycelium wallet to generate the BIP39 seed phrase and import it on electrum.

It was suggested from someone on the electrum wallet sub reddit that it may be possible to create an HD wallet in the console for electrum in the current version.  Does anyone know if this is possible and if so what the commands would be to do so?
I do not really understand this question, but Electrum wallet only generate HD wallet by default.

There aren't any reasons why you should use a legacy address beyond signing a message.
Even segwit addresses can be used to sign a message. But, the only reason I think it can be used is because some sites will only demand for legacy address for payment, while some may truly only even demand for legacy address for Bitcoin address message verification.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Thanks for your quick and reply.  It's quite disappointing that there is seemingly no easy way to create a P2PKH HD wallet in the current version of Electrum.  I guess I can always install the version you recommend however it's concerning as those versions are old and moving forward could theoretically have some kind of issue found with them that aren't updated properly.
Actually, P2PKH could be characterized as an “issue” here.  Tongue

I don't know if you're aware of it, but transactions containing legacy addresses will result in a higher fee comparing with segwit. There aren't any reasons why you should use a legacy address beyond signing a message. If we all used Segwit Native instead, we could fill more transactions into one block.

And note that electrum hasn't disabled its P2PKH usage; you can still use it. The fact that it doesn't pop it to you when you want to generate a new wallet is due to their proper recommendation.
member
Activity: 104
Merit: 120
BlackHatCoiner,

Thanks for your quick and reply.  It's quite disappointing that there is seemingly no easy way to create a P2PKH HD wallet in the current version of Electrum.  I guess I can always install the version you recommend however it's concerning as those versions are old and moving forward could theoretically have some kind of issue found with them that aren't updated properly.


Charles-Tim,

Thank you as well.  I will have to research the Iancoleman html source on a text file option method you suggested but certainly appreciate the feedback.  What are your thoughts on  using Bitaddress dot org in lieu of this file? 

Also I was looking to get it online rather than offline but the offline information is still certainly appreciated in your reply. 

All,

It was suggested from someone on the electrum wallet sub reddit that it may be possible to create an HD wallet in the console for electrum in the current version.  Does anyone know if this is possible and if so what the commands would be to do so? 

Thanks to all for your replies and feedback.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
1) Is it possible to create an HD wallet with P2PKH in the current version of Electrum and if so how? 
No. But I will suggest you to run Iancoleman html source on a text file on an airgapped device to generate the HD wallet for legacy addresses. Make sure the derivational path is BIP44 which is also default. And import the seed phrase generated on Electrum wallet.

On Electrum wallet, click on next > standard wallet > I already have a seed > import the seed phrase > check the BIP39 box > click on next > select P2PKH (legacy) > click on next. The wallet will sychronize with the blockchain and you are ready to use your legacy wallet on Electrum wallet. Backup your seed phrase, note that the seed phrase is not stored on Electrum wallet.

2) What is the best way to import a P2PKH paper wallet into Electrum's current version.
It depends, did you want to let it remain offline like on Electrum cold storage or you want it to be online like normal online Electrum wallet.

Click on next,  import Bitcoin private keys and addresses, use the QR code or paste the private key and click next. The wallet will sychronize with the blockchain and your funds will be seen on the balance.

For cold storage, you will get good information from belowlink:
https://electrum.readthedocs.io/en/latest/coldstorage.html

You can't same like with segwit in the current version if that's what you want. In version 4.0.4 (that I'm using) it allows you to create a new wallet using Legacy addresses instead:
This option can be used to achieve a legacy HD wallet on Electrum, but we need to have an updated version which I think is the best.

Why legacy?

Did you know you can save up to 42% to 52% fee while using segwit? Yes you can. I do not see any good reason why some people just want to stick to the old way by using legacy bitcoin address.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
1) Is it possible to create an HD wallet with P2PKH in the current version of Electrum and if so how?
You can't same like with segwit in the current version if that's what you want. In version 4.0.4 (that I'm using) it allows you to create a new wallet using Legacy addresses instead:


2) What is the best way to import a P2PKH paper wallet into Electrum's current version.
What is the features consisted of a way that makes it “best”? The simplest and probably most recommended way to import a P2PKH address into your electrum would be by clicking “File” --> “New/Restore” --> name your wallet file --> Next --> “Import Bitcoin addresses or private keys” --> enter there the P2PKH private key and hit “Next” and “Next”.

member
Activity: 104
Merit: 120
Hello all,

I'm relatively new to Electrum and I just downloaded it and setup a new wallet which as you likely know defaults to native SEGWIT address formats.  Unfortunately the only way I can see how to create P2PKH addresses in the current version is to dump the bc private keys then create a new wallet within electrum and have the private key loaded with a P2PKH: prefix on the private key when restoring from a seed.

What I'd like to know is how can I go about creating a HD wallet with P2PKH from Electrum rather than SEGWIT defaults.  I don't want to load P2PKH seeds individually the way I described above as this too labor intensive and honestly feels insecure using a hot computer that can potentially have spyware on it / key loggers. 

In addition to this, I'd like to also find out what the best way to import (not sweep) a P2PKH paper wallet into Electrum.  So really two questions:

1) Is it possible to create an HD wallet with P2PKH in the current version of Electrum and if so how? 

and

2) What is the best way to import a P2PKH paper wallet into Electrum's current version.

Thank you.
Jump to: