Bitcoin Forum
May 05, 2024, 07:07:41 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get Xpub for Specific Address on Ledger Nano  (Read 200 times)
dmanny77 (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
February 02, 2018, 03:22:47 PM
 #1

Trying to recover BCH sent to BTC segwit.  Being asked for Xpub for a specific address.  I exported the Xpub per instructions, but the response is that the xpub is wrong.

I suspect i am exporting the Xpub for the wrong address since they change.

Is there a way to find the Xpub for a specific address on Ledger nano?

Feeling stupid!
1714892861
Hero Member
*
Offline Offline

Posts: 1714892861

View Profile Personal Message (Offline)

Ignore
1714892861
Reply with quote  #2

1714892861
Report to moderator
1714892861
Hero Member
*
Offline Offline

Posts: 1714892861

View Profile Personal Message (Offline)

Ignore
1714892861
Reply with quote  #2

1714892861
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714892861
Hero Member
*
Offline Offline

Posts: 1714892861

View Profile Personal Message (Offline)

Ignore
1714892861
Reply with quote  #2

1714892861
Report to moderator
cellard
Legendary
*
Offline Offline

Activity: 1372
Merit: 1250


View Profile
February 02, 2018, 04:37:29 PM
 #2

Trying to recover BCH sent to BTC segwit.  Being asked for Xpub for a specific address.  I exported the Xpub per instructions, but the response is that the xpub is wrong.

I suspect i am exporting the Xpub for the wrong address since they change.

Is there a way to find the Xpub for a specific address on Ledger nano?

Feeling stupid!

Quote
Find the HD Public key for your wallets:

    Open the Ledger Wallet Chrome bitcoin app
    Click your account in the overview, it’s called “My account” by default
    Click “Account Settings” in the top right corner, under the balance
    Click “Export” next to “Extended public key”
    And when you see the QR code pop, you’re ready to begin the next part.

You can test the address by going to: https://blockchain.info/xpub/123XYZ where 123XYZ is your public key. You should see your transactions and balance.

source: https://keepingstock.net/storing-your-cryptocoins-in-a-bank-with-a-ledger-wallet-52d7895b9dd

From what wallet did you send BCH to a segwit address? it is a nested or bech32 address? I find it weird that a BCH wallet would allow you to send coins to a segwit format address, unless I misunderstood your post.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
February 02, 2018, 06:11:02 PM
 #3

Trying to recover BCH sent to BTC segwit.  Being asked for Xpub for a specific address.  I exported the Xpub per instructions, but the response is that the xpub is wrong.

I suspect i am exporting the Xpub for the wrong address since they change.

Is there a way to find the Xpub for a specific address on Ledger nano?

Feeling stupid!

The xpub is an extended public key, it contains all computers need to produce any wallet address you can use that corresponds to that xpub. It's essentially a master public key.

Each address is a public key (it is it's own, individual xpub but it's xpub string is instead a 1).

Think of it this way:
When a HD wallet is generated, a master private key (prv) is generated. This key produces your xpub. The prv can be used to obtain every private key of an address it is computationally synthesised from your seed. These are then used to produce/reproduce addresses (public keys beginning with a 1) and private keys (normally in plain text beginning with an l, a k or a 5).

Only your private keys/master private keys can spend coins, public keys can just produce addresses, provided you got the right wallet, it has only ONE xpub.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
February 03, 2018, 04:04:55 AM
Merited by Xynerise (1)
 #4

Trying to recover BCH sent to BTC segwit.  Being asked for Xpub for a specific address.  I exported the Xpub per instructions, but the response is that the xpub is wrong.
I suspect i am exporting the Xpub for the wrong address since they change.
Is there a way to find the Xpub for a specific address on Ledger nano?
Specific addresses don't have an "xpub"... the "xpub" is the master public key, from which all the addresses are derived.

It seems there might be a "bug" within the Ledger Wallet Bitcoin (Chrome App) that gives you an "xpub" for your SegWit wallet... which possibly should be a "ypub" for BIP49? Huh I'm not 100% sure on this point and haven't been able to find a solid answer if it should be "xpub" or "ypub" Undecided. The best reference I have found which explains the difference in simple terms is: https://support.samourai.io/article/49-xpub-s-ypub-s-zpub-s

Basically:
- xpub = Legacy wallet (legacy Bitcoin addresses)
- ypub = SegWit wallet (P2SH-P2WPKH addresses)
- zpub = SegWit wallet (P2WPKH addresses)

And from the Electrum release notes:
Quote
        * xpub/xprv : p2pkh or p2sh
         * ypub/yprv : p2wpkh-in-p2sh
         * Ypub/Yprv : p2wsh-in-p2sh
         * zpub/zprv : p2wpkh
         * Zpub/Zprv : p2wsh
So, I believe that the Ledger SegWit wallet should be giving a "ypub".

Anyway, I've been experimenting with Ian Coleman's Mnemonic Code Convertor (https://iancoleman.io/bip39/)... and found the following:

If you put your Ledger SegWit "xpub" as the "BIP32 Root Key", click the BIP141 tab and then delete the derivation path and retype it as m/0 (NOTE: even if it already says m/0, you MUST delete it and retype it)

You will see your Ledger SegWit "3" addresses listed below.

However, if you import your Ledger SegWit wallet into Electrum. (File -> New\Restore -> Standard Wallet -> Use hardware device -> Connect/Unlock your Ledger device -> set Derivation Path to m/49'/0'/0') And then take a look at the "Wallet -> Information", you will see you actually get a "ypub" and not an "xpub".

You can also put this "ypub" into the "Mnemonic Code Convertor", click the BIP141 tab and again use derivation path of m/0 and you'll get your Ledger SegWit "3" addresses listed below.



From what wallet did you send BCH to a segwit address? it is a nested or bech32 address? I find it weird that a BCH wallet would allow you to send coins to a segwit format address, unless I misunderstood your post.
It isn't weird... Ledger Nano (S and Blue) wallets generate P2SH-P2WPKH SegWit addresses... they start with "3" and are "backwards compatible" by design... as such, they look identical to any other P2SH "3" address and are therefore valid on both BTC and BCH networks.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!