2

What is the correlation between ckey, mkey and a private key in bitcoin? How can I retrieve my lost private key from ckey and mkey?

1 Answer 1

2

ckey is an encrypted private key. mkey is an encryption key for ckeys that is encrypted using your passphrase.

This answer describes the format of mkey records.

ckey have a key of the string ckey followed by the public key. The value contains the encrypted private key followed by the checksum which is the SHA256 of the encrypted private key. The encrypted private key is 32 bytes. It is AES-256-CBC encrypted, with an IV of the first 16 bytes of the SHA256 of the public key.

4
  • Thanks you I understand it a bit more now. Please tell me is there a way to found my private key using this knowledge? Commented Aug 27, 2022 at 10:29
  • If have a ckey record, the mkey for that ckey, and the passphrase for the mkey, then yes you can get your private key by doing the decryption.
    – Ava Chow
    Commented Aug 27, 2022 at 15:56
  • That's an amazing answer! What is the last sentence about "IV"? Can you extend this sentence?
    – pbies
    Commented Jan 23, 2023 at 1:31
  • 1
    @pbies There isn't much to expand.. IV stands for Initialization Vector, it's one of the parameters to AES for encrypting or decrypting something.
    – Ava Chow
    Commented Jan 23, 2023 at 3:40

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.