Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online addresses + offline seed signing setup does not work #2897

Closed
goblin opened this issue Sep 19, 2017 · 14 comments · Fixed by #3762
Closed

Online addresses + offline seed signing setup does not work #2897

goblin opened this issue Sep 19, 2017 · 14 comments · Fixed by #3762

Comments

@goblin
Copy link

goblin commented Sep 19, 2017

I'm having problems with grayed out "Sign" button in 2.9.3. Haven't tried earlier versions.

My scenario:

  1. On an offline machine, I created wallet_1 with a seed. Then I copied the first generated bitcoin address to an online machine.
  2. I prepared the transaction on the online machine (watch-only wallet_2 with 1 imported bitcoin address)
  3. Finally I copied the transaction over back to the offline machine and loaded it from file. The "Sign" button is grayed out.

To actually sign the transaction on the offline machine I had to export the private key from the first address in wallet_1, and then to create a new standard wallet_3 using this (imported) private key. Only on wallet_3 could I sign the transaction.

As I understand it, the "Sign" button may be grayed out because Electrum doesn't know how far in the HD hierarchy to search for the key. However, it should at least scan the first ones that it's displaying in the Address tab. Preferably, if there's no key there, there should be an option to specify the HD index manually when displaying an unsigned transaction.

@ecdsa
Copy link
Member

ecdsa commented Sep 19, 2017

you cannot combine online addresses and offline seed, for the reason you explained.

you need one of those:

  • online xpub, offline seed
  • online addresses, offline set of import private keys

@ecdsa ecdsa closed this as completed Sep 19, 2017
@goblin
Copy link
Author

goblin commented Sep 19, 2017

Could this be left open as an enhancement proposal? I might consider implementing it myself.

The problem with online xpub is that Electrum only allows a single xpub key, so you cannot import multiple keys this way.

One problem with offline set of imported private keys is convenience: why should the user have to create more wallets than necessary to accomplish a simple task of signing a transaction? But the other problem is more severe: on the offline wallet, once you run out of original 20-or-so generated addresses, there's no visible way to create/export more of them. Allowing the user to specify an HD index manually when signing would make it easier. Another option would be to have a button to create more addresses.

@goblin
Copy link
Author

goblin commented Sep 19, 2017

Yet another good solution for me would be for Electrum to allow to import multiple public EC keys (as opposed to a single xpub) in the online wallet.

@ecdsa
Copy link
Member

ecdsa commented Sep 19, 2017

I don't see how you could possibly do this.
unless you want the user to manually enter the HD index, and I believe that would not be a feature.

@goblin
Copy link
Author

goblin commented Sep 19, 2017

I'll have to familiarize myself with the code a bit more to know the details.

But if the user can sign the transaction by copy&pasting keys around wallets, surely it can be automated instead.

@goblin
Copy link
Author

goblin commented Sep 19, 2017

I mean the human-language algorithm would be to:

  1. iterate over the available addresses (as shown in the Addresses tab) and check if any of them matches an input on the transaction being previewed
  2. if so, use its key to allow to Sign the transaction
  3. if not, keep the Sign button grayed out, together with a message saying a signing key was not found, and a button to look deeper or to specify an HD index manually

@ecdsa
Copy link
Member

ecdsa commented Sep 19, 2017

thats already what it does, except for the final part

@goblin
Copy link
Author

goblin commented Sep 19, 2017

Nope, that's not what happened to me. The offline seed-based wallet doesn't allow you to sign anything, even using the first address/key.

EDIT: OK, maybe it allows you to sign a transaction that was prepared from an xpub-wallet. But if the transaction was done from a watch-address-wallet, it doesn't. Haven't checked (yet)

@goblin
Copy link
Author

goblin commented Sep 19, 2017

In other words, I'm saying "online addresses, offline seed" doesn't work, for no real technical reason. It should work, at least with the first ~20 addresses generated from the seed.

goblin pushed a commit to goblin/electrum that referenced this issue Sep 26, 2017
goblin pushed a commit to goblin/electrum that referenced this issue Sep 27, 2017
@johnib
Copy link

johnib commented Dec 1, 2017

Where we at with this guys?
I’m unfamiliar with the technicalities but I have the wallet on an offline machine and the read only wallet on the online machine.

I want to be able to issue transactions created in the readonly and sign them in the offline machine.

For the signature, it should only need the private key - so I’m not sure what makes the above impossible.

Thanks !

@goblin
Copy link
Author

goblin commented Dec 2, 2017

@johnib I have a branch at https://github.com/goblin/electrum/tree/fix_2897 (pretty much unmaintained now) which implements an experimental version of this feature. Ecdsa didn't want it in master, so it'll probably never make it there.

There are two ways to do that without my patch:

  1. Use the master pubkey on the online machine instead of just a Bitcoin address or
  2. If you HAVE TO use the Bitcoin address on the online machine, then on the offline one you first have to pick the right address from the list manually, then right-click it and export its private key. Then you need to create a new offline wallet using just that private key, and it'll let you sign the tx with that.

@elliotolds
Copy link

I just ran into this problem as a new Electrum user. To me the workflow of "create offline wallet with new seed, create online wallet by importing the address you care about, create transaction online, sign it offline, ...etc" seems very natural and it's a shame that I have to do manual work (create a new offline wallet and import the relevant private key) every time I want to sign a transaction in this way.

The reason I don't want to import an xpub to the online machine is that I don't want to leak information about all addresses I control to the online machine.

@SomberNight SomberNight changed the title Grayed out "Sign" button in transaction preview on offline seed-based standard wallet Online addresses + offline seed signing setup does not work Jan 11, 2018
@cculianu
Copy link
Collaborator

@goblin I love your fix. It lets the average user get stuff done. The information to sign it is THERE in the wallet -- the fact that it can't be signed because the user didn't know what "Bip32" was and what an xpub seed is -- is a little weird to me too.

I'm thinking of creating a PR for the Electron Cash wallet to merge your fix in there.

Thank you so much for posting the link to your fix!!

@SomberNight
Copy link
Member

note: we might port Electron-Cash#484 but I want #3738 fixed first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants