Published by Simon Schoeters

Public & private keys for a Bitcoin address

Every Bitcoin address has a public and private key. These matching keys are derived from the address using mathematical operations. You don't need to know the keys of an address for a simple transaction using one of the wallets; the keys are used but hidden from the user.

Sometimes you might need them, though. Say you want to release the funds in a multisig address, for example, until the popular clients add better support for multisig transactions.

But how do you find the keys associated with an address?

Using the Bitcoin Core (previously named Bitcoin-Qt) client, you open the ‘Debug window’ and switch to the ‘Console’ tab. Use the prompt to inspect an address:

validateaddress misCbzYUNyWGci7zzGB4hRJEDatwApdnvH
  "isvalid" : true,
  "address" : "misCbzYUNyWGci7zzGB4hRJEDatwApdnvH",
  "ismine" : true,
  "isscript" : false,
  "pubkey" : "0329e8a14994ec7ce9..42fe42765bd4112",
  "iscompressed" : true,
  "account" : ""

This first command (validateaddress) will list some bits of information about the address; one of them is the public key.

The second one, dumpprivkey, gives you the private key:

dumpprivkey misCbzYUNyWGci7zzGB4hRJEDatwApdnvH

Keep this one safe. A private key should be kept, well, private, or you risk losing your coins!