- How to import private keys
- Contents
- Using Blockchain.info
- Using BIPS
- Using Mycelium
- Partial spend from cold storage
- Import key from a paper wallet
- Using bitcoind
- Start Bitcoin client
- Unlock your wallet
- Import Private key(s)
- Cleaning up
- How to import private keys
- Contents
- Start Bitcoin client [ edit ]
- Unlock your wallet [ edit ]
- Import Private key(s) [ edit ]
- Cleaning up [ edit ]
- Deleting Keys [ edit ]
- Another ways [ edit ]
- Using Blockchain.info [ edit ]
- Using BIPS [ edit ]
- Using Mycelium [ edit ]
- Partial spend from cold storage [ edit ]
- Import key from a paper wallet [ edit ]
- Using bitcoind [ edit ]
- Wallet import format
- Contents
- Private key to WIF [ edit ]
- WIF to private key [ edit ]
- WIF checksum checking [ edit ]
- Backing up my wallet
How to import private keys
Before reading this page, users should note that messing with ECDSA private keys is very dangerous and can result in losing bitcoins, even long after the import. It is recommended that outside of self-generated vanity addresses, users should never import (or export) private keys. [1] [2]
Contents
Using Blockchain.info
As of August 2012, possibly the easiest way to import a private key is using Blockchain.info’s My Wallet service. When successully imported through the «Import/Export» screen, the bitcoins assigned to a private key can be immediately sent to any Bitcoin address. It is extremely risky and not recommended to use Blockchain.info or any online third-party service to import private keys, because they can steal your BitCoins if they have the keys. It’s best to import them using bitcoind as described below.
Using BIPS
As of August 2013, BIPS allows for easy import of private key using Paper Wallet — Import. User can choose to type in the private key manually or scan a QR code containing the private key using the camera. The user must wait 6 confirmations for access to the funds, and system is based on batch importation. It is extremely risky and not recommended to use BIPS or any online third-party service to import private keys, because they can steal your BitCoins if they have the keys. It’s best to import them using bitcoind as described below.
Using Mycelium
Steps described are with the following settings:
- Export mode enabled
- Aggregated view disabled
Partial spend from cold storage
Use this function if you would like to keep some funds on the paper wallet.
- Download Mycelium from the Android Play Store or through iTunes.
- Press the menu button and select «Cold Storage»
- Scan in private key
- Select your destination address
- Select the amount
- Press the blue currency tag at the top to toggle currency.
- Send!
After spending, the private key in memory is destroyed so the paper private key remains somewhat secure. Despite this, best practice is to immediately send the remaining balance to a paper wallet that was generated offline.
Import key from a paper wallet
Use this function if you would like to import a private key so all funds are immediately available for spending.
- Download Mycelium from the Android Play Store or through iTunes.
- Key Management
- Press the blue ‘+’ symbol
- Scan in private key
After importing this paper private key, you might consider destroying the original so it cannot be found and your funds stolen. Alternatively, you can keep it safe to be used as an offline backup.
Using bitcoind
If you have Version 7 or later it is now trival. See: How to import private keys v7+
If you are using Cold storage, a Paper wallet or generating vanity addresses you may have a need to import a Private key. Since Bitcoin-QT/bitcoind v0.6.0, you can import private keys using built-in RPC command importprivkey. Before v0.6.0, you needed to rely on third-party wallet.dat manipulation tool such as Pywallet.
This article describes how to import a private key through the RPC API of bitcoind, which is a topic for advanced users.
Note that importing a key to bitcoind and/or Bitcoin-Qt may be dangerous and is not recommended unless you understand the full details of how it works
Start Bitcoin client
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.
- Close bitcoin-qt and start bitcoind -daemon in Terminal Emulator. The version of bitcoind MUST be the same as bitcoin-qt!
Bitcoin-QT does not enable its RPC interface by default. To enable it:
- Close Bitcoin-QT and restart it with bitcoin-qt -server.
Unlock your wallet
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
. 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:
Another alternative is to use a bash variable:
Import Private key(s)
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):
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!
To avoid rescanning run the following.
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.
Cleaning up
This will lock your wallet again (so you don’t have to wait for timeout)
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:
Источник
How to import private keys
Enjoyed the article? Share:
Note that messing with ECDSA private keys is very dangerous and can result in losing bitcoins, even long after the import. It is recommended that outside of self-generated vanity addresses, users should never import (or export) private keys. [1]
Contents
Before getting started with importing your wallet’s private keys, let’s clarify three important definitions.
- Backup: A file containing a wallet’s private key information. Backups can be exported from a wallet or imported to a wallet.
- Export: The process of creating a file containing a wallet’s private key data. Exported keys can be imported to a new/different wallet to give access to the Bitcoins (Bitcoin Core, BTC) associated with the exported private key(s).
- Import: The process of gaining control of BTCs via an exported backup. Wallets can import private keys via text files or QR code scanning.
Start Bitcoin client [ edit ]
Note that importing a key to bitcoind and/or Bitcoin-Qt may be dangerous and is not recommended unless you understand the full details of how it works
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.
- Close bitcoin-qt and start bitcoind -damon in Terminal Emulator. The version of bitcoind MUST be the same as bitcoin-qt!
Bitcoin-QT does not enable its RPC interface by default. To enable it:
- Close Bitcoin-QT and restart it with bitcoin-qt -server.
Unlock your wallet [ edit ]
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
. 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:
Another alternative is to use a bash variable:
Import Private key(s) [ edit ]
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):
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!
To avoid rescanning run the following.
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.
Cleaning up [ edit ]
This will lock your wallet again (so you don’t have to wait for timeout)
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:
Deleting Keys [ edit ]
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 [2] .
Another ways [ edit ]
Using Blockchain.info [ edit ]
As of August 2012, possibly the easiest way to import a private key is using Blockchain.info’s My Wallet service. When successully imported through the «Import/Export» screen, the bitcoins assigned to a private key can be immediately sent to any Bitcoin address.
Using BIPS [ edit ]
As of August 2013, BIPS allows for easy import of private key using Paper Wallet — Import. User can choose to type in the private key manually or scan a QR code containing the private key using the camera. The user must wait 6 confirmations for access to the funds, and system is based on batch importation.
Using Mycelium [ edit ]
Steps described are with the following settings:
- Export mode enabled
- Aggregated view disabled
Partial spend from cold storage [ edit ]
Use this function if you would like to keep some funds on the paper wallet.
- Download Mycelium from the Android Play Store or through iTunes.
- Press the menu button and select «Cold Storage»
- Scan in private key
- Select your destination address
- Select the amount
- Press the blue currency tag at the top to toggle currency.
- Send!
After spending, the private key in memory is destroyed so the paper private key remains somewhat secure. Despite this, best practice is to immediately send the remaining balance to a paper wallet that was generated offline.
Import key from a paper wallet [ edit ]
Use this function if you would like to import a private key so all funds are immediately available for spending.
- Download MyCelium from the Android Play Store or through iTunes.
- Key Management
- Press the blue ‘+’ symbol
- Scan in private key
After importing this paper private key, you might consider destroying the original so it cannot be found and your funds stolen. Alternatively, you can keep it safe to be used as an offline backup.
Using bitcoind [ edit ]
If you have Version 7 or later it is now trival. See: How to import private keys v7+
Источник
Wallet import format
Enjoyed the article? Share:
Wallet Import Format (WIF, also known as Wallet Export Format) is a way of encoding a private ECDSA key so as to make it easier to copy.
A testing suite is available for encoding and decoding of WIF at: http://gobittest.appspot.com/PrivateKey
Contents
Private key to WIF [ edit ]
1 — Take a private key
2 — Add a 0x80 byte in front of it for mainnet addresses or 0xef for Testnet addresses. Also add a 0x01 byte at the end if the private key will correspond to a compressed public key
3 — Perform SHA-256 hash on the extended key
4 — Perform SHA-256 hash on result of SHA-256 hash
5 — Take the first 4 bytes of the second SHA-256 hash, this is the checksum [1]
6 — Add the 4 checksum bytes from point 5 at the end of the extended key from point 2
7 — Convert the result from a byte string into a base58 string using Base58Check encoding. This is the Wallet Import Format
WIF to private key [ edit ]
1 — Take a Wallet Import Format string
2 — Convert it to a byte string using Base58Check encoding
3 — Drop the last 4 checksum bytes from the byte string
4 — Drop the first byte (it should be 0x80). If the private key corresponded to a compressed public key, also drop the last byte (it should be 0x01). If it corresponded to a compressed public key, the WIF string will have started with K or L instead of 5 (or c instead of 9 on testnet). This is the private key [2] .
WIF checksum checking [ edit ]
1 — Take the Wallet Import Format string
2 — Convert it to a byte string using Base58Check encoding
3 — Drop the last 4 checksum bytes from the byte string
3 — Perform SHA-256 hash on the shortened string
4 — Perform SHA-256 hash on result of SHA-256 hash
5 — Take the first 4 bytes of the second SHA-256 hash, this is the checksum
6 — Make sure it is the same, as the last 4 bytes from point 2
7 — If they are, and the byte string from point 2 starts with 0x80 (0xef for testnet addresses), then there is no error.
Источник
Backing up my wallet
As we have no control over users’ wallets or their private keys, it is very important that you create a secure backup of your Bitcoin.com wallet.
If you were to lose or break your device, the only way to recover your Bitcoin.com wallet and the funds held within is with your 12-word backup phrase.
As long as you have written down and secured your 12-word recovery phrase, you will always be able to restore your wallet and any BCH/BTC funds stored within. If you have not yet written down your backup phrase or have lost it, please do so now while you still have access to your wallet.
If you do not have your recovery phrase written down, there is nothing Bitcoin.com can do to help recover the wallet or funds for you.
It is up to the user to make sure they have their wallet backed up and the recovery phrase kept safe.
Make sure to store your backup phrase in a very secure location, such as with passports, birth certificates, real estate titles, and other precious documents.
To find your 12-word recovery phrase please follow the steps below:
1. Open your Bitcoin.com wallet application.
2. Select the wallet you wish to back up, BTC or BCH
3. Tap on the red «wallet not backed up» text to proceed directly to the backup stage.
(If you do not see this text, please tap to the settings cog in the top right of the screen, and then on «Backup»)
4. Follow the on-screen instructions to start the backup process.
5. Write down the 12 words on a sturdy piece of paper. Your 12-word recovery phrase will be displayed reading from left to right, top to bottom.
6. Once you have written down all 12 words tap on «I’ve written it down» and then re-enter the words back in the same order to confirm you have it correct.
7. If you have followed all instructions correctly it will now say «Your bitcoin wallet is backed up» Read the warning and tap «got it».
Your Bitcoin.com Wallet is now backed up!
Please note that if you create any new sub-wallets within your Bitcoin.com wallet application, you will have to back these up separately.
Since Bitcoin.com has no access to users’ wallets, we cannot help recover wallets or funds if the user has failed to back up their wallet.
IMPORTANT: Make sure to store your backup phrase(s) someplace you know for certain it will be safe. Treat it as a very valuable possession and store it with other documents such as birth certificates, passports, real estate titles, etc.
Источник