Author

Topic: wallet.dat import public key without private key? (view only) (Read 2054 times)

legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
So... there's no way to import a public key without the private key (or using a bogus private key, that does not correspond with the public key). I'm guessing the reference client checks for the validity of the private key. But then, it's supposed to be encrypted and it can't know that, unless it uses some other form of checking.
Oh yeah I tried with an unencrypted wallet, I didn't try to put a bogus encrypted private key in an encrypted wallet
That might work actually!
I can't test until Monday I think though
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
So... there's no way to import a public key without the private key (or using a bogus private key, that does not correspond with the public key). I'm guessing the reference client checks for the validity of the private key. But then, it's supposed to be encrypted and it can't know that, unless it uses some other form of checking.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Finally I had some time and I tried, but like I thought the bitcoin client tells me the wallet is corrupted
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
I understand that, using an obscenely strong password (like 200 characters long or something.) But I don't need or want that for all my keys, just maybe a few. Together with coin control, you can just look at it.

I prefer the reference client simply because it's what I started with and well, it's the reference client.
member
Activity: 75
Merit: 10
Possibly another option is to have the wallet encrypted with a very strong password, burn the wallet to a CD and then move it to another cleanly installed machine/Ubuntu USB flash drive. From that second machine you would never sign a tx or message. View only. The decryption key would never be released into memory.

I prefer the reference client to other implementations. Offline tx would be nice.

You could spend your coins offline the hard way - disconnect that second instance from the Internet (never to be connected again), sign a tx, burn the wallet to CD and copy it to a third clean instance. Once the third instance has the full blockchain it will broadcast the tx.
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Yeah, I tried Armory. It will work for its intended purposes, but there's a bunch of things I don't like about it. It has watching only wallets.

My computer is set up in such a way that upon reboot all newly installed programs disappear, so I don't have to manually uninstall stuff I'm trying.

Anyway, I can wait for the added feature in your pywallet. I like the Satoshi client as is just fine.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
You can't put only a public key, wallet.dat stores the keys with 2 values, public key and private key
So yeah, your second solution could work
My concern is that I'm rather sure bitcoin checks that the two are corresponding, but it's worth trying

If you're up to modify pywallet for that, look into the importprivkey function
I don't think I'll have access to a computer until tomorrow evening to do it for you

Did you try Armory? I still didn't try it yet but I think you can import a wallet read-only. You'll still have to possess the private key though
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
For the main reference client or Satoshi client:

Can we import a public key only? Without the private key? It gets included in the wallet.dat file, and we can see the balance including that of the imported public key. But you can't spend it. You can't sign a message. You can't do anything.

This is different from having an encrypted wallet, because encrypted wallets have the private key, but you may or may not have the password or passphrase that decrypts the private keys.

As an aside, this is for the developer of pywallet and other third party wallet.dat applications: Can you import a public key into wallet.dat and simply have a bogus encrypted private key, so this would have the same effect, except you can never spend the coins since it will never decrypt to a proper private key.

Maybe this should be a feature of the next version (v0.9, or v0.8.2).
Jump to: