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

Feature request: support general off-line wallets using QR codes #16

Closed
tomerweller opened this issue Apr 19, 2024 · 3 comments
Closed

Comments

@tomerweller
Copy link

Some power users might choose to use external signing devices. Currently xbull supports specific hardware wallets and lumen signer. It would be great to have a generalized version of that, so basically whenever a signature is required it would display the TX envelope XDR alongside it's QR representation. It would also allow importing the signed TX xdr either by pasting it or by using the camera to capture a QR code.

This is the mirror issue of this: stellar/laboratory#831

@earrietadev
Copy link
Collaborator

Hi there, this is something good to have. I deployed a new update (v1.20.0) to the stores with half of this: now in the signature drawer component there are two new buttons, one to copy the XDR and one to sign and copy the signed XDR
Screenshot 2024-04-21 at 22 32 06

After exporting and sending the XDR to someone else, that person can use the old "import XDR" functionality (lab > Import XDR from the wallet menu). There they can sign it and export it or directly submit it to the network.

Now, regarding the QR code. The problem there is that transaction XDRs can get pretty long if there are multiple operations or if is a soroban invocation with multiple authorized contracts; in those cases the QR code can get unreadable pretty quickly for some low end cameras if the image is not big enough. For that reason with Lumensigner we use multiple QRs where each one is a chunk of the XDR... This solves the issue with long XDRs but it brings another issue: The device reading the QR needs to know how that works and so it will be incompatible with most devices.

Here is how the QRs are handled with Lumensigner and how the Tx is cut in multiple pieces https://github.com/lightsail-network/lumensigner/blob/dev/docs/qr_formats.md (we just need to remove the account to sign with part)

Do you think that QR formatting could be added as a SEP so it's an standard? In theory a single QR should work ok with a good camera reading it because for example registering a domain in sorobandomains generates an XDR of ~1530 characters and a QR code can fit up to 4296 so most invocations should be ok... but uploading a contract or having too many operations will most likely fail. If we use the multiple QRs strategy we could handle all of the cases

@tomerweller
Copy link
Author

Awesome. Looking forward to checking out the new version (I'm still on 1.19.2)

Interesting idea on the multi-QR SEP. That definitely sounds like a comprehensive solution though on the more complex side. I think that most of the relevant invocations for cold wallets are going to be simple defi invocations (add/remove liquidity, swap, etc) and I suspect would fit comfortably on a single QR code. Having a single QR and a size limit might not be the worst thing as a starting point

@earrietadev
Copy link
Collaborator

Following the feedback, I've made a new update which includes this, now the two buttons in the screenshot above instead of directly copying the XDR, they will show the QR and below the QR is the "copy xdr" button.

I've already sent it to the stores (v1.21.0), Firefox already updated it but chrome normally takes a few days.

From the "import xdr" page, there is also a new button that allows Scanning a QR and that will import the transaction to sign

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

2 participants