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 cannot reproduce the problem. I always see 0x7de62... with both Trezor T and Trezor One. I tried a couple variations on the derivation path but can’t get to see 0xe6ff... anyhow.
Please make sure that both devices actually have the same seed, or that a passphrase doesn’t get mixed in somehow. Please check whether you’re also getting different Bitcoin addresses.
Changing the seed would be redundant as both devices (One and Model T) display: 0x7de62F234... inside Trezor Suite, confirming that seeds are the same? I have wiped both devices again anyway.
Below is a full output of addresses received between Trezor Suite & TrezorConnect.${method} for both devices using seed all all all with no passphrase:
Trezor Suite:
These are the addresses seen in Trezor Suite.
Account
Trezor One
Model T
Equal
Ethereum Goerli #1
0x7de62…
0x7de62…
Etherium #1
0x73d03…
0x73d03…
Bitcoin #1
bc1qannf…
bc1qannf…
Below are the method calls on TrezorConnect and their responses.
I’m running TrezorConnect.init() in the main process of Electron (Similar to NodeJS context) and using IPC to communicate with my UI.
@trezor/connect v9.0.6
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.