MultiversX Tracker is Live!

Solution for P2SH non-standard derivation paths

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 152 Views

Creating P2SH (Nested Segwit) addresses from an imported BECH32 (Native Segwit) XPUB, when running Bitcoin Core (pre-2020 software) wallet (as watch-only, with private keys disabled) can lead to non-standard derivation paths for P2SH addresses, and this can result in XPRIV HWW signing failures/errors.

The standard derivation path for P2SH addresses is m/ 49’ /0’ /0’. I created my P2SH addresses with the non-standard derivation path of m/ 84’ /0’ /0’ (the standard derivation path for BECH32 (Native Segwit) as I used my BECH32 XPUB to create the wallet on Bitcoin Core (pre-2020 software).

You can check derivation path of addresses by using the ‘listunspent’ command on Bitcoin Core in console mode. In my case I noticed that:

• BECH32 (Native Segwit) addresses starting with 'bc1' have the following information in 'desc' field: (wkph)[xpubfingerprint] / 84' / 0' / 0'; and

• P2SH (Nested Segwit) addresses starting '3' with have the following information in 'desc' field: sh(wkph) [xpubfingerprint] / 84' / 0' / 0'

The derivation paths of the P2SH (Nested Segwit) were the same as for BECH32 (Native Segwit).

I managed to re-create the P2SH UTXOs in Sparrow as follows:

  1. going into Sparrow settings and turning off ‘validate derivation’;
  2. creating a P2SH (Nested Segwit) wallet on Sparrow by importing default XPUB for P2SH (Nested Segwit) from HWW;
  3. manually amending the derivation path section in Sparrow to m/ 84’ / 0' / 0';
  4. manually pasting the BECH32 (Native Segwit) XPUB (can be found on HWW) into XPUB section of Sparrow (i.e. replacing P2SH XPUB imported from HWW);
  5. rescanning on Sparrow and seeing all my P2SH UTXOs appear; and
  6. HWW signing for P2SH UTXOs worked.

Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
💰 Install these recommended apps:
💲 SocialGood - 100% Crypto Back on Everyday Shopping
💲 xPortal - The DeFi For The Next Billion
💲 CryptoTab Browser - Lightweight, fast, and ready to mine!
💰 Register on these recommended exchanges:
🟡 Binance🟡 Bitfinex🟡 Bitmart🟡 Bittrex🟡 Bitget
🟡 CoinEx🟡 Crypto.com🟡 Gate.io🟡 Huobi🟡 Kucoin.



Comments