How do I get my private key?

1

Background

I saw this on the internet

enter image description here

I didn't think signing / verifying was possible with P2SH addresses, so I guess this wallet must be using something like signmessagewithprivkey
¯\_(ツ)_/¯

Anyway, with signmessagewithprivkey "privkey" "message", privkey is required and doesn't provide a default.

Actual Question

How do I get (see) my private key?

toddmo

Posted 2018-04-22T23:59:54.090

Reputation: 674

1

Additionally, this looks like the Trezor interface. From what I recall, they have a non-standard segwit address message signature, which isn't supported or verifiable by other clients. There is some discussion on standardising to Trezor's implementation here: https://github.com/spesmilo/electrum/issues/3861

Raghav Sood 2018-04-23T00:39:08.427

@RaghavSood, being able to verify the owner of some funds is very important. When we went to segwit that fell through. I understand, technical reasons, but the business need remains.toddmo 2018-04-23T01:01:25.813

Answers

2

That depends on what type of P2SH address it is. Only some P2SH script types actually have a one-to-one relationship with a private key. The most common case is probably embedded segwit. If its a P2SH-P2WPKH address, you can retrieve the public key from the embedded P2WPKH script using the dumpprivkey RPC command.

MeshCollider

Posted 2018-04-22T23:59:54.090

Reputation: 8 735

lol I never would have guessed that. To me, dump and get are very different. Thank you!toddmo 2018-04-23T00:52:29.973

Shucks. signmessagewithprivkey worked with P2SH address, but verifymessage still throws an error with the address used in signmessagewithprivkey and the resulting signature. Should I ask another question or is verifymessage just going to be impossible with P2SH?toddmo 2018-04-23T00:58:59.243

verifymessage tries to use the private key corresponding to the address it is given, but again, P2SH addresses don't always have private keys so it won't work. Unfortunately there is no equivalent of "verifymessagewithprivkey" to my knowledgeMeshCollider 2018-04-23T04:34:23.420

lol exactly. if I had the private key, I would not have to verify that the owner of the public key can spend the funds. So I don't guess verifymessagewithprivkey would do me any good. Back to the drawing board it is!toddmo 2018-04-23T17:51:15.630

Sorry I meant "verifymessagewithpubkey" lol, the public key would be required for verificationMeshCollider 2018-04-24T02:10:15.293