Bitcoin Forum

Bitcoin => Electrum => Topic started by: Light on June 07, 2014, 06:16:02 AM



Title: Offline Transactions With Imported Private Key
Post by: Light on June 07, 2014, 06:16:02 AM
I've been wondering whether it's possible/ever will be possible to sign transactions offline but with imported private keys instead of key generated from the seed?

It's been stated it can be done. But the 'deseed' function doesn't seem to be working and I'm not too sure whether the functionality for this was removed.

yes, you can do it if you create your watching-only wallet with the 'deseed' command, from the wallet containing the imported keys

Would anyone know whether it can be done?


Title: Re: Offline Transactions With Imported Private Key
Post by: Abdussamad on June 07, 2014, 08:43:28 AM
deseed creates a wallet file with the extension .seedless. What happens when you run it?


Title: Re: Offline Transactions With Imported Private Key
Post by: Light on June 07, 2014, 10:15:02 AM
deseed creates a wallet file with the extension .seedless. What happens when you run it?

I'm just running 'deseed' in the console, so I'm not sure if the syntax is right. But this is what I get back.

Quote
Traceback (most recent call last):
NameError: name 'deseed' is not defined

I'm getting the feeling I'm doing it wrong. What is the correct syntax for deseeding a wallet?


Title: Re: Offline Transactions With Imported Private Key
Post by: Abdussamad on June 07, 2014, 10:32:02 AM
Code:
electrum deseed #default wallet
electrum -w /path/to/wallet/file deseed #other wallet

If the above doesn't work then what version electrum are you using?

edit: I just read your post again. You're not supposed to run it in the electrum console. You are supposed to run it on the command line i.e. command prompt on windows, shell on *nix.


Title: Re: Offline Transactions With Imported Private Key
Post by: dabura667 on June 07, 2014, 11:14:14 AM
Edit: I understand about deseed now. But this would involve creating seedless file then transfering that file from offline pc to online pc, that would be hard to do if you had labels and contacts you wanted to keep on your online wallet and you wanted to add watch only import address after the fact... the below method lets you keep all the labels on the online wallet AND add a watch only imported address.

In order to do what OP is asking, you would need to do the following:

(this assumes you already have an offline + online-watch-only wallet setup there.)

1. Import the Private Key to your offline computer wallet using "import key" function.

2. Copy down the Bitcoin address of the addresses you want to sign for offline and write them in a list in this format

Code:
'imported_keys': {'1QGCxG8cLJQCs5pCMotYBz8PQrA3ZoeXLH': '', '1BjNG9VwiidPbQJtZvWncLJp5wHWbcQKs2': '', '1K7sXxxirkpASjsVyVQbqDrqDqXQejaEj1': ''},
(Remember all the commas, and also the '' after : and before , is two apostrophes, not a quote.)

3. Find the watch-only wallet file on your online computer (should be default_wallet) and open it with a text editor.

4. go to the end of the text, until you see the following.

Code:
'seed_version': 4
(or whatever number is there, it doesn't matter.)

5. paste the formatted bitcoin addresses (in the format of #2) into the file just before the first ' in 'seed_version'. It should look like this now.

Code:
... 'imported_keys': {'1QGCxG8cLJQCs5pCMotYBz8PQrA3ZoeXLH': '', '1BjNG9VwiidPbQJtZvWncLJp5wHWbcQKs2': '', '1K7sXxxirkpASjsVyVQbqDrqDqXQejaEj1': ''},'seed_version': 4 ...
(the ... on both sides means there is stuff before and after this)

6. save the file.

7. Open Electrum and you will see the bitcoin addresses on the menu. You can see their balance, and spend their coins with an unsigned transaction. The unsigned transaction can be signed for them as long as you properly import the private keys into the offline computer.




There is no easy way to do this.

deseed will just make a Normal wallet into a seedless wallet. Imported addresses don't use the seed, so it is unrelated to your question.


Title: Re: Offline Transactions With Imported Private Key
Post by: Light on June 07, 2014, 11:46:09 AM
Code:
electrum deseed #default wallet
electrum -w /path/to/wallet/file deseed #other wallet

If the above doesn't work then what version electrum are you using?

edit: I just read your post again. You're not supposed to run it in the electrum console. You are supposed to run it on the command line i.e. command prompt on windows, shell on *nix.

Woops, thanks for clarifying that.

@dabura667: That is so awesome. Just tested it to give you a tip (https://blockchain.info/tx/4bdcde7a875b28d4fc649c1d262107fd1f26807303412f6f3a98020b7415a2d6) for that helpful advice! :) Thanks.


Title: Re: Offline Transactions With Imported Private Key
Post by: dabura667 on June 07, 2014, 12:14:51 PM
@dabura667: That is so awesome. Just tested it to give you a tip (https://blockchain.info/tx/4bdcde7a875b28d4fc649c1d262107fd1f26807303412f6f3a98020b7415a2d6) for that helpful advice! :) Thanks.
Thanks! Glad I could help  :)


Title: Re: Offline Transactions With Imported Private Key
Post by: Abdussamad on June 07, 2014, 02:11:58 PM
deseed creates a wallet file with the extension .seedless. What happens when you run it?
deseed does nothing to imported addresses.

Yes it does. I just tried it and it works. Import private key in offline wallet. Then run deseed to create watch only wallet. No manual copy pasting required. Also please see the quote in the OP from thomasv.