Import privat kljuceva


SUBMITTED BY: Guest

DATE: Aug. 25, 2012, 9:45 p.m.

FORMAT: Text only

SIZE: 2.9 kB

HITS: 1611

  1. Start Bitcoin client
  2. Unlike third-party wallet.dat manipulation tools such as Pywallet, you do not have to close the Bitcoin client before proceeding. Instead, you need to start the bitcoind server.
  3. Close bitcoin-qt and start bitcoind -damon in Terminal Emulator. The version of bitcoind MUST be the same as bitcoin-qt!
  4. Bitcoin-QT does not enable its RPC interface by default. To enable it:
  5. Close Bitcoin-QT and restart it with bitcoin-qt -server.
  6. Unlock your wallet
  7. If you have an encrypted wallet (recommended), you need to unlock it temporarily before importing private keys. The RPC command for unlocking an encrypted wallet is walletpassphrase <passphrase> <timeout>. Typing this directly in a bash terminal will leave your wallet passphrase directly in the bash history but there are a couple of techniques you can use to avoid this. Simply add a space before the command:
  8. (space)bitcoind walletpassphrase yourpassphrase 120
  9. Another alternative is to use a bash variable:
  10. read x
  11. (input your passphrase)
  12. bitcoind walletpassphrase "$x" 120 # Do not set the timeout too long or too short.
  13. Import Private key(s)
  14. The last command unlocked your wallet temporarily for 120 seconds, during which time you must import your private keys. Since private keys can be as important as your passphrase, you may want to use the same techniques as above to prevent their being recorded in bash history (bash variable or space before the command):
  15. (space)bitcoind importprivkey "5yourveryveryveryverylongprivatekeystring" "my-new-key" # "my-new-key" is a label for the key/address pair and is optional
  16. The importing process is now started. Bitcoind will rescan the entire block data to ensure this key has not been used before. This process will take from one to two minutes, depending on your CPU performance. DO NOT abort it before finishing!
  17. If no errors occurs, the import is a success and Bitcoin-QT users will be able to see the new address in the GUI immediately. If you need to import more keys, just repeat the instructions above. There is currently no command to import a batch of private keys so you will need to wait a minute or two for each key to be imported.
  18. Cleaning up
  19. bitcoind walletlock
  20. This will lock your wallet again (so you don't have to wait for timeout)
  21. unset x
  22. unset y
  23. These commands will clear the passphrase and private key from memory if you used the read technique. If you started bitcoind, you will need to stop it before Bitcoin-QT will start again:
  24. bitcoind stop
  25. Deleting Keys
  26. At some point, you may wish to delete private keys from a wallet.dat file but as of version v0.6.0 of Bitcoin-QT/bitcoind, there is no RPC method available for this purpose.

comments powered by Disqus