Bitcoin

Unable to sign using Trezor T-derived multisig wallet using Electrum | Invalid script_type

I created a P2WSH multi-signature wallet using Electrum 4.0.9 using a single Trezor T and sent a large amount of BTC to it.

Electrum allowed me to set up a wallet using the same device when using two different derivatives. One is ” m/48’/0’/0’/2′ ” and the other is ” m/48’/0’/0’/3′ “.

If you try to sign using the first wallet derivative, you will receive an invalid multisig signature. This is illustrated when attempting to sign or view a transaction in the second wallet derivation of 3.invalid script_type error.

We’ve made some progress in identifying the problem, but we’ve hit a roadblock. As it turns out, script_type The 2 in the derived ” m/48’/0’/0’/2′ ” represents the default Segwit (P2WSH) wallet and the problem is that the only other script_type Currently defined in BIP 48 is Nested Segwit (P2SH-P2WSH), denoted as ” m/48’/0’/0’/1′ “.

I found this in the BIP 48 document which outlines the possible derivations below:

m / purpose' / coin_type' / account' / script_type' / change / address_index

(Source: https://github.com/bitcoin/bips/blob/master/bip-0048.mediawiki)

So, Electrum and Trezor allowed keys to be derived using undefined script_type 3, but now there is no definition for the script, so transactions to spend funds cannot be signed.

Of course I’m not going to blame the software for a misguided mistake, and I know it allows for future compatibility, but why does the code in Electrum and Trezor T allow key derivation using undefined scripts?

Is there a way I can define it? script_type 3 I would probably copy the code and do it myself script_type Can I extract the key from the HD seed and insert it into a new definition while still being able to access my funds?

I would really appreciate the help of anyone who is knowledgeable enough to answer this question and help ensure that some of the funds that are currently unavailable can be directed to someone who can help solve the problem.

Related Articles

Back to top button