Managing private keys

Using the importprivkey and dumpprivkeys functions in ckd it is possible to back up your raw private keys and import them into another ckd instance.

Exporting private keys

If you wanted to retrieve the private key for the account mining in your wallet you would write:

~$ ./ckd dumpprivkeys mining
Please enter your wallet passphrase: ********
{
	"BEe1rQmiLfyVKfXo36Qw4D5u9J603jRDwtdiDEl0cwUF7mJwpDf66Ui8mECxCTCfbZHeDh4ZTXFTQOyHO0a6v4w=" : "4V7unMJ3gwZ6gaRU1rL5hUfVnh13daE1yLcKC8CIXVY="
}

The first value is the address (public key) and the second value is the private key. Private keys should be kept secret as knowledge of them allows you to spend any funds associated with them. However, it is important to back up your private keys because if you lose them you permanently lose access to your coins.

Importing private keys

A private key can be imported into another wallet using importprivkey as follows:

~$ ./ckd importprivkey myimportedkey 4V7unMJ3gwZ6gaRU1rL5hUfVnh13daE1yLcKC8CIXVY=
Please enter your wallet passphrase: **********
{
	"balance" : 0,
	"keys" : 
	[
		{
			"privKey" : 
			{
				"cipherText" : "aRg12joSDWJPzrxBHkxIyyOENBzzauvE0llDScD0pwGNRzGo32rSy9YY+yWofpQJ",
				"iv" : "vUMrDpn7BWkL5pIGwYNsDA==",
				"salt" : "1WBrjPlcDsPpaey+cQHSwDRXFwIi5lAdEtE6d9M/nRY="
			},
			"pubKey" : "BG/IPGCjFt8XhXXXWvGqRhncnViBcFKeTxBQuO9PlHzPSt0Hq7j5k0hItyZL8ntg2xIeZBDPT5TBOOugUJFM0yI="
		},
		{
			"privKey" : 
			{
				"cipherText" : "FbBLalreZGaXA4ImH5iEeUadtTCM7/W54Mlh7842gtC7nEn896zeJrx8xcasNiya",
				"iv" : "aJT6PULXZnVcloU5QzeVwA==",
				"salt" : "s2oVjrBVlIszRUT96QJfxbiYvXrQNKcQh5TPFzikiV4="
			},
			"pubKey" : "BEe1rQmiLfyVKfXo36Qw4D5u9J603jRDwtdiDEl0cwUF7mJwpDf66Ui8mECxCTCfbZHeDh4ZTXFTQOyHO0a6v4w="
		}
	],
	"name" : "myimportedkey"
}

This will add the given private key to the given account name, or create a new account with that name if it does not already exist. The command will also trigger the wallet to rescan the blockchain to find any coins presently spendable with the private key.