<p>Ledger is using <a href="https://github.com/LedgerHQ/ledger-live-desktop/issues/2527" rel="nofollow noreferrer">incorrect version prefix</a>. Most libraries/wallets/online tools use <a href="https://electrum.readthedocs.io/en/latest/xpub_version_bytes.html" rel="nofollow noreferrer">ypub format</a> for P2SH address</p>
<p>To make this work you can use any of the following tools to convert you xpub to ypub:</p>
<ul>
<li><a href="https://www.blockonomics.co/views/segwit_xpub_convert.html" rel="nofollow noreferrer">https://www.blockonomics.co/views/segwit_xpub_convert.html</a></li>
<li><a href="https://jlopp.github.io/xpub-converter/" rel="nofollow noreferrer">https://jlopp.github.io/xpub-converter/</a></li>
</ul>

CC BY-SA 4.0
2022-11-25T08:38:29.550Z
2022-11-25T08:38:29.550Z
dark knight
<p>I'm trying to Generate unused receiving Addresses for a Segwit P2SH wallet in my Ledger. I tried <code>https://pypi.org/project/bitcoinlib/</code> but without success, the addresses weren't right.</p>
<p>This is from my Ledger:</p>
<pre><code>{
  &quot;xpub&quot;: &quot;xpub...&quot;,
  &quot;index&quot;: 0,
  &quot;freshAddressPath&quot;: &quot;49'/0'/0'/0/6&quot;,
  &quot;id&quot;: &quot;js:2:bitcoin:xpub...:segwit&quot;,
  &quot;blockHeight&quot;: 753361
}
</code></pre>
<p>Thanks in Advance.</p>

<bitcoin-core><blockchain><p2sh><ledger-hardware-wallet>
How to Generate P2SH Address from XPUB Ledger
GoekhanDev
# How to Generate P2SH Address from XPUB Ledger

(Asked by: username_0 on 2022-10-16)

I'm trying to Generate unused receiving Addresses for a Segwit P2SH wallet in my Ledger. I tried `https://pypi.org/project/bitcoinlib/` but without success, the addresses weren't right.

This is from my Ledger:

```
{
  "xpub": "xpub...",
  "index": 0,
  "freshAddressPath": "49'/0'/0'/0/6",
  "id": "js:2:bitcoin:xpub...:segwit",
  "blockHeight": 753361
}

```

Thanks in Advance.

**Tags:** bitcoin-core, blockchain, p2sh, ledger-hardware-wallet


---

## 1 answers

### Answer by username_1 on 2022-11-25. Score: 1

Ledger is using [incorrect version prefix](https://github.com/LedgerHQ/ledger-live-desktop/issues/2527). Most libraries/wallets/online tools use [ypub format](https://electrum.readthedocs.io/en/latest/xpub_version_bytes.html) for P2SH address

To make this work you can use any of the following tools to convert you xpub to ypub:

* <https://www.blockonomics.co/views/segwit_xpub_convert.html>
* <https://jlopp.github.io/xpub-converter/>


---

