Walletwasabi: Trezor enforces BIP44 keypath derivation on TestNet

Created on 23 Jun 2020  路  7Comments  路  Source: zkSNACKs/WalletWasabi

The latest Trezor firmware v2.3.1 will reject signing transactions if the coin type is not set according to the network. Wasabi is using "84'/0'/0'" by default on every network, so this new restriction in Trezor breaks the user space and you will not able to spend TestNet coins after the upgrade.

This issue is only for discussing how to resolve the current compatibility issue in a backward-compatible way, introduced by Trezor v2.3.1 firmware.

Solution one

Q: How does Trezor know the network?
A: We are sending it with the HWI command.

https://github.com/zkSNACKs/WalletWasabi/blob/146bd3284412426ee11a09d00e5b8332bc6b3ac6/WalletWasabi/Hwi/Parsers/HwiParser.cs#L336-L342

In the case of Trezor, this parameter can be removed. This is a hack, it might work I did not test it.

Solution two

Let the new firmware break the user space but provide a walkaround for the users, how "to make it work". This could be a considerable option as this related only to TestNet. It would be something like this:

  1. Open your TestNet Trezor wallet JSON file from the Wallets folder.
  2. Replace this line
    "AccountKeyPath": "84'/0'/0'",
    to
    "AccountKeyPath": "84'/1'/0'",
  3. Open Wasabi and generate a new address.
  4. Send all your TestNet funds to the new address. (downgrade your Trezor to v2.3.0 if you are on v2.3.1).
  5. Upgrade your your Trezor to the newest firmware.
  6. You will be able to spend the funds from the newly created address.
debug

All 7 comments

@molnard I've tested both solutions, 1st one is good, though the device is showing a mainnet address... which is fine i think. Second one however is failing for me at least.

image

so this new restriction in Trezor breaks the user space

Please, you can't expect honest conversation if you keep repeating dishonest stuff like this. BIP44 (introduced in 2014) is very clear on this: coin_type is the second element of the path and it is well defined - 0=Bitcoin 1=Testnet. Please read BIPs you are implementing more carefully next time, it will save everyone a lot of headache.

I've tested both solutions, 1st one is good, though the device is showing a mainnet address

This is hardly a good solution if you can't confirm the addresses visually on the device.

Solution 2 is OK, but I strongly recommend fixing the AccountKeyPath issue - when the network is Testnet/Regtest, set it to "84'/0'/1'" by default for new wallets.

so this new restriction in Trezor breaks the user space

Please, you can't expect honest conversation if you keep repeating stuff like this. BIP44 is very clear on this: coin_type is the second element of the path and it is well defined - 0=Bitcoin 1=Testnet. Please read BIPs you are implementing more carefully next time, it will save everyone a lot of problems in the future.

Please don't expect to not repeat stuff like that if Trezor repeats breaking compatibility. Trezor has an existing user base and the change you made prevents them to spend their funds - in this case on TestNet luckily. Pushing BIP44 into their face will not change the fact: Trezor's solutions breaking compatibility then forcefully pushes down the change on everyone else throat afterward. As I said before, this is not acceptable.

It's our job to make sure our standards are implemented properly. Now, the tide is out, it's clear who's been swimming naked.

It might hurt in the short term, but in the long term, the users will benefit from this.

Just for the record, next Trezor firmware release will introduce new option in settings, which will change current hard fails into warnings (like it was before): https://github.com/trezor/trezor-firmware/issues/1064

However I strongly recommend to fix Wasabi to comply with BIP standards. This issue is a nice showcase why such standards are important.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molnard picture molnard  路  3Comments

nopara73 picture nopara73  路  3Comments

yahiheb picture yahiheb  路  3Comments

2pac1 picture 2pac1  路  3Comments

MaxHillebrand picture MaxHillebrand  路  3Comments