I've been messing around with an empty wallet file using the 'pywallet' utility, and have come across something I can't understand.

A dump of the unencrypted wallet readily reveals a list containing entries such as:

        "addr": "1NpYUPpz2E4fhYfoJRfUApa5hSPcrpCGaT", 
        "hexsec": "d38c1f602bc0bc90a54c5d743b3b75460c4aeeb1dc6ad62d3c6758c3714998a0", 
        "reserve": 1, 
        "sec": "5KRTGtTczAwef7vdDfm9knDyKMoaa8XHJURnMZnQFd5qkWVJtsB"

The second/fourth entries are obviously the private key. However, if I input this key at (for instance) bitaddress.org, it generates

        1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8 (address)
        1HoVqjG35pW3AQ7wtYtA72tSpyLyP4vDLp (compressed address)

neither of which match ANY of the other addresses listed in the dump. I can't find an explanation for this anywhere, and I'm wondering what the ramifications of losing, say, the first address in the key entry ('1NpYUP...') or the addresses in the pool are if they don't actually correspond to the private keys in the file.

Just a heads up - do not post your private key in public unless you'll no longer be using that Bitcoin address

Thanks in advance!

  • Have you tried sending 0.01 BTC to 1NpYUPpz2E4fhYfoJRfUApa5hSPcrpCGaT and to 1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8? Aug 14, 2012 at 9:33
  • I have not, simply because I won't feel comfortable using Bitcoin until I get a really good grasp of how everything -- especially the client, which I would use most frequently -- works. Because of this, I have only the 5 mBTC I got from the Bitcoin Faucet; not enough to avoid incurring a fee I can't yet afford! Aug 14, 2012 at 13:03
  • You can get a tiny amount of daily free bitcoins if you can put up with ads. I don't do this much, but it's perfect for seeding addresses. DailyBitcoin and CoinAd are two places that do this. Note: I have absolutely no interest in these site's success except for the few times I use them.
    – Daniel H
    Aug 14, 2012 at 16:40
  • Importing the private key (d38c1f602bc0bc90a54c5d743b3b75460c4aeeb1dc6ad62d3c6758c3714998a0) into Blockchain.info/wallet also yields 1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8. Aug 14, 2012 at 21:56
  • I used my GoBit testing suite and it also yields 1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8 gobittest.appspot.com/Address
    – ThePiachu
    Aug 15, 2012 at 12:04

2 Answers 2


Perhaps pywallet is misreporting the bitcoin address?

Does your wallet actually show a 1NpYUPpz2E4fhYfoJRfUApa5hSPcrpCGaT bitcoin address?

Here's a method to manually determine the public address for the private key.

  • Thanks for the response. The default address the wallet displays is 19x2Ma982vmtk5uJX7cb2WkEMcvYgCEAmz. Excluding this, the first address in the key pool according the pywallet data dump ("n": 2) is 1Hc7xyoBUBpvjtcr6LTmpQSssvPWGbtt8u; after firing up the Bitcoin-qt client and "making" a new address, these are indeed the addresses it displays. I'm inclined to say that the addresses in the key pool are the real deal, but it's still strange how the private keys listed in the dump don't match them. Aug 15, 2012 at 2:54
  • And for the record, when I get time tomorrow, I may swallow my pride and get a pittance of BTC tomorrow from those advertising sites, as per Daniel's recommendation. Then I can try sending them to the various addresses and see if I can recover them in any way. Aug 15, 2012 at 2:56
  • This escaped my notice initially, but my the 1NpYUP... address does actually appear in the key pool, at n=5! Indeed, some coins I sent there were received successfully and shortly thereafter began acquiring confirmations, as is typical! I've since realized that all of the addresses listed under the 'key' category also appear in the key pool, but with an order that seems random. BUT, this still doesn't explain why the pool addresses the private key associates with under 'addr' don't match up with the addresses generated by the private keys! Aug 16, 2012 at 1:54
  • I should also add that BTC sent to 1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8 never were received, despite that the private key from which it originated is in the wallet, according to the dump. I don't know what exactly this incriminates. Also, apologies for the quadruple comment! Aug 16, 2012 at 1:57
  • Well, somebody received those coins and spent them, probably because you posted the private key here. If you decide to use bitcoin for values of more than a few mBTC, you should probably generate an entirely new wallet separate from those here, or at least ensure you NEVER use these addresses again. blockchain.info/address/1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8
    – Daniel H
    Aug 17, 2012 at 16:04

My experiences messing around with all this tells me that the fault probably falls with my particular version of pywallet. Specifically, it is simply reporting the private keys inappropriately. The primary reason I think this is that the addresses in the pywallet dump corresponding to addresses that can both send and receive coins using the Bitcoin-qt client. Additionally, the pywallet utility can add its legitimate private keys to the wallet, and there's no problems -- the address and associated private key in the 'keys' entry match up. Hence, it's just a problem of reporting the correct results.

What I still don't get is why how the keys pywallet spits out are still legitimate. It's almost as if instead of using the private keys actually associated with each address through the client, it's generating its own. But I'm not terribly well versed in cryptography yet, and that's just the thoughts of a mind desperate for an explanation!

I'm still unsure of how to fully resolve this matter. I'd hate to ``downgrade'' my version of pywallet, so to speak, but it may be worthwhile to see if an older version behaves as expected.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.