1

In multibit, you can export the private keys from a wallet into a basic text document (*.key).

It will look something like this:

# KEEP YOUR PRIVATE KEYS SAFE !
# Anyone who can read this file can spend your bitcoin.
#
# Format:
#   <Base58 encoded private key>[<whitespace>[<key createdAt>]]
#
#   The Base58 encoded private keys are the same format as
#   produced by the Satoshi client/ sipa dumpprivkey utility.
#
#   Key createdAt is in UTC format as specified by ISO 8601
#   e.g: 2011-12-31T16:42:00Z . The century, 'T' and 'Z' are mandatory
#

KyBn........................................... 2014-06-06T04:26:48Z

# End of private keys

[The series of dots is the key, but I censored out the majority of it.]

I have read this post on a similar question, but I am confused about one particular thing: If I have some transactions after the export, more or new private keys will be created, which will mean that I can no longer depend on this set of private keys to regain access to the funds. Is this correct?

My main question is, how exactly can I recover the funds for a particular address with only this private key (or set of private keys) (not specifically in multibit, but generally)? Do all clients and online wallets have an import private key option? What is done behind the scenes with this private key to find the public key and the address?

1 Answer 1

3

If I have some transactions after the export, more or new private keys will be created, which will mean that I can no longer depend on this set of private keys to regain access to the funds. Is this correct?

If you create a new address, you create a new private key, and (with MultiBit's model) you need to backup your private keys again, because there's a new private key added to the list. If you reuse the same address in new transactions (which is possible, but usually not recommended for privacy reasons), you don't need to rebackup your keys.

My main question is, how exactly can I recover the funds for a particular address with only this private key (or set of private keys) (not specifically in multibit, but generally)? Do all clients and online wallets have an import private key option?

Most, if not all, clients/wallets have an ability to import private keys. However, there are a few different formats out there, so if the question is, "can Wallet X read this private key directly?", the answer's not as clear. But I think it is safe to say that you'll always be able to find something to read your MultiBit backup and send the money to a new address.

What is done behind the scenes with this private key to find the public key and the address?

The private key (which is a 256-bit number) is multiplied by the base point, which is a point on Bitcoin's elliptic curve. This is done with some fairly complicated mathematical calculations. The result is the public key, which is another point on the elliptic curve. To calculate the address from the public key, you follow an algorithm with various hashings and a checksum. This is detailed at the Bitcoin wiki, which can be represented by this pseudocode:

160_hash = RIPEMD-160(SHA256(public key))
double_hash = SHA-256(SHA-256(0x00 + 160_hash))
address = base58(160_hash + double_hash[0:4])

To sum up, private key -> public key, and public key -> address are easy, while the reverse of each of this is (believed to be) practically impossible.


The most important part to take away from all this, is that one private key corresponds to one address. If you generate a new address, you have a new private key, and need to make sure it's backed up!

2
  • I think there is one further issue that needs to be clarified. Is the private key in this file WIF encoded or something else? It sure doesn't look like the hex representation of a 256-bit integer. Jun 6, 2014 at 20:02
  • @FelipeVoloch You're right that it's definitely not hex. The K indicates that it's a private key for a compressed public key. I think that WIF keys always start with 5, so not that.
    – Tim S.
    Jun 6, 2014 at 20:15

Your Answer

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