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:
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:
Keep this one safe. A private key should be kept, well, private, or you risk losing your coins!
This post is open source. Did you spot a mistake? Ideas for improvements? Contribute to this post via Github. Thank you!