Pages:
Author

Topic: [PULL] private key and wallet export/import - page 10. (Read 39497 times)

full member
Activity: 123
Merit: 100
Now, I just had another thought that maybe deserves its own post.

Why not create code that allows bitcoin to create a new address (not from the pool), then send some specified number of coins to that address, then dump the private key to screen, and then delete all trace of that private key from the computer - no saving it to disk at any time, not even permitting the OS to swap it out to disk.

Users would then have to take adequate steps to ensure they doesn't lose that key.

Obviously, there would have to be flashing black and yellow warning screens, telling the user that if they don't securely save the key that's now on screen, they'll lose their coins.

Thoughts?

Or (and that's doable ATM) :

1. Encrypt the wallet.dat with OpenSSL, using a passphrase only :
openssl aes-256-cbc -a -salt -in wallet.dat -out wallet.dat.enc

2. Store the wallet.dat.enc (and its sha1 preferably) in various places : USB keys, portable media players, external hard drives, you can even email it to yourself !

3. If needed, get the wallet.dat back with :
openssl aes-256-cbc -d -a -in wallet.dat.enc -out wallet.dat

This method is really straightforward, you can put your wallet in several independent locations, and you don't have to keep a private key or something. Just a passphrase. This is imho the method that has the best security and reliability / complexity ratio. If you use bcrypt instead of OpenSSL, it's even simpler : bcrypt wallet.dat to encrypt, bcrypt wallet.dat.enc to decrypt.  Grin
legendary
Activity: 1652
Merit: 2216
Chief Scientist
Thoughts?

That'd be exactly when the power goes out.
sr. member
Activity: 440
Merit: 250
Now, I just had another thought that maybe deserves its own post.

Why not create code that allows bitcoin to create a new address (not from the pool), then send some specified number of coins to that address, then dump the private key to screen, and then delete all trace of that private key from the computer - no saving it to disk at any time, not even permitting the OS to swap it out to disk.

Users would then have to take adequate steps to ensure they doesn't lose that key.

Obviously, there would have to be flashing black and yellow warning screens, telling the user that if they don't securely save the key that's now on screen, they'll lose their coins.

Thoughts?
sr. member
Activity: 440
Merit: 250
This is great work.

Now I have a better idea on how to do wallet backup.

1. Set up a directory on a usb key (256MB should be enough), and start bitcoin pointing to that directory, with no keypool. 
2. Generate as many addresses as you need with that client - e.g. suppose you have 100BTC and you want to store 5BTC in each address, then you'll need 20 addresses.
3. Now, with your main bitcoin client, send these 1BTC to each of those 20 addresses.
4. Watch the bitcoins roll into your usb-based client.
5a. Now dump all the private keys with these new functions,
5b. encrypt them with good software and a good passphrase
5c. (optionally append each of them to 1kb of random data, to get extra entropy)
5d. store the sha256 hash of the unencrypted and encrypted data
5e. Now save the encrypted data, and the two has functions.
5f. Make lots of copies, print them out & photograph them, upload the photos to flickr... whatever.  uuencode it and store the text on your bookshelf if you like.  Store the digital copies on your desktop, laptop, usbkeys, cellphone, dropbox, freenet, everywhere.
6. Now the important bit: you MUST erase all data on the usb key.
7. Better still, destroy the usb key 'cos good usb keys will do block remapping, so even if you wipe the key with random data, reformat and so on, you'll never be quite sure that some clever hacker can't extract one or more of your keys.

Result:
Now, anytime you need 5btc, you just need to recover one of those encrypted private keys, whether it's in an image, or if you have to type out a few pages of uuencoded data.  Then decrypt, check the hash, take the last 51 characters, and import the key into your day-to-day client.

Of course, this is all a bit excessive for just 100BTC, but who knows, given recent trends in USD/BTC, we may well soon reach the stage that even 100BTC need to be securely protected.
legendary
Activity: 1072
Merit: 1174
See https://github.com/bitcoin/bitcoin/pull/220

Introduces four new RPC calls:
* dumpprivkey: retrieve the private key corresponding to an address
* importprivkey: add a private key to your wallet
* dumpwallet: export the contents of your wallet in various ways
* importwallet: import/merge a dumped wallet into your own

The private key format is analoguous to the address format. It is
a 51-character base58-encoded string, that includes a version number
and a checksum.

The wallet format is JSON-based, and includes:
* addresses (informational, optional)
* private keys
* amounts and balances per address (informational, optional)
* blocks where addresses were first used (optional)
* ids of transactions in which addresses were credited (optional)
* labels (optional)

It specifically does not contain:
* sender address book
* settings
* account information
* unconfirmed wallet transactions

I will post a full specification of the dump file format soon.

Earlier posts:
* Hal's challenge: https://bitcointalksearch.org/topic/prize-for-importing-private-key-won-3638
* Early discussion of dump format: https://bitcointalksearch.org/topic/wallet-importexport-bitkeys-format-4448
* Early patch with only private key export and import: https://bitcointalksearch.org/topic/patch-dumpprivkey-and-importprivkey-rpc-commands-3906
Pages:
Jump to: