question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different bip32 prefixes for various output scripts

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
dabura667commented, Dec 18, 2017

… 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.

0reactions
dcousenscommented, Jan 17, 2018

Closing in favour of https://github.com/bitcoinjs/bitcoinjs-lib/pull/927 (and move discussion there)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version bytes for BIP32 extended public and private keys
Abstract¶. BIP32 defines a serialization format for extended keys. This serialization includes four bytes allocated as version bytes.
Read more >
Bitcoin & SatoshiLabs improvement proposals (BIPs and SLIPs)
Bitcoin Improvement Proposals (BIPs) are open-design documents for introducing new standards and features to Bitcoin, such as new transaction types like ...
Read more >
List of address prefixes - Bitcoin Wiki
Decimal version Leading symbol Address length 0 1 up to 34 1 Q‑Z, a‑k, m‑o 33 2 o‑z, 2 33 or 34
Read more >
4. HD wallets (BIP-32) - Build your own Bitcoin hardware wallet
WARNING! I DO NOT PROVIDE ANY KEY RECOVERY SERVICES! BEWARE OF SCAMMERS!Content:- Hardened and non-hardened derivation- Serialization and ...
Read more >
CIP 5 - Common Bech32 Prefixes
This CIP defines a set of common prefixes (or so-called human-readable part in the bech32) encoding format) for various bech32-encoded binary data across ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found