2

With the probable increase in demand for multi-sig (P2SH) addresses, and since the procedure for creating such addresses requires that each participant provides the uncompressed public key for an address under their control, I find it surprising hard to find documentation on how to export the public key of a bitcoin address.

So for the benefit of future searches: How exactly to you get the public key for an existing address for which you have a private key in bitcoin-qt?

2 Answers 2

6

And the answer is:

  1. copy the address in question from your "Receive" address list
  2. Help -> Debug window -> Console
  3. type: validateaddress <address>

where <address> is the address you copied in step 1.

The command validateaddress will output a number of key-value pairs, one of them being "pubkey".

Edit: bitcoin-qt creates compressed keys (as you can check in the iscompressed key-value). If you need uncompressed keys you can use something like https://coinb.in/

1

I'd like to give a general answer that can apply to any wallet. As long as you have the private key, you can get the public key easily.

You can convert any private key to a public key using pybitcointools. After you install pybitcointools using pip install pybitcointools, simply run python and issue the following commands:

import bitcoin
bitcoin.privtopub('57c617d9b4e1f7af6ec97ca2ff57e94a28279a7eedd4d12a99fa11170e94f5a4')

Of course, you will have to replace your private key in the above statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.