trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
697 stars 246 forks source link

Different QR code in Suite than in Firmware #2513

Open tsusanka opened 3 years ago

tsusanka commented 3 years ago

As brought up by @robertbrada and discussed on Slack. Suite and firmware currently shows different QR code although the content is the same (or maybe different case?). Let's:

1) Investigate whether using https://github.com/nayuki/QR-Code-generator is possible in Suite and it returns the same result as in firmware. This library is being used in FW. 2) Make sure the content sent to the QR generator is the same for both Suite and FW (wrt upper/lower-case).

mroz22 commented 3 years ago

Dumb question here: Why doesn't firmware send generated QR right away? Possibly in base64 or something like this?

tsusanka commented 3 years ago

To Suite? Yeah we could do that but that seems kind of redundant since you already have the content (= address).

mroz22 commented 3 years ago

I completely agree with the principle that "anything that may be computed, should be computed" but also start questioning it in case when there are multiple possible outcomes.

robertbrada commented 3 years ago

According to this live JavaScript demo I found out that the library should generate the same QR code as the one that is generated on Trezor device (if the input is uppercase BTC address). So I think I can fix this issue

robertbrada commented 3 years ago

Sadly, it seems like the library can't be integrated that easily to Suite. One thing is, that the library is written in TypeScript only and has to be transpiled to JavaScript before use. Transpiling the library is a solvable thing, however, another strange error message appears after the library is transpiled to JavaScript. I don't know what to do with that easily, so I will move to working on other issues for now.

image

tsusanka commented 3 years ago

Ah pity. Yeah let's move it to backlog then and worry about this later.

nayuki commented 3 years ago

This is a mysterious compiler error message indeed. It looks like you might be using babel? The mentions of "Expression" and "TSModuleBlock" could suggest that you are using the wrong input version or output version of the ECMAScript standard. I'm just using Microsoft's tsc compiler.

tsusanka commented 3 years ago

@stepmes do we have some user confusion coming from this?

tsusanka commented 3 years ago

I believe we should do this when we conclude there is an actual user confusion coming out of this. @stepmes please reopen in case you find this significant in the user feedback.