1

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.
1
  • 3
    Do you have a question or are you just documenting a problem that you found a solution for? If the latter, please write an appropriate question and put your solution as an answer.
    – Andrew Chow
    Apr 18, 2022 at 17:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy