Trying to import a private key into bitcoind


I was trying to import a private key into my wallet, and kept getting a generic error message:

$ bitcoind importprivkey $x mywallet
error: {"code":-4,"message":"Error adding key to wallet"}

I thought maybe the key I was using was in the wrong format, or that my wallet already had the key imported. But it turned out I just needed to supply the wallet passphrase first:

$ bitcoind walletpassphrase "$y" 60
$ bitcoind importprivkey $x mywallet

It would be better if the error message could be more specific: "Error adding key to locked encrypted wallet", for example.

If I try to add the key again, I get the same error message. This time I'd prefer to see "Key already exists in...

0 0

To change the GnuPG behaviour on what key it selects on signing/encryption, use the default-key configuration parameter with the key ID as the value.

So, for example, with

$ gpg --list-secret-keys /home/gert/.gnupg/secring.gpg ----------------------------- sec 4096R/13371337 2011-01-01 [expires: 2014-01-01] uid Gert van Dijk (1st key) ssb 4096R/31337313 2011-01-01 sec 4096R/12345678 2013-04-23 [expires: 2014-01-01] uid Gert van Dijk (2nd key) ssb 4096R/87654321 2013-04-23

add a line in ~/.gnupg/gpg.conf:

default-key 12345678

or, alternatively, use the long key ID (recommended as short key IDs can have collisions):

$ gpg --list-secret-keys --with-colon sec::4096:1:ABCDEFAB12345678:2013-01-01:2014-01-01:::Gert van Dijk (2nd key) :::

and add a line in ~/.gnupg/gpg.conf:

0 0

On encoding private keys from Bitcoin-core as QR codes for use in paper wallets, other wallet software, etc …

Note: Breadwallet will not import the private key upon scanning the qr code. It will offer to transfer the funds in that address to your breadwallet keyring.

Breadwallet, an awesome open source iOS bitcoin SPV client, allows you to import a private key for use within breadwallet. So, if you’re a user of bitcoin-core, and want to be able to spend some of your funds you have there with breadwallet, you’ll need to create a QR code of your private key to scan it with breadwallet.

Install qrencode

This tutorial uses qrencode, an open source string to QR converter. The source can be found here:

Alternatively, you can install qrencode on ubuntu/debian through repositories

sudo apt-get install qrencode

Then, as of bitcoin-core version 0.11.0 you’ll need to run bitcoind rather than the GUI...

0 0

Many such warnings appear to address more complex situations beyond bitcoind's scope. In this case, there can be many situations in which a weak key (e.g. from a brainwallet with bad password), or leaked key (suspicious origin, or generated by someone else) might be imported into bitcoind.

For example, the following may happen (with sample keys, of course):

5KVFiYbW5qbFfuDwrhPdsA3ALH3PmrEdQnQrpDWrqpygncbpPY4 is generated insecurely someplace (used on a physical coin, or otherwise bad origin), translating to address 1CD2nyv22gAGs8GAsdNa1rW3KinkCHgTFd. User imports 5KVFiYbW5qbFfuDwrhPdsA3ALH3PmrEdQnQrpDWrqpygncbpPY4 and uses it in their wallet, as 1CD2nyv22gAGs8GAsdNa1rW3KinkCHgTFd in the UI. Dumpster-diver digs up improperly-erased hard disk owned by FooPhysicalCoinForge, digs up 5KVFiYbW5qbFfuDwrhPdsA3ALH3PmrEdQnQrpDWrqpygncbpPY4 and sweeps it. Even if the address had 1 BTC on it originally and received 20BTC more, the attacker now has access to all of the funds received...
0 0
0 0

Feathercoind uses the open source Bitcoind protocol to provide a distributed currency network. All of the features of the fundamental client are common to Bitcoind, Litcoind or Feathercoind.

This is a Mode of Failure analysis of Bitcoin & Litecoin reported faults, from various intermediate versions of the protocol up to 0.8.5.


As a note, to new members interesting in setting new services or some such, any document or guide for Litecoin or various other scrypt currency can also be adapted to Feathercoin. Even bitcoin setups apply to some extent, especially with wallet and daemon (service).

There are also some open source application for Bitcoin or Litecoin, yet to be fully converted to Feathercoin so are opportunities still open to members to pursue.

I will be adding to the fault list and prioritising it as a “list of solutions to the most found...

0 0

Do you want to import the private key from your friend’s #bitcoin wallet? Maybe they can’t reach the blockchain? Maybe they don’t know how to import it themselves?

Well, here is how you do it using Bitcoin-qt 0.10.1

Some considerations:

I don’t store blockchain in the default location. I point Bitcoin-qt to an external drive using the command -datadir=“file_location”There is no RPC client functionality in bitcoind anymore. You have to use bitcoin-cli utility instead. (Wiki Needs Updating)

Start Bitcoin as a server- >bitcoinqt -server

This will require a bitcoin.conf file in \Bitcoin. The error messages are surprisingly helpful in setting this up.Save as “bitcoin.conf” -include quotes to force file type.

Unlock your wallet to receive new private key- >bitcoin-cli -datadir=F:\Bitcoin walletpassphrase “your_awesome_really_super_long_passphrase” 120

Import private key- >bitcoin-cli -datadir=F:\Bitcoin importprivkey...

0 0
0 0

Knowing the difference between importing a private key and sweeping it is important, especially if you use paper wallets.


When you import a private key, you’re simply adding it to the collection of private keys in your software wallet. If any bitcoins belong to the private key, they’ll now be included in your software wallet’s balance. But those bitcoins remain assigned to the private key: for instance, if you are importing a paper wallet, its bitcoins now exist on both the paper wallet and the software wallet. If anyone else gets their hands on that paper wallet’s private key, or have already had access to its private key, they can still spend its bitcoins. Additionally, any bitcoins sent to the paper wallet in the future will be credited both to the paper wallet and the software wallet.

Another important thing to keep in mind is that if any of the private key’s bitcoins are spent using the software wallet (i.e. making an online purchase), then the...

0 0
importing private keys | Localbitcoins


i have several private keys that i need to import into my wallet. but seem to be having a hard time ...what wallet is best for this and what am i doing wrong... any help is greatly appreciated



Blockchain ( Also has a tutorial ) in your wallet on blockchain simply go to "Import" ignore advance warning, cut n paste private key into box and import ( Not other option )


the android wallet does a good job too. (use sweep private key)


Do NOT use the android app ! Do not use at all, they have fatal flaws multiple time a year..


LOL I don't trust blockchain for anything...never...

0 0


~ The Longer Version ~

A few weeks ago, a friend came to me with a problem. Way back in 2011, he had the great idea to reinstall Windows. Without thinking too much about it, he installed the new version of Windows, and used the drive for a while. It was only later that he realized that the drive actually contained a good quantity if bitcoins. Luckily, he realized there was a chance that the actual data containing the keys may one day be recoverable, and immediately unplugged it and stored it away for safe keeping.

With the price approaching 1000 USD/BTC, he brought the drive to a local bitcoin meetup and asked around. One guy ran various profession forensics tools against the drive with no luck, and at the end of the night, the drive ended up in my hands.

Discussions of forensic hygiene out out of scope for this particular blog entry, but needless to say, my first step was using dd to pull the raw data...

0 0

Wallets are containers for private keys, usually implemented as structured files or simple databases. Another method for making keys is deterministic key generation. Here you derive each new private key, using a one-way hash function from a previous private key, linking them in a sequence. As long as you can re-create that sequence, you only need the first key (known as a seed or master key) to generate them all. In this section we will examine the different methods of key generation and the wallet structures that are built around them.

Nondeterministic (Random) Wallets

In the first bitcoin clients, wallets were simply collections of randomly generated private keys. This type of wallet is called a Type-0 nondeterministic wallet. For example, the Bitcoin Core client pregenerates 100 random private keys when first started and generates more keys as needed, using each key only once. This type of wallet is nicknamed "Just a Bunch Of Keys," or JBOK, and such wallets are...

0 0

I just went through a tutorial as a coding newbie. The tutorial was this one: And I wanted to generate my Bitcoin addresses/privkeys with 1 single easy to read (not cryptic) Python file - just in the style the code is written right now.

The tutorial got to the part where I got the Bitcoin address starting with a "1" but not the privkey starting with a "5". Plus I am missing how to BIP38 encrypt the private key (starting with a "6"). It's as you can see for the main Bitcoin network.

Was using as a step by step guide after the tutorial. In the end I commented out my tries to do it myself because it all was rubbish. (The part with "SHA256 HASHED EXTENDED PRIVATE KEY THIS IS WRONG ON SO MANY LEVELS") I think the part where I added the 80 bytes to the Private Key could be correct.

PS: I'm using a static private key for now until everything works, which is why I commented out...

0 0
0 0
Back to Table of Contents

Importing private keys

If you have a MultiBit Classic private keys export file you can re-import them into a MultiBit Classic wallet.

To import the private keys into a wallet, do the following:

In the 'Wallets' side panel choose the wallet you want to import the private keys into.

Select the menu option 'Tools | Import Private Keys'. The 'Import Private Keys' screen appears.

Choose the private key file to import by clicking on the 'Import from. . .' button. A file chooser opens and you can select the file you want to import.

If the import file is not password protected, the file is read and the number of keys and replay date for the file are shown. If the file is password protected, enter the password in the 'Password' field and press 'Unlock' to see the same information.

To import the private keys to the wallet specified, click on the button 'Import private keys'. When the import of the private key file is...

0 0

I’ve been struggling with exporting my private key from bitcoin-qt a little bit, so now when I successfully done it, I’m going to describe those steps here. I had old wallet.dat and switched to Electrum wallet, but after MININGCO.ETF closure I received some funds into my old wallet, so there was need to get them out. First I was trying to use PyWallet, but without any success. So I did it with CLI access to bitcoin-qt wallet. Here we go:

Download and unpack bitcoin-qt wallet, move wallet.dat to ~/.bitcoin directory, create bitcoin.conf in ~/.bitcoin directory and define rpcuser= and rpcpassword= in it, run ‚bitcoind -server‘ in terminal, unlock the wallet for 60 seconds like ‚read -s wp; ./bitcoin-cli walletpassphrase „$wp“ 60; unset wp‘, and finally dump private key ‚./bitcoin-cli dumpprivkey 1MyBitcoinAddress‘, which is written directly to terminal, lock the wallet ‚./bitcoin-cli walletlock‘.

Now it’s possible to copy private key and import it into Electrum or another...

0 0