Different bip32 prefixes for various output scripts
See original GitHub issueWhen we added segwit accounts at trezor wallet, we realized people are exporting/importing XPUBs wrong - meaning, XPUBs from P2WPKH-in-P2SH HD nodes to “traditional” P2PKH wallets, and that caused confusion.
Both us and Electrum added different xpub version magics for P2WPKH-in-P2SH XPUBs - the segwit xpubs now start at “Ypub”.
So instead of network.bip32.public_key
, there should be an array? Or something similar (also see https://github.com/trezor/trezor-common/blob/master/coins.json#L14 )
We also added special magic to litecoin p2wpkh-in-p2sh xpubs for this reason ( https://github.com/trezor/trezor-common/blob/master/coins.json#L173 ) - we did, however, just made the p2wpkh-in-p2sh litecoin up and we didn’t add all the other 8 magics, since we don’t need those in trezor web wallet.
I am not sure how to do this elegantly, and if it’s worth breaking compatibility.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
… I’d reeeeeeally like a BIP first…
But I see where the problem would lie.
Extended keys should use bech32 and just write the script in the hrp, imo.
Closing in favour of https://github.com/bitcoinjs/bitcoinjs-lib/pull/927 (and move discussion there)