I’m attempting to integrate Trezor Connect into an Electron App. I have both Model T and One devices. Calling TrezorConnect.getAccountInfo() “using path” I’m able to retrieve the correct address on Trezor Model T, but not on the Trezor One.
TrezorConnect.getAccountInfo() “using discovery”. This works on Trezor Suite, Metamask
I’ve tried copying, with no success on either device, MetaMask/eth-trezor-keyring which uses TrezorConnect.getPublicKey() and derives addresses using npm hdkey, npm @ethereumjs/util. Here’s what that code looks like:
I’m running TrezorConnect.init() in the main process of Electron (Similar to NodeJS context) and using IPC to communicate with my UI.
Hopefully the above clears up any questions you might have concerning my issue. If the above methods are incorrect or there is something not being done correctly, could you please point me in the right direction. Thanks in advance!
Side note: I tested a transfer on Bitcoin #1 account and it was immediately transferred out. I knew the risks in sending it there.
Right, I forgot about that part. That would seem to indicate the same seed, but with Trezor Connect, all the results are different, indicating that the problem is systemic somehow.
So there’s basically three options as to what might be going on:
a passphrase somehow gets used when running Model One through Trezor Connect in your app, but not in Suite.
Just to confirm, is the firmware up to date? Your Trezor should be showing a passphrase on screen if you use it. So if you don’t see the “confirm passphrase” screen, we can mostly rule this out. (Make sure that you unplug and replug the Trezor, to clear the internal session cache, and that no other app uses a passphrase while you’re testing this.)
something is messing with the communication, either changing the derivation paths on the way in, or changing the results on the way out.
there is a third Trezor with a different seed that gets called instead of your testing Trezor One unit.
I recently published this script that emulates Trezor Bridge. You can try running it instead of Trezor Bridge and observing the decoded communication. In the output, you would see the difference between calls to/from Trezor in the TT and T1 case – or in T1 + Suite vs T1 + your app.