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

could not sign tx on android #2033

Closed
tim-le opened this issue Nov 10, 2016 · 14 comments
Closed

could not sign tx on android #2033

tim-le opened this issue Nov 10, 2016 · 14 comments

Comments

@tim-le
Copy link

tim-le commented Nov 10, 2016

I use two android devices, one is online , second one is offline,
the offline phone exports the master public key to the online phone,
now let the online phone make an unsigned tx and show the qrcode,
then I try to sign this tx use the offline phone, but then I see no "sign" buttons on the offline phone.

@tim-le
Copy link
Author

tim-le commented Nov 11, 2016

sorry, I was not importing the master public key, instead a watching-only btc address which is from the online phone wallet was imported, I import one address for one wallet because on android there is no options about "use change addresses".

@JazzTp
Copy link

JazzTp commented Nov 13, 2016

tim-le, I would also be interested in using my old smartphone offline as cold storage, while having the more recent one online (I'll need to flash the old one to some Cyanogenmod, although it's working perfectly fine, because the latest Electrum Android version is not compatible with Android 2.2).

Do you please have the link to any tutorial handy on how the two phones would co-operate? Are the two Electrum-on-Android instances able to perform all communications through QRcodes and camera? Were you able to export your master public key and sign ongoing transactions etc. all through screen-to-camera communications?

(Actually, at present, I have Electrum-on-Android watch-only instance online [after importing the master public key from a cold storage generated with Electrum-on-desktop-Linux, with an offline Tails booted from their live DVD], and I confess that I can't figure out how to save an unsigned transaction from the Electrum-on-Android instance in order to load it into the cold storage Electrum-on-desktop-Linux instance in order to sign, save, reload it into the online Electrum-on-Android instance and send. If the two smartphones thing works through screen-to-camera communications, that might be even safer and faster to use than pairing an Android Electrum instance with a Trezor hardware wallet.)

Thank you.

@tim-le
Copy link
Author

tim-le commented Nov 13, 2016

hi JazzTp,
yes, by qrcode, all through screen-to-camera communications.
1, once you made a unsigned tx and tap the qrcode button
2, use your offline phone, goto Send tab, scan the qrcode
3, you should be able to see the button "Sign" , tap it, then tap the qrcode button.
4, back to your online phone, close the qrcode and cancel the unsigned tx dailog, goto Send, camera, scan the qrcode on the offline phone
5, finally, tap the button "broadcast".

@JazzTp
Copy link

JazzTp commented Nov 14, 2016

Hi tim-le,

Thank you very much, that's great news, I am now highly motivated into flashing my old smartphone to a newer Android version.

What if I wanted to also be able to sign outgoing transactions from a second cold storage which I'd only keep in an offline Electrum-on-desktop-Linux instance with no working webcam? Would that be possible too?

@tim-le
Copy link
Author

tim-le commented Nov 14, 2016

yes, instead of using qrcode, a unsigned tx can be saved to a file, then you copy it to your offline device, maybe a usbdisk is needed, then copy the signed tx file back to the online device and broadcast it.

@JazzTp
Copy link

JazzTp commented Nov 15, 2016

Thanks again tim-le, but that's the step I can't figure out when it comes to Electrum-on-Android online communicating with Electrum-on-Linux-desktop cold storage. On Android Electrum, how do you save to a file an unsigned tx? If you press the floppy disk icon it saves an "invoice"... I used a file manager to search for the file with no success.

@tim-le
Copy link
Author

tim-le commented Nov 15, 2016

well, I haven't tried to save an unsigned tx to a file on android, seems that's not available on android currently, in this case, I have a workaround for you,
1, instead of saving the unsigned tx to a file, try to take a screenshot of that qrcode
2, you need to figure out about how to decode qrcode from a PNG, maybe you can find an app helps.
3, the text decoded from qrcode is not directly accepted by loading a transaction, go to electrum console:
data = "text decoded from qrcode"
z = bitcoin.base_decode(data.decode('utf8'), length=None, base=43)
print ''.join(chr(ord(b)) for b in z).encode('hex')
a hex string................... (copy and paste to next step)....
4, Electrum->Tools->Load transaction->From text

have not been tested, good luck

@JazzTp
Copy link

JazzTp commented Nov 15, 2016

Hi tim-le, I see you have a good knowledge of the Electrum console usage, congrutulations. I've generally been able to find my way also in not very intuitive User Interfaces, so now I'm glad to see that I haven't turned so dumb as not to see something that might have been just there in good evidence on the Android version of Electrum.

Your workaround should certainly work, it would add a few steps though... I think for now the easy choice is to use Electrum-on-Android on both the online and offline cold storage instances, OR Electrum-on-desktop on both sides, and not assume, for now, that the two versions of Electrum can easily talk to each other.

(And I'll flash my old smartphone ASAP.)

Thank you again.

@ecdsa
Copy link
Member

ecdsa commented Nov 18, 2016

This is not related to android. It is caused by the way you use cold storage.

If your watching only wallet does not have the master public key, then it cannot know the address derivation.
In that case, the cold storage will not be able to sign, (unless the address is in the cold wallet)

The following combinations should work:

  1. Watching-only wallet: xpub. Cold storage: seed or xprv
  2. Watching-only wallet: imported address. Cold storage: imported privkey

However, this does not work:
3. watching-only wallet: imported address, cold storage: seed or xprv

@tim-le
Copy link
Author

tim-le commented Nov 18, 2016

got it, and will consider giving a option "use change addresses" on android?

@ecdsa
Copy link
Member

ecdsa commented Nov 18, 2016

yes we can add that option

@ecdsa
Copy link
Member

ecdsa commented Mar 6, 2017

this should be fixed by
5ee4cf4

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

No branches or pull requests

4 participants
@ecdsa @JazzTp @tim-le and others